mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-19 15:33:56 +00:00
Readd a feature lost in pw(8) refactoring
pw usermod foo -m It used to be able to (re)create the home directory if it didn't exists PR: 216224 Reported by: ae MFC after: 3 days
This commit is contained in:
parent
db569544d1
commit
6789e5acf2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=312644
@ -1697,6 +1697,10 @@ pw_user_mod(int argc, char **argv, char *arg1)
|
||||
edited = true;
|
||||
}
|
||||
|
||||
if (createhome && fstatat(conf.rootfd, pwd->pw_dir, &st, 0) == -1) {
|
||||
docreatehome = true;
|
||||
}
|
||||
|
||||
if (homedir && strcmp(pwd->pw_dir, homedir) != 0) {
|
||||
pwd->pw_dir = homedir;
|
||||
edited = true;
|
||||
|
Loading…
Reference in New Issue
Block a user