Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Jan 2017 18:55:01 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r312644 - head/usr.sbin/pw
Message-ID:  <201701221855.v0MIt1fk072891@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Sun Jan 22 18:55:01 2017
New Revision: 312644
URL: https://svnweb.freebsd.org/changeset/base/312644

Log:
  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

Modified:
  head/usr.sbin/pw/pw_user.c

Modified: head/usr.sbin/pw/pw_user.c
==============================================================================
--- head/usr.sbin/pw/pw_user.c	Sun Jan 22 18:31:49 2017	(r312643)
+++ head/usr.sbin/pw/pw_user.c	Sun Jan 22 18:55:01 2017	(r312644)
@@ -1697,6 +1697,10 @@ pw_user_mod(int argc, char **argv, char 
 		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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701221855.v0MIt1fk072891>