summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-12-30 03:36:11 +0000
committerbrian <brian@FreeBSD.org>1999-12-30 03:36:11 +0000
commit7a49c5353eae55a58eca0de57ed432432624e1dc (patch)
treea8c6db3de6f4ba5408490ec8c2fa4f53c70e2ae6 /usr.sbin/ppp
parent48829a5d6b8a2d298f31a3d298c809338e2dfb1a (diff)
downloadFreeBSD-src-7a49c5353eae55a58eca0de57ed432432624e1dc.zip
FreeBSD-src-7a49c5353eae55a58eca0de57ed432432624e1dc.tar.gz
Correct usages of getuid() and geteuid()
Pointed out by: billf
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r--usr.sbin/ppp/bundle.c2
-rw-r--r--usr.sbin/ppp/chap.c2
-rw-r--r--usr.sbin/ppp/chat.c2
-rw-r--r--usr.sbin/ppp/command.c2
-rw-r--r--usr.sbin/ppp/exec.c2
-rw-r--r--usr.sbin/ppp/systems.c4
6 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/ppp/bundle.c b/usr.sbin/ppp/bundle.c
index ebacb5a..9ee00e2 100644
--- a/usr.sbin/ppp/bundle.c
+++ b/usr.sbin/ppp/bundle.c
@@ -1782,7 +1782,7 @@ bundle_setsid(struct bundle *bundle, int holdsession)
waitpid(pid, &status, 0);
/* Tweak our process arguments.... */
ID0setproctitle("session owner");
- setuid(geteuid());
+ setuid(ID0realuid());
/*
* Hang around for a HUP. This should happen as soon as the
* ppp that we passed our ctty descriptor to closes it.
diff --git a/usr.sbin/ppp/chap.c b/usr.sbin/ppp/chap.c
index b0d8742..36be4c5 100644
--- a/usr.sbin/ppp/chap.c
+++ b/usr.sbin/ppp/chap.c
@@ -253,7 +253,7 @@ chap_StartChild(struct chap *chap, char *prog, const char *name)
}
for (fd = getdtablesize(); fd > STDERR_FILENO; fd--)
fcntl(fd, F_SETFD, 1);
- setuid(geteuid());
+ setuid(ID0realuid());
command_Expand(nargv, argc, (char const *const *)argv,
chap->auth.physical->dl->bundle, 0, pid);
execvp(nargv[0], nargv);
diff --git a/usr.sbin/ppp/chat.c b/usr.sbin/ppp/chat.c
index c6acdb1..4484936 100644
--- a/usr.sbin/ppp/chat.c
+++ b/usr.sbin/ppp/chat.c
@@ -731,7 +731,7 @@ ExecStr(struct physical *physical, char *command, char *out, int olen)
open(_PATH_DEVNULL, O_RDWR); /* Leave it closed if it fails... */
for (i = getdtablesize(); i > 3; i--)
fcntl(i, F_SETFD, 1);
- setuid(geteuid());
+ setuid(ID0realuid());
execvp(argv[0], argv);
fprintf(stderr, "execvp: %s: %s\n", argv[0], strerror(errno));
_exit(127);
diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c
index 98ad92b..120d1a2 100644
--- a/usr.sbin/ppp/command.c
+++ b/usr.sbin/ppp/command.c
@@ -491,7 +491,7 @@ ShellCommand(struct cmdargs const *arg, int bg)
for (i = getdtablesize(); i > STDERR_FILENO; i--)
fcntl(i, F_SETFD, 1);
- setuid(geteuid());
+ setuid(ID0realuid());
if (arg->argc > arg->argn) {
/* substitute pseudo args */
char *argv[MAXARGS];
diff --git a/usr.sbin/ppp/exec.c b/usr.sbin/ppp/exec.c
index e9bf01a..0102704 100644
--- a/usr.sbin/ppp/exec.c
+++ b/usr.sbin/ppp/exec.c
@@ -126,7 +126,7 @@ exec_Create(struct physical *p)
case 0:
close(fids[0]);
timer_TermService();
- setuid(geteuid());
+ setuid(ID0realuid());
switch (fork()) {
case 0:
diff --git a/usr.sbin/ppp/systems.c b/usr.sbin/ppp/systems.c
index a570ceb..18a9df0 100644
--- a/usr.sbin/ppp/systems.c
+++ b/usr.sbin/ppp/systems.c
@@ -78,7 +78,7 @@ InterpretArg(const char *from, char *to)
ptr = strchr(++from, '/');
len = ptr ? ptr - from : strlen(from);
if (len == 0) {
- pwd = getpwuid(getuid());
+ pwd = getpwuid(ID0realuid());
} else {
strncpy(to, from, len);
to[len] = '\0';
@@ -184,7 +184,7 @@ AllowUsers(struct cmdargs const *arg)
struct passwd *pwd;
userok = 0;
- pwd = getpwuid(getuid());
+ pwd = getpwuid(ID0realuid());
if (pwd != NULL)
for (f = arg->argn; f < arg->argc; f++)
if (!strcmp("*", arg->argv[f]) || !strcmp(pwd->pw_name, arg->argv[f])) {
OpenPOWER on IntegriCloud