diff options
author | brian <brian@FreeBSD.org> | 1997-06-13 02:07:32 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1997-06-13 02:07:32 +0000 |
commit | 1fd5f260cda7f6c95c4ac594c6bf879aeab7e3e4 (patch) | |
tree | 831ad05671253696bc09836cadf3a7237579254c /usr.sbin/ppp/os.c | |
parent | e6dedeb7e4bd1d34deb875f405b8b3a4457e09cc (diff) | |
download | FreeBSD-src-1fd5f260cda7f6c95c4ac594c6bf879aeab7e3e4.zip FreeBSD-src-1fd5f260cda7f6c95c4ac594c6bf879aeab7e3e4.tar.gz |
Add ppp.linkdown file to compliment ppp.linkup.
Submitted by: Forgotten
Passed on by: Terry Dwyer 61 8 9491 5161 <tdwyer@io.telstra.com.au>
Also remove extraneous setuid(0) - it's only undone by
the subsequent call to SelectSystem().
Diffstat (limited to 'usr.sbin/ppp/os.c')
-rw-r--r-- | usr.sbin/ppp/os.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/usr.sbin/ppp/os.c b/usr.sbin/ppp/os.c index 2c384ef..a37a760 100644 --- a/usr.sbin/ppp/os.c +++ b/usr.sbin/ppp/os.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: os.c,v 1.21 1997/06/01 03:43:26 brian Exp $ + * $Id: os.c,v 1.22 1997/06/09 03:27:31 brian Exp $ * */ #include "fsm.h" @@ -182,8 +182,6 @@ OsLinkup() char *s; if (linkup == 0) { - if (setuid(0) < 0) - LogPrintf(LogERROR, "setuid failed\n"); reconnectState = RECON_UNKNOWN; if (mode & MODE_BACKGROUND && BGFiledes[1] != -1) { char c = EX_NORMAL; @@ -201,12 +199,12 @@ OsLinkup() else LogPrintf(LogLCP, "OsLinkup: %s\n", s); - if (SelectSystem(inet_ntoa(IpcpInfo.want_ipaddr), LINKFILE) < 0) { + if (SelectSystem(inet_ntoa(IpcpInfo.want_ipaddr), LINKUPFILE) < 0) { if (dstsystem) { - if (SelectSystem(dstsystem, LINKFILE) < 0) - SelectSystem("MYADDR", LINKFILE); + if (SelectSystem(dstsystem, LINKUPFILE) < 0) + SelectSystem("MYADDR", LINKUPFILE); } else - SelectSystem("MYADDR", LINKFILE); + SelectSystem("MYADDR", LINKUPFILE); } linkup = 1; } @@ -226,8 +224,14 @@ OsLinkdown() if (!(mode & MODE_AUTO)) DeleteIfRoutes(0); - linkup = 0; + if (SelectSystem(s, LINKDOWNFILE) < 0) { + if (dstsystem) { + if (SelectSystem(dstsystem, LINKDOWNFILE) < 0) + SelectSystem("MYADDR", LINKDOWNFILE); + } else + SelectSystem("MYADDR", LINKDOWNFILE); + } } } |