diff options
author | ache <ache@FreeBSD.org> | 1994-11-25 02:27:08 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1994-11-25 02:27:08 +0000 |
commit | 0ab4afe05b61b75cdd52b5f31dec0bd2136b8169 (patch) | |
tree | 7798f1f78b5583e22eeb1159d0402fba9aec4489 /libexec | |
parent | 898bee8131b2bc15f70e9a52ca5de228968250ce (diff) | |
download | FreeBSD-src-0ab4afe05b61b75cdd52b5f31dec0bd2136b8169.zip FreeBSD-src-0ab4afe05b61b75cdd52b5f31dec0bd2136b8169.tar.gz |
Remove -u argument, does nothing for non-priviliged user.
Write LOGNAME in addition to USER as sun uucpd does.
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/uucpd/uucpd.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libexec/uucpd/uucpd.c b/libexec/uucpd/uucpd.c index 8f616c9..fbe2460 100644 --- a/libexec/uucpd/uucpd.c +++ b/libexec/uucpd/uucpd.c @@ -77,9 +77,10 @@ int hisaddrlen = sizeof hisctladdr; struct sockaddr_in myctladdr; int mypid; -char Username[64]; +char Username[64], Logname[64]; char *nenv[] = { Username, + Logname, NULL, }; extern char **environ; @@ -142,7 +143,7 @@ void login_incorrect(char *name, struct sockaddr_in *sinp) void doit(struct sockaddr_in *sinp) { - char user[64], passwd[64], ubuf[64]; + char user[64], passwd[64]; char *xpasswd, *crypt(); struct passwd *pw; pid_t s; @@ -172,7 +173,7 @@ void doit(struct sockaddr_in *sinp) } alarm(0); sprintf(Username, "USER=%s", pw->pw_name); - sprintf(ubuf, "-u%s", pw->pw_name); + sprintf(Logname, "LOGNAME=%s", pw->pw_name); if ((s = fork()) < 0) syslog(LOG_ERR, "fork: %m"); else if (s == 0) { @@ -181,7 +182,7 @@ void doit(struct sockaddr_in *sinp) initgroups(pw->pw_name, pw->pw_gid); chdir(pw->pw_dir); setuid(pw->pw_uid); - execl(pw->pw_shell, "uucico", ubuf, NULL); + execl(pw->pw_shell, "uucico", NULL); syslog(LOG_ERR, "execl: %m"); } _exit(1); |