mirror of git://git.suckless.org/ubase
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 *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 '*':
|
||||
|
|
Loading…
Reference in New Issue