mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-22 16:44:32 +01:00
Add support for s/keys
This commit is contained in:
parent
bd5d6eecd0
commit
122c9247d4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=3208
@ -1,8 +1,12 @@
|
|||||||
# @(#)Makefile 8.1 (Berkeley) 7/19/93
|
# @(#)Makefile 8.1 (Berkeley) 7/19/93
|
||||||
|
|
||||||
PROG= su
|
PROG= su
|
||||||
LDADD= -lcrypt
|
LDADD= -lcrypt -lskey
|
||||||
DPADD= ${LIBCRYPT}
|
DPADD= ${LIBCRYPT} ${LIBSKEY}
|
||||||
|
SRCS= su.c login_skey.c
|
||||||
|
CFLAGS+=-DSKEY
|
||||||
|
|
||||||
|
.PATH: ${.CURDIR}/../login
|
||||||
|
|
||||||
.if exists(${DESTDIR}/usr/lib/libkrb.a) && (defined(MAKE_KERBEROS) \
|
.if exists(${DESTDIR}/usr/lib/libkrb.a) && (defined(MAKE_KERBEROS) \
|
||||||
|| defined(MAKE_EBONES))
|
|| defined(MAKE_EBONES))
|
||||||
|
@ -68,6 +68,10 @@ int use_kerberos = 1;
|
|||||||
#define ARGSTR "-flm"
|
#define ARGSTR "-flm"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef SKEY
|
||||||
|
char *skey_crypt(), *skey_getpass();
|
||||||
|
#endif
|
||||||
|
|
||||||
char *ontty __P((void));
|
char *ontty __P((void));
|
||||||
int chshell __P((char *));
|
int chshell __P((char *));
|
||||||
|
|
||||||
@ -165,8 +169,14 @@ main(argc, argv)
|
|||||||
}
|
}
|
||||||
/* if target requires a password, verify it */
|
/* if target requires a password, verify it */
|
||||||
if (*pwd->pw_passwd) {
|
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:");
|
p = getpass("Password:");
|
||||||
if (strcmp(pwd->pw_passwd, crypt(p, pwd->pw_passwd))) {
|
if (strcmp(pwd->pw_passwd, crypt(p, pwd->pw_passwd))) {
|
||||||
|
#endif
|
||||||
fprintf(stderr, "Sorry\n");
|
fprintf(stderr, "Sorry\n");
|
||||||
syslog(LOG_AUTH|LOG_WARNING,
|
syslog(LOG_AUTH|LOG_WARNING,
|
||||||
"BAD SU %s to %s%s", username,
|
"BAD SU %s to %s%s", username,
|
||||||
|
Loading…
Reference in New Issue
Block a user