1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-27 04:12:51 +00:00

Remove the check_unix_password functionality from uutils.c (#297)

This code has not worked for a long time.  Most systems now maintain
the password entries so that a password is not accessible through the
getpwent() interface.  The SUBR that calls this interface may be
removed at a future time.
This commit is contained in:
Nick Briggs
2021-01-25 21:53:36 -08:00
committed by GitHub
parent 91ef549b15
commit 9ca86a662f
7 changed files with 9 additions and 34 deletions

View File

@@ -137,28 +137,7 @@ int c_string_to_lisp_string(char *C, LispPTR Lisp) {
/************************************************************************/
LispPTR check_unix_password(LispPTR *args) {
#ifndef DOS
struct passwd *pwd;
#ifndef OS5
char *crypt(const char *, const char *);
#endif /* OS5 */
char salt[3];
char name[100], pass[100];
if (lisp_string_to_c_string(args[0], name, sizeof name)) { return NIL; }
if (lisp_string_to_c_string(args[1], pass, sizeof pass)) { return NIL; }
if ((pwd = getpwnam(name)) == 0) { return (NIL); /* can't find entry for name */ }
salt[0] = pwd->pw_passwd[0];
salt[1] = pwd->pw_passwd[1];
salt[2] = '\0';
if (strcmp((char *)crypt(pass, salt), pwd->pw_passwd) == 0)
return (ATOM_T);
else
return (NIL);
#else
return ATOM_T;
#endif /* DOS */
}
/************************************************************************/