diff -u checkpassword-0.81/Makefile checkpassword_nosu/Makefile --- checkpassword-0.81/Makefile Sat Nov 21 15:29:52 1998 +++ checkpassword_nosu/Makefile Wed Jun 5 03:16:27 2002 @@ -32,18 +32,19 @@ it instcheck ./instcheck -checkpassword: \ -load checkpassword.o prot.o shadow.lib crypt.lib s.lib - ./load checkpassword prot.o `cat shadow.lib` `cat \ +checkpassword_nosu: \ +load checkpassword_nosu.o prot.o shadow.lib crypt.lib s.lib + ./load checkpassword_nosu prot.o `cat shadow.lib` `cat \ crypt.lib` `cat s.lib` checkpassword.0: \ checkpassword.8 nroff -man checkpassword.8 > checkpassword.0 -checkpassword.o: \ +checkpassword_nosu.o: \ compile checkpassword.c prot.h hasspnam.h hasuserpw.h ./compile checkpassword.c + cp checkpassword.o checkpassword_nosu.o chkshsgr: \ load chkshsgr.o @@ -173,7 +174,7 @@ ./compile open_trunc.c prog: \ -checkpassword +checkpassword_nosu prot.o: \ compile prot.c hasshsgr.h prot.h diff -u checkpassword-0.81/checkpassword.c checkpassword_nosu/checkpassword.c --- checkpassword-0.81/checkpassword.c Sat Nov 21 15:29:52 1998 +++ checkpassword_nosu/checkpassword.c Sat May 18 04:00:37 2002 @@ -81,7 +81,9 @@ int i; char **newenv; int numenv; - + int new_uid, new_gid; + char *tmpenv; + if (!argv[1]) _exit(2); uplen = 0; @@ -112,21 +114,6 @@ if (!*stored || strcmp(encrypted,stored)) _exit(1); - if (prot_gid((int) pw->pw_gid) == -1) _exit(1); - if (prot_uid((int) pw->pw_uid) == -1) _exit(1); - if (chdir(pw->pw_dir) == -1) _exit(111); - - numenv = 0; - while (environ[numenv]) ++numenv; - newenv = (char **) malloc((numenv + 4) * sizeof(char *)); - if (!newenv) _exit(111); - for (i = 0;i < numenv;++i) newenv[i] = environ[i]; - newenv[numenv++] = str1e2("USER",pw->pw_name); - newenv[numenv++] = str1e2("HOME",pw->pw_dir); - newenv[numenv++] = str1e2("SHELL",pw->pw_shell); - newenv[numenv] = 0; - environ = newenv; - execvp(argv[1],argv + 1); _exit(111); } diff -u checkpassword-0.81/hier.c checkpassword_nosu/hier.c --- checkpassword-0.81/hier.c Sat Nov 21 15:29:52 1998 +++ checkpassword_nosu/hier.c Wed Jun 5 03:14:20 2002 @@ -2,5 +2,5 @@ void hier() { - c(auto_home,"bin","checkpassword",-1,-1,0700); + c(auto_home,"bin","checkpassword_nosu",-1,-1,0700); }