[asterisk-dev] Asterisk crunches ACLs and umask by default, suggested fix

Rod Dorman rodd at polylogics.com
Thu Feb 16 13:47:35 MST 2006


On Thursday, February 16, 2006, 12:32:19, Ben Klang wrote:
> At the suggestion of kpfleming I am writing the list to propose the changes
> detailed in bug 6334.  The problem is that most calls to open() within 
> Asterisk use inconsistent and sometimes wacky file mode flags when specifying
> O_CREAT.  The most noticeable result of this are voicemail files that are
> marked 0700 and cannot be overridden with umask or default ACL settings.  As
> this prevents the system administrator from exercising the control normally
> afforded I created this patch.  

> This patch adds two defines to include/asterisk.h (AST_FILE_MODE and 
> AST_FILE_MODE_EXEC which map to 0666 and 0777 respectively.  These defines
> are called on every open() call I found that specified O_CREAT.  According to
> the manpage the mode is ignored on all open calls that do not flag O_CREAT.
> I considered naming the second AST_DIR_MODE but I felt that the name I gave
> it was more descriptive.    The result of this patch is that newly created
> files respect the umask and ACL settings configured by the systems 
> administrators.

> As Kevin rightly pointed out this touches a number of locations within 
> Asterisk and should be properly considered.  This patch is running on 3 of my
> systems with no problems.  I welcome any feedback and comments on this patch.

Well the first question that comes to mind is, Is there any down side?

Is there any scenario where this wouldn't be the expected thing to do?

-- 
rodd at polylogics.com    "Why do they call it 'raw sewage'?
Rod Dorman              Does somebody actually cook the stuff?".




More information about the asterisk-dev mailing list