X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fsys-osf.c;h=6d882a95c3af914e9bf105ced7c78d7df019de7a;hb=96ea87ebbd9f1bca4797b3d0c8b5de7e2635eb9a;hp=45e176f788caabc4fbf8ea8aef7cd376e8eac227;hpb=093489a1ce40a2075b1c5c9feb03c7ab1659d884;p=ppp.git diff --git a/pppd/sys-osf.c b/pppd/sys-osf.c index 45e176f..6d882a9 100644 --- a/pppd/sys-osf.c +++ b/pppd/sys-osf.c @@ -26,7 +26,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: sys-osf.c,v 1.24 1999/04/01 07:20:10 paulus Exp $"; +static char rcsid[] = "$Id: sys-osf.c,v 1.27 1999/05/12 06:16:16 paulus Exp $"; #endif #include @@ -200,7 +200,7 @@ sys_check_options() return 1; } - +#if 0 /* * daemon - Detach us from controlling terminal session. */ @@ -224,6 +224,7 @@ daemon(nochdir, noclose) } return 0; } +#endif /* * ppp_available - check whether the system has any ppp interfaces @@ -374,6 +375,13 @@ establish_ppp(fd) if (i != fd && i != sockfd) close(i); closed_stdio = 1; + /* make sure 0, 1, 2 are open to /dev/null */ + while ((i = open("/dev/null", O_RDWR)) >= 0) { + if (i > 2) { + close(i); + break; + } + } } /* @@ -1112,6 +1120,7 @@ sifdown(u) { struct ifreq ifr; + bzero(&ifr, sizeof(ifr)); strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); if (ioctl(sockfd, SIOCGIFFLAGS, &ifr) < 0) { error("Couldn't mark interface down (get): %m"); @@ -1204,7 +1213,8 @@ sifaddr(u, o, h, m) ret = 0; } - ifr.ifr_metric = link_mtu; + ifr.ifr_data = (caddr_t)&link_mtu; + if (ioctl(sockfd, SIOCSIPMTU, &ifr) < 0) { error("Couldn't set IP MTU: %m"); ret = 0; @@ -1434,9 +1444,9 @@ logwtmp(line, name, host) if ((fd = open(WTMPFILE, O_WRONLY|O_APPEND, 0)) < 0) return; if (!fstat(fd, &buf)) { - strlcpy(ut.ut_line, line, sizeof(ut.ut_line)); - strlcpy(ut.ut_name, name, sizeof(ut.ut_name)); - strlcpy(ut.ut_host, host, sizeof(ut.ut_host)); + strncpy(ut.ut_line, line, sizeof(ut.ut_line)); + strncpy(ut.ut_name, name, sizeof(ut.ut_name)); + strncpy(ut.ut_host, host, sizeof(ut.ut_host)); (void)time(&ut.ut_time); if (write(fd, (char *)&ut, sizeof(struct utmp)) != sizeof(struct utmp)) (void)ftruncate(fd, buf.st_size); @@ -1658,6 +1668,7 @@ get_pty(master_fdp, slave_fdp, slave_name, uid) return 1; } +#if 0 /* * Code for locking/unlocking the serial device. * This code is derived from chat.c. @@ -1761,6 +1772,7 @@ unlock() lock_file = NULL; } } +#endif int set_filters(pass, active)