Add skey support

Reviewed by:
Submitted by:	guido
This commit is contained in:
Guido van Rooij 1994-08-21 19:10:43 +00:00
parent d007582cfe
commit a670645c57
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=2195
2 changed files with 13 additions and 2 deletions

View File

@ -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>

View File

@ -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);