diff options
author | brian <brian@FreeBSD.org> | 2000-08-18 00:01:44 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2000-08-18 00:01:44 +0000 |
commit | bac59a32d06fce1477c920a3c8aad60f73ae9af9 (patch) | |
tree | 7688894f80a2ddf31d01f87489e92fffb7e1953c /usr.sbin/ppp/bundle.c | |
parent | c0049c3df2bfda77644542cc72cd5d7949841805 (diff) | |
download | FreeBSD-src-bac59a32d06fce1477c920a3c8aad60f73ae9af9.zip FreeBSD-src-bac59a32d06fce1477c920a3c8aad60f73ae9af9.tar.gz |
Make -DNOSUID (or -DPPP_NOSUID) possible to build ppp without SUID
capabilities.
Diffstat (limited to 'usr.sbin/ppp/bundle.c')
-rw-r--r-- | usr.sbin/ppp/bundle.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/usr.sbin/ppp/bundle.c b/usr.sbin/ppp/bundle.c index 00308c9..e6f8787 100644 --- a/usr.sbin/ppp/bundle.c +++ b/usr.sbin/ppp/bundle.c @@ -51,6 +51,9 @@ #include <sys/uio.h> #include <sys/wait.h> #if defined(__FreeBSD__) && !defined(NOKLDLOAD) +#ifdef NOSUID +#include <sys/linker.h> +#endif #include <sys/module.h> #endif #include <termios.h> @@ -1852,7 +1855,9 @@ bundle_setsid(struct bundle *bundle, int holdsession) waitpid(pid, &status, 0); /* Tweak our process arguments.... */ SetTitle("session owner"); +#ifndef NOSUID setuid(ID0realuid()); +#endif /* * Hang around for a HUP. This should happen as soon as the * ppp that we passed our ctty descriptor to closes it. |