If root starts passwd don't ask for current password

This commit is contained in:
sin 2014-06-09 12:33:15 +01:00
parent 4c38dffade
commit 834279b4a9
1 changed files with 5 additions and 0 deletions

View File

@ -25,6 +25,7 @@ main(int argc, char *argv[])
char *cryptpass1 = NULL, *cryptpass2 = NULL, *cryptpass3 = NULL;
char *p;
char template[] = "/tmp/pw.XXXXXX";
uid_t uid;
struct passwd *pw;
int ffd, tfd;
int r;
@ -44,6 +45,10 @@ main(int argc, char *argv[])
else if (!pw)
eprintf("who are you?\n");
uid = getuid();
if (uid == 0)
goto newpass;
switch (pw->pw_passwd[0]) {
case '!':
case '*':