We have a problem with Asterisk not locking voicemail.conf for update. It appears to not protect the file even against itself. It certainly doesn't use flock() to protect it against others. This is a problem for several reasons. First, of course, people can be hand-editing the file to add or remove users. Secondly, automated programs may be appending data to it for the same purpose. We've noticed corruption in our file that appears to occur when someone is changing their passwords at the same time that the file is being appended to. From looking at app_voicemail.c, Asterisk does nothing whatsoever to lock the file before modifying it. That sounds bad to me. Has anyone else seen this problem? What do you do to work around it? We're running Asterisk 1.2.1. -- John
I think you should discuss this with the bug marshals looks like a bug to me. On 2/16/06, John Goerzen <jgoerzen@complete.org> wrote:> We have a problem with Asterisk not locking voicemail.conf for update. > > It appears to not protect the file even against itself. It certainly > doesn't use flock() to protect it against others. > > This is a problem for several reasons. First, of course, people can be > hand-editing the file to add or remove users. Secondly, automated > programs may be appending data to it for the same purpose. > > We've noticed corruption in our file that appears to occur when someone > is changing their passwords at the same time that the file is being > appended to. From looking at app_voicemail.c, Asterisk does nothing > whatsoever to lock the file before modifying it. That sounds bad to me. > > Has anyone else seen this problem? What do you do to work around it? > > We're running Asterisk 1.2.1. > > -- John > > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > Asterisk-Users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >
This is a stupid way of doing it, but it works for me: 1. SCP the file to another box, edit it 2. SCP the file back (this makes the file operation atomic) 3. If your voicemail.conf changes all the time you have to wait until after hours to do this otherwise your conf file will change between edits. -----Original Message----- From: John Goerzen [mailto:jgoerzen@complete.org] Sent: Thursday, February 16, 2006 3:45 PM To: asterisk-users@lists.digium.com Subject: [Asterisk-Users] Safely editing voicemail.conf We have a problem with Asterisk not locking voicemail.conf for update. It appears to not protect the file even against itself. It certainly doesn't use flock() to protect it against others. This is a problem for several reasons. First, of course, people can be hand-editing the file to add or remove users. Secondly, automated programs may be appending data to it for the same purpose. We've noticed corruption in our file that appears to occur when someone is changing their passwords at the same time that the file is being appended to. From looking at app_voicemail.c, Asterisk does nothing whatsoever to lock the file before modifying it. That sounds bad to me. Has anyone else seen this problem? What do you do to work around it? We're running Asterisk 1.2.1. -- John _______________________________________________ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Maybe Matching Threads
- 2.2.25 dumps core with "Panic: file imap-client.c: line 837 (client_check_command_hangs): assertion failed: (client->io != NULL)"
- Vulnerability in Elm-ME+
- Printers don't stick
- Can not get realtime static voicemail.conf to work
- version 2.2.6 breaks compiling on Solaris 10 sparc