summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/bundle.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2000-08-18 00:01:44 +0000
committerbrian <brian@FreeBSD.org>2000-08-18 00:01:44 +0000
commitbac59a32d06fce1477c920a3c8aad60f73ae9af9 (patch)
tree7688894f80a2ddf31d01f87489e92fffb7e1953c /usr.sbin/ppp/bundle.c
parentc0049c3df2bfda77644542cc72cd5d7949841805 (diff)
downloadFreeBSD-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.c5
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.
OpenPOWER on IntegriCloud