Index: app_voicemail.c =================================================================== --- app_voicemail.c (revision 26564) +++ app_voicemail.c (working copy) @@ -919,7 +919,7 @@ odbc_release_obj(obj); goto yuck; } - fd = open(full_fn, O_RDWR | O_CREAT | O_TRUNC); + fd = open(full_fn, O_RDWR | O_CREAT | O_TRUNC,0770); if (fd < 0) { ast_log(LOG_WARNING, "Failed to write '%s': %s\n", full_fn, strerror(errno)); SQLFreeHandle (SQL_HANDLE_STMT, stmt); @@ -949,7 +949,6 @@ if (!strcasecmp(coltitle, "recording")) { res = SQLGetData(stmt, x + 1, SQL_BINARY, NULL, 0, &colsize); fdlen = colsize; - fd = open(full_fn, O_RDWR | O_TRUNC | O_CREAT, 0770); if (fd > -1) { char tmp[1]=""; lseek(fd, fdlen - 1, SEEK_SET);