[Asterisk-Users] Safely editing voicemail.conf

Colin Anderson ColinA at landmarkmasterbuilder.com
Thu Feb 16 16:25:43 MST 2006


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 at complete.org]
Sent: Thursday, February 16, 2006 3:45 PM
To: asterisk-users at 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



More information about the asterisk-users mailing list