Bug#307218: creates /.asterisk_history on reboot

Tzafrir Cohen tzafrir.cohen@xorcom.com
Mon, 02 May 2005 00:56:37 +0300


On Sun, May 01, 2005 at 11:29:07PM +0200, Kilian Krause wrote:
> Hi Norbert,
> 
> Am Sonntag, den 01.05.2005, 23:24 +0200 schrieb Norbert Tretkowski:
> > * Kilian Krause wrote:
> > > Am Sonntag, den 01.05.2005, 22:16 +0200 schrieb Norbert Tretkowski:
> > > > Asterisk creates a /.asterisk_history file on reboot, but not when
> > > > restarting or stopping it by manually.
> > > 
> > > AFAIR this bug was found to be only when run as root and being
> > > upstream aswell. Thus i'd recommend using the recommended "-U
> > > asterisk" as is set by the init scripts etc. Especially / shouldn't
> > > be writeable to the asterisk user in the first place.
> > 
> > Asterisk does run as user asterisk, I didn't change the init-script.
> 
> ok, good. 
> 
> > > I suggest you run for testing "asterisk -U asterisk -vvvvvvvc" or so
> > > and your problem is gone.
> > 
> > It's not.
> 
> well, then your / is writeable to the asterisk user? What's the exact
> steps to reproduce the bug? "reboot" the machine or the asterisk daemon?
> Is that also sufficient to just execute either of /etc/init.d/asterisk
> stop|start?

Also: delete /root/.asterisk_history before a restart and see if a
restart doesn't create it. When you run it manually, $HOME is /root,
whereas in the init scripts it is either / or not set (I'm not sure).

And just in case: when asterisk is running, run 
  
	lsof [/root]/.asterisk_history 

to make sure asterisk doesn't actually have right access to that file
after setting uid.

-- 
Tzafrir Cohen     icq#16849755  +972-50-7952406
tzafrir.cohen@xorcom.com  http://www.xorcom.com