summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/server.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-11-09 06:22:49 +0000
committerbrian <brian@FreeBSD.org>1997-11-09 06:22:49 +0000
commiteae0088b91cbc4408b450aa68745064732b86734 (patch)
tree330d8937c8f71a0d93df3a925214b73ae069d846 /usr.sbin/ppp/server.c
parentadcd7ae702997873c044a63779bc24521e2f9349 (diff)
downloadFreeBSD-src-eae0088b91cbc4408b450aa68745064732b86734.zip
FreeBSD-src-eae0088b91cbc4408b450aa68745064732b86734.tar.gz
Introduce ID0 logging.
Stay as the invoking uid as much as possible. Execution as a normal user is still forbidden for now, so these changes are pretty ineffective. The next commit will implement the modifications suggested on -hackers a number of days ago.
Diffstat (limited to 'usr.sbin/ppp/server.c')
-rw-r--r--usr.sbin/ppp/server.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/usr.sbin/ppp/server.c b/usr.sbin/ppp/server.c
index 4cc8f2e..7415e56 100644
--- a/usr.sbin/ppp/server.c
+++ b/usr.sbin/ppp/server.c
@@ -1,5 +1,5 @@
/*
- * $Id: $
+ * $Id: server.c,v 1.6 1997/10/26 01:03:39 brian Exp $
*/
#include <sys/param.h>
@@ -23,6 +23,7 @@
#include "vars.h"
#include "server.h"
#include "log.h"
+#include "id.h"
#include "defs.h"
int server = -2;
@@ -54,7 +55,7 @@ ServerLocalOpen(const char *name, mode_t mask)
ifsun.sun_family = AF_LOCAL;
strcpy(ifsun.sun_path, name);
- s = socket(PF_LOCAL, SOCK_STREAM, 0);
+ s = ID0socket(PF_LOCAL, SOCK_STREAM, 0);
if (s < 0) {
LogPrintf(LogERROR, "Local: socket: %s\n", strerror(errno));
return 3;
@@ -67,14 +68,14 @@ ServerLocalOpen(const char *name, mode_t mask)
if (errno == EADDRINUSE && VarTerm)
fprintf(VarTerm, "Wait for a while, then try again.\n");
close(s);
- unlink(name);
+ ID0unlink(name);
return 4;
}
umask(mask);
if (listen(s, 5) != 0) {
LogPrintf(LogERROR, "Local: Unable to listen to socket - OS overload?\n");
close(s);
- unlink(name);
+ ID0unlink(name);
return 5;
}
ServerClose();
@@ -101,7 +102,7 @@ ServerTcpOpen(int port)
return 6;
}
- s = socket(PF_INET, SOCK_STREAM, 0);
+ s = ID0socket(PF_INET, SOCK_STREAM, 0);
if (s < 0) {
LogPrintf(LogERROR, "Tcp: socket: %s\n", strerror(errno));
return 7;
@@ -134,7 +135,7 @@ ServerClose()
if (server >= 0) {
close(server);
if (rm) {
- unlink(rm);
+ ID0unlink(rm);
rm = 0;
}
}
OpenPOWER on IntegriCloud