diff options
author | qwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-03 21:44:27 +0000 |
---|---|---|
committer | qwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-03 21:44:27 +0000 |
commit | a7d8ecf800349be58cadf8020483e275971a4dc8 (patch) | |
tree | 7a3711414b0782ba16d0c3f36bff4fbff39944d7 | |
parent | 4d26c617254092a058ec7d8d414857f1367f5c93 (diff) |
mkstemp doesn't specify a file mode, so we should chmod it to VOICEMAIL_FILE_MODE
Taken from a larger patch by ltd - the rest of which is no longer necessary in trunk.
Closes issue #9231
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@73175 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | apps/app_voicemail.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 0073db895..f9a2027b3 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -3321,6 +3321,11 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_ ast_filerename(tmptxtfile, fn, NULL); rename(tmptxtfile, txtfile); + /* Properly set permissions on voicemail text descriptor file. + Unfortunately mkstemp() makes this file 0600 on most unix systems. */ + if (chmod(txtfile, VOICEMAIL_FILE_MODE) < 0) + ast_log(LOG_ERROR, "Couldn't set permissions on voicemail text file %s: %s", txtfile, strerror(errno)); + ast_unlock_path(dir); if (ast_check_realtime("voicemail_data")) { snprintf(tmpid, sizeof(tmpid), "%d", rtmsgid); |