Summary:ASTERISK-06001: [patch] When using ODBCSTORAGE, running as non-root, can't write to temp messages
Reporter:Lance Kimes (lkimes)Labels:
Date Opened:2006-01-06 19:15:20.000-0600Date Closed:2011-06-07 14:10:48
Versions:Frequency of
Environment:Attachments:( 0) app_voicemail_patch
( 1) app_voicemail-ODBC-svn7843.patch
Description:When using ODBCSTORAGE, app_voicemail will create a temp message and copy the voicemessage from the ODBC database into the temp voicemail file.

When using ODBCSTORAGE and running without root privledges, app_voicemail can create the needed temporary voicemail file but doesn't have permissions to write to it.  app_voicemail terminates unexpectantly and no one can hear their voicemail. Always reproducible, you just have to be running as someone other than root.

Found that the original programmer mostly used fopen, which will automatically set the mode to be 0660 for you when openned for writing. But there are 4 or 5 instances where the programmer used open instead and only once set the mode at all.  I've patched app_voicemail to set the mode to 0660 whenever using open.
Comments:By: Lance Kimes (lkimes) 2006-01-06 19:23:51.000-0600

Please change the severity from block to major.  I think that a more appropriate severity level.

By: Tilghman Lesher (tilghman) 2006-01-07 00:20:18.000-0600

Not a major bug.  There's a fairly easy workaround; just run Asterisk as root.

By: Jason Parker (jparker) 2006-01-07 13:36:26.000-0600

We should probably relate this to ASTERISK-5774.  If that one goes in first, we could use the same #define's in this.

By: Matt O'Gorman (mogorman) 2006-01-13 15:08:25.000-0600

5929 had similar problem with different implementation that should solve your problem upgrade to 8068

By: Lance Kimes (lkimes) 2006-05-08 15:37:23

There are still a couple of open calls not using the VOICEMAIL_FILE_MODE umask.  I've created a patch to fix that. Please look into this for possible inclusion in the next release of the 1.2 branch.


By: Serge Vecher (serge-v) 2006-05-08 17:22:04

to avoid confusion, please always open a new bug with a separate patch if the old bug was already committed. thanks.

By: Lance Kimes (lkimes) 2006-05-08 17:27:09

Will do.  

These 2 fixes were dropped by the maintainers from what was included in the 1.2 trunk.  I don't know why.

By: Serge Vecher (serge-v) 2006-06-06 16:10:40

actually, inpecting the sources, the first hunk is already in 1.2.9, so only the second one needs a commit.

By: Tilghman Lesher (tilghman) 2006-06-06 16:46:31

According to the manpage for open(2), the mode is ignored when O_CREAT is not specified.  Hence, there is no reason to apply this patch, as it will have no effect.