[asterisk-bugs] [Asterisk 0014912]: voicemail umask / permissions bug

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Apr 16 09:44:36 CDT 2009


The following issue has been SUBMITTED. 
====================================================================== 
http://bugs.digium.com/view.php?id=14912 
====================================================================== 
Reported By:                jcapp
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   14912
Category:                   Applications/app_voicemail
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
Asterisk Version:           SVN 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!): 188706 
Request Review:              
====================================================================== 
Date Submitted:             2009-04-16 09:44 CDT
Last Modified:              2009-04-16 09:44 CDT
====================================================================== 
Summary:                    voicemail umask / permissions bug
Description: 
The voicemail application has a bug where, depending on how it is compiled,
it doesn't retain the umask value that is read upon module load.  This is
the real source of the problem related to issues 0009231 and 0007504.

The problem is that since my_umask is not declared static, compilers are
not required to persist its value.  As such, some highly optimized
compilers will assign it a cpu register rather than variable space on the
stack.  Since my_umask is only set during module load, subsequent uses of
my_umask are unreliable as the register will surely have been overwritten
prior to its next use.

What made this difficult to diagnose was that the values seemed reasonably
close to real umask values, as the functions prior to its use were related
to the loading of the mask constant VOICEMAIL_FILE_MODE 0666.

The solution is simply to make my_umask static in app_voicemail.c



More information about the asterisk-bugs mailing list