diff options
| author | svn2git <svn2git@FreeBSD.org> | 1994-07-01 08:00:00 +0000 |
|---|---|---|
| committer | svn2git <svn2git@FreeBSD.org> | 1994-07-01 08:00:00 +0000 |
| commit | 5e0e9b99dc3fc0ecd49d929db0d57c784b66f481 (patch) | |
| tree | e779b5a6edddbb949b7990751b12d6f25304ba86 /libexec/rexecd | |
| parent | a16f65c7d117419bd266c28a1901ef129a337569 (diff) | |
Diffstat (limited to 'libexec/rexecd')
| -rw-r--r-- | libexec/rexecd/Makefile | 6 | ||||
| -rw-r--r-- | libexec/rexecd/rexecd.c | 11 |
2 files changed, 17 insertions, 0 deletions
diff --git a/libexec/rexecd/Makefile b/libexec/rexecd/Makefile index 093e9a6444f7..5916212ae5de 100644 --- a/libexec/rexecd/Makefile +++ b/libexec/rexecd/Makefile @@ -2,6 +2,12 @@ PROG= rexecd MAN8= rexecd.8 +CFLAGS+= -DSKEY + +.PATH: ${.CURDIR}/../../usr.bin/key + +DPADD+= /usr/lib/libskey.a +LDADD+= -lskey .if exists(/usr/lib/libcrypt.a) DPADD+= ${LIBCRYPT} diff --git a/libexec/rexecd/rexecd.c b/libexec/rexecd/rexecd.c index 914e051ed916..ff2704bafe75 100644 --- a/libexec/rexecd/rexecd.c +++ b/libexec/rexecd/rexecd.c @@ -98,7 +98,13 @@ doit(f, fromp) struct sockaddr_in *fromp; { char cmdbuf[NCARGS+1], *cp, *namep; +#ifdef SKEY + char *skey_crypt(); + int permit_passwd = authfile(inet_ntoa(fromp->sin_addr)); + char user[16], pass[100]; +#else /* SKEY */ char user[16], pass[16]; +#endif /* SKEY */ struct passwd *pwd; int s; u_short port; @@ -154,7 +160,11 @@ doit(f, fromp) } endpwent(); if (*pwd->pw_passwd != '\0') { +#ifdef SKEY + namep = skey_crypt(pass, pwd->pw_passwd, pwd, permit_passwd); +#else /* SKEY */ namep = crypt(pass, pwd->pw_passwd); +#endif /* SKEY */ if (strcmp(namep, pwd->pw_passwd)) { error("Password incorrect.\n"); exit(1); @@ -208,6 +218,7 @@ doit(f, fromp) pwd->pw_shell = _PATH_BSHELL; if (f > 2) (void) close(f); + (void) setlogin(pwd->pw_name); (void) setgid((gid_t)pwd->pw_gid); initgroups(pwd->pw_name, pwd->pw_gid); (void) setuid((uid_t)pwd->pw_uid); |
