[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linphone-developers] linphonecsh changes access rights to /dev/null

From: Eda Bejcek
Subject: [Linphone-developers] linphonecsh changes access rights to /dev/null
Date: Sun, 16 Oct 2011 14:06:53 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Hi, everyone,

there is a strange behaviour of linphonec daemon (version 3.4.3) when
spawning with root rights: It steals write rights to /dev/null device.

su root                  # without root rights, nothing wrong happens
ls -l /dev/null          # correct:          crw-rw-rw-
linphonecsh init         # <-- PROBLEM
ls -l /dev/null          # incorrect rights! crw-------
linphonecsh exit
chmod a+rw /dev/null     # (just to repair)  crw-rw-rw-

(Yes, I can avoid it by not running linphonecsh under the root, you are
right. :-)

But the reason is, that line 360 in coreapi/lpconfig.c changes the
permissions of config file; even if the file is empty or (in special
case of daemon linphonecsh) /dev/null.
 - In case of root -> it changes permissions of /dev/null (in an effort
   to hide a potential password in it :-).
 - In case of non-root -> permissions cannot be changed and a warning is
   printed (to /dev/null, by the way *).

So I patched that. If there are no sections in the config file (i.e. the
file is empty, corrupted, not a config file at all given just by
mistake, or /dev/null device), no permissions are changed.

* When spawning the daemon linphonecsh, all standard streams are
redirected to /dev/null. Naturally, no warning is printed after that,
not even 
      fprintf(stderr,"Fail to spawn linphonec: %s\n",strerror(errno));
on line 170 in console/shell.c. I suppose that this is not a bug, since
daemon is supposed to be quiet..?

Eda Bejcek

Attachment: patch_permissions.diff
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]