[asterisk-commits] qwell: trunk r73175 - /trunk/apps/app_voicemail.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 3 16:44:27 CDT 2007


Author: qwell
Date: Tue Jul  3 16:44:27 2007
New Revision: 73175

URL: http://svn.digium.com/view/asterisk?view=rev&rev=73175
Log:
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

Modified:
    trunk/apps/app_voicemail.c

Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?view=diff&rev=73175&r1=73174&r2=73175
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Tue Jul  3 16:44:27 2007
@@ -3320,6 +3320,11 @@
 					snprintf(txtfile, sizeof(txtfile), "%s.txt", fn);
 					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")) {




More information about the asterisk-commits mailing list