aboutsummaryrefslogtreecommitdiff
path: root/libexec/rexecd
diff options
context:
space:
mode:
authorGuido van Rooij <guido@FreeBSD.org>1994-08-21 19:10:43 +0000
committerGuido van Rooij <guido@FreeBSD.org>1994-08-21 19:10:43 +0000
commita670645c57e67382a9361923272e095486be2a79 (patch)
tree0c828267bb8b6452ff4a67d1a1919d41ac0fb456 /libexec/rexecd
parentd007582cfe39fd3ced95818bcdaa5f37ee294297 (diff)
downloadsrc-a670645c57e67382a9361923272e095486be2a79.tar.gz
src-a670645c57e67382a9361923272e095486be2a79.zip
Add skey support
Reviewed by: Submitted by: guido
Notes
Notes: svn path=/head/; revision=2195
Diffstat (limited to 'libexec/rexecd')
-rw-r--r--libexec/rexecd/Makefile5
-rw-r--r--libexec/rexecd/rexecd.c10
2 files changed, 13 insertions, 2 deletions
diff --git a/libexec/rexecd/Makefile b/libexec/rexecd/Makefile
index 0b225ba706e3..c9814f4ebd3a 100644
--- a/libexec/rexecd/Makefile
+++ b/libexec/rexecd/Makefile
@@ -2,8 +2,9 @@
PROG= rexecd
MAN8= rexecd.8
-LDADD= -lcrypt
-DPADD= ${LIBCRYPT}
+CFLAGS+= -DSKEY
+DPADD= ${LIBCRYPT} ${LIBSKEY}
+LDADD= -lcrypt -lskey
.include <bsd.prog.mk>
diff --git a/libexec/rexecd/rexecd.c b/libexec/rexecd/rexecd.c
index 796ad9cea936..7779934d357f 100644
--- a/libexec/rexecd/rexecd.c
+++ b/libexec/rexecd/rexecd.c
@@ -100,7 +100,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;
@@ -156,7 +162,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);