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:
21
src/uutils.c
21
src/uutils.c
@@ -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 */
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user