Add support for s/keys

This commit is contained in:
Paul Traina 1994-09-29 20:54:41 +00:00
parent bd5d6eecd0
commit 122c9247d4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=3208
2 changed files with 16 additions and 2 deletions

View File

@ -1,8 +1,12 @@
# @(#)Makefile 8.1 (Berkeley) 7/19/93
PROG= su
LDADD= -lcrypt
DPADD= ${LIBCRYPT}
LDADD= -lcrypt -lskey
DPADD= ${LIBCRYPT} ${LIBSKEY}
SRCS= su.c login_skey.c
CFLAGS+=-DSKEY
.PATH: ${.CURDIR}/../login
.if exists(${DESTDIR}/usr/lib/libkrb.a) && (defined(MAKE_KERBEROS) \
|| defined(MAKE_EBONES))

View File

@ -68,6 +68,10 @@ int use_kerberos = 1;
#define ARGSTR "-flm"
#endif
#ifdef SKEY
char *skey_crypt(), *skey_getpass();
#endif
char *ontty __P((void));
int chshell __P((char *));
@ -165,8 +169,14 @@ main(argc, argv)
}
/* if target requires a password, verify it */
if (*pwd->pw_passwd) {
#ifdef SKEY
p = skey_getpass("Password:", pwd, 1);
if (strcmp(pwd->pw_passwd,
skey_crypt(p, pwd->pw_passwd, pwd, 1))) {
#else
p = getpass("Password:");
if (strcmp(pwd->pw_passwd, crypt(p, pwd->pw_passwd))) {
#endif
fprintf(stderr, "Sorry\n");
syslog(LOG_AUTH|LOG_WARNING,
"BAD SU %s to %s%s", username,