Ludovic Boué
2013-Apr-29 15:51 UTC
[asterisk-users] Asterisk 11.3.0 - Mask for new file not correct
Hello, I'm facing a rights issue on with Asterisk 11.3.0 running on CentOS release 5.8. Asterisk process is running with asterisk since it is define in asterisk.conf as following: runuser = asterisk rungroup = asterisk You can see asterisk proccess here: ps aux |egrep 'python|asterisk' root 11581 0.0 0.1 65940 600 ? S Apr17 0:00 /bin/sh /usr/sbin/safe_asterisk asterisk 11583 0.0 3.8 341560 19440 ? Sl Apr17 2:02 /usr/sbin/asterisk -f -vvvg -c The fact is we want to use the RECORDED_FILE function from Application_Record module and create a file with 666 permissions. But when I check the created file, rights are not what I expected. [root at STD1-SRVASTSVI-03 pseudos]$ ll -rw-r--r-- 1 asterisk asterisk 51244 mars 29 16:04 Pseudo_2_1111.wav I checked the doc on https://wiki.asterisk.org/wiki/display/AST/Application_Record but I didn't find anything about umask permissions. I checked Doxygen, I can see file creation permissions is set to 666 #define AST_FILE_MODE 0666 http://doxygen.asterisk.org/trunk/asterisk_8h.html#a6293b2dae52a2b470494df672a26c42 What can I do to fix that or debug? Ludovic BOU?
David M. Lee
2013-Apr-29 17:51 UTC
[asterisk-users] Asterisk 11.3.0 - Mask for new file not correct
On Apr 29, 2013, at 10:51 AM, Ludovic Bou? wrote:> The fact is we want to use the RECORDED_FILE function from Application_Record module and create a file with 666 permissions. But when I check the created file, rights are not what I expected. > > [root at STD1-SRVASTSVI-03 pseudos]$ ll > -rw-r--r-- 1 asterisk asterisk 51244 mars 29 16:04 Pseudo_2_1111.wav > > I checked the doc on https://wiki.asterisk.org/wiki/display/AST/Application_Record but I didn't find anything about umask permissions. I checked Doxygen, I can see file creation permissions is set to 666 > #define AST_FILE_MODE 0666 > http://doxygen.asterisk.org/trunk/asterisk_8h.html#a6293b2dae52a2b470494df672a26c42 > > What can I do to fix that or debug?The AST_FILE_MODE works by the same rules as mode parameter in open(2): "The effective permissions are modified by the process's umask in the usual way: The permissions of the created file are (mode & ~umask)."[1] My guess is that the umask of your asterisk process is 022, which is very typical. You'll have to play around with your umask settings and file permissions to get things the way you want them. [1]: http://linux.die.net/man/2/open> Ludovic BOU?-- David M. Lee Digium, Inc. | Software Developer 445 Jan Davis Drive NW - Huntsville, AL 35806 - USA Check us out at: www.digium.com & www.asterisk.org
Apparently Analagous Threads
- asterisk-users Digest, Vol 105, Issue 39
- Can anyone help with a quick app_record.c module improvement and can explain over-riding modules?
- Simple speech recognition for driving IVR - "press or say one".
- Can anyone help with a quick app_record.c module improvement and can explain over-riding modules?
- Asterisk 11.3.0 Now Available