mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-03 19:08:58 +00:00
Only do a full pwd_mkdb for deletions; other operations may use the -u
option as an optimization. PR: 13346 Submitted by: Neil Blakey-Milner <nbm@rucus.ru.ac.za>
This commit is contained in:
parent
c5b72c3d85
commit
8ca1dc4b47
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=50653
@ -168,8 +168,12 @@ pw_update(struct passwd * pwd, char const * user, int mode)
|
||||
*/
|
||||
if (pwd != NULL)
|
||||
fmtpwentry(pwbuf, pwd, PWF_MASTER);
|
||||
if ((rc = fileupdate(getpwpath(_MASTERPASSWD), 0644, pwbuf, pfx, l, mode)) != 0)
|
||||
rc = pwdb(NULL) == 0;
|
||||
if ((rc = fileupdate(getpwpath(_MASTERPASSWD), 0644, pwbuf, pfx, l, mode)) != 0) {
|
||||
if (mode == UPD_DELETE)
|
||||
rc = pwdb(NULL) == 0;
|
||||
else
|
||||
rc = pwdb("-u", user, NULL) == 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
|
Loading…
Reference in New Issue
Block a user