]> git.cameronkatri.com Git - pw-darwin.git/commitdiff
Regression: fix pw usermod -d
authorBaptiste Daroussin <bapt@FreeBSD.org>
Sat, 12 Sep 2015 08:24:25 +0000 (08:24 +0000)
committerBaptiste Daroussin <bapt@FreeBSD.org>
Sat, 12 Sep 2015 08:24:25 +0000 (08:24 +0000)
Mark the user has having been edited if -d option is passed to usermod and
so the request change of home directory actually happen

PR: 203052
Reported by: lenzi.sergio@gmail.com
MFC after: 2 days

pw/pw_user.c

index 61d468ab059a1f4d388a811f177393a716036176..f13314750e1b34595559b5af35b2f9bd3990866b 100644 (file)
@@ -1694,6 +1694,7 @@ pw_user_mod(int argc, char **argv, char *arg1)
 
        if (homedir && strcmp(pwd->pw_dir, homedir) != 0) {
                pwd->pw_dir = homedir;
+               edited = true;
                if (fstatat(conf.rootfd, pwd->pw_dir, &st, 0) == -1) {
                        if (!createhome)
                                warnx("WARNING: home `%s' does not exist",