If root starts passwd don't ask for current password
This commit is contained in:
parent
4c38dffade
commit
834279b4a9
5
passwd.c
5
passwd.c
|
@ -25,6 +25,7 @@ main(int argc, char *argv[])
|
||||||
char *cryptpass1 = NULL, *cryptpass2 = NULL, *cryptpass3 = NULL;
|
char *cryptpass1 = NULL, *cryptpass2 = NULL, *cryptpass3 = NULL;
|
||||||
char *p;
|
char *p;
|
||||||
char template[] = "/tmp/pw.XXXXXX";
|
char template[] = "/tmp/pw.XXXXXX";
|
||||||
|
uid_t uid;
|
||||||
struct passwd *pw;
|
struct passwd *pw;
|
||||||
int ffd, tfd;
|
int ffd, tfd;
|
||||||
int r;
|
int r;
|
||||||
|
@ -44,6 +45,10 @@ main(int argc, char *argv[])
|
||||||
else if (!pw)
|
else if (!pw)
|
||||||
eprintf("who are you?\n");
|
eprintf("who are you?\n");
|
||||||
|
|
||||||
|
uid = getuid();
|
||||||
|
if (uid == 0)
|
||||||
|
goto newpass;
|
||||||
|
|
||||||
switch (pw->pw_passwd[0]) {
|
switch (pw->pw_passwd[0]) {
|
||||||
case '!':
|
case '!':
|
||||||
case '*':
|
case '*':
|
||||||
|
|
Loading…
Reference in New Issue