On my system due to an incident earlier this week, I had changed the umask
of 022 to 077 to prevent other users from snooping in my user directory.
This has an indirect effect on pppd. pppd creates a pidfile in /var/run
(ppp0.pid). Unfortunately it seems to pick up the umask value and sets it
to r+w for owner only. This means I can start up pppd and not be able to
shut it down!

Here's a quick and dirty fix (for the pppd directory)

--- main.c.orig Thu Sep 23 19:51:45 1999
+++ main.c      Thu Sep 23 19:48:44 1999
@@ -1008,6 +1008,7 @@
     if ((pidfile = fopen(pidfilename, "w")) != NULL) {
        fprintf(pidfile, "%d\n", getpid());
        (void) fclose(pidfile);
+       chmod(pidfilename, 0660);
     } else {
        error("Failed to create pid file %s: %m", pidfilename);
        pidfilename[0] = 0;

However, I know this isn't the right fix. I am of the opinion that the
owner of the pidfile should be set to the person who started up pppd (i.e
me, not root). This then will means I can kill my little pppd daemon
easily and not be effected by the umask of 077. This is more secure too,
and can be overriden by root anyway. 

Cheers, 
Alex 
-- 

Legalise cannabis today!

http://www.tahallah.demon.co.uk - updated!


-
To unsubscribe from this list: send the line "unsubscribe linux-ppp" in
the body of a message to [EMAIL PROTECTED]

Reply via email to