summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/systems.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-06-25 19:30:05 +0000
committerbrian <brian@FreeBSD.org>1997-06-25 19:30:05 +0000
commitfef65421d3583585ef484383e7a06b2d6c75a1fb (patch)
tree2b34efd1359d865127c8be005bf629a29a898a4e /usr.sbin/ppp/systems.c
parent988f978710326fc294e3ebe6b7231a5b2807c6f8 (diff)
downloadFreeBSD-src-fef65421d3583585ef484383e7a06b2d6c75a1fb.zip
FreeBSD-src-fef65421d3583585ef484383e7a06b2d6c75a1fb.tar.gz
Add "set server" to control the server socket.
Catch SIGUSR1 to re-init listening socket. Document signal behaviour. Add missing '\n's to LogPrintf(LogWARN,...) Main() returns int not void. AF_LOCAL ideal suggested a long time ago by: joerg
Diffstat (limited to 'usr.sbin/ppp/systems.c')
-rw-r--r--usr.sbin/ppp/systems.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/ppp/systems.c b/usr.sbin/ppp/systems.c
index 0922dde..df75cc1 100644
--- a/usr.sbin/ppp/systems.c
+++ b/usr.sbin/ppp/systems.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: systems.c,v 1.11 1997/05/26 00:44:09 brian Exp $
+ * $Id: systems.c,v 1.12 1997/06/09 03:27:38 brian Exp $
*
* TODO:
*/
@@ -27,6 +27,7 @@
#include "ipcp.h"
#include "pathnames.h"
#include "vars.h"
+#include "server.h"
extern void DecodeCommand();
@@ -56,10 +57,12 @@ SetUserId()
if (!usermode) {
if (setreuid(euid, uid) == -1) {
LogPrintf(LogERROR, "unable to setreuid!\n");
+ ServerClose();
exit(1);
}
if (setregid(egid, gid) == -1) {
LogPrintf(LogERROR, "unable to setregid!\n");
+ ServerClose();
exit(1);
}
usermode = 1;
@@ -72,10 +75,12 @@ SetPppId()
if (usermode) {
if (setreuid(uid, euid) == -1) {
LogPrintf(LogERROR, "unable to setreuid!\n");
+ ServerClose();
exit(1);
}
if (setregid(gid, egid) == -1) {
LogPrintf(LogERROR, "unable to setregid!\n");
+ ServerClose();
exit(1);
}
usermode = 0;
@@ -165,6 +170,7 @@ char *file;
if (wp == NULL) {
LogPrintf(LogWARN, "Bad rule in %s (line %d) - missing colon.\n",
filename, linenum);
+ ServerClose();
exit(1);
}
*wp = '\0';
OpenPOWER on IntegriCloud