Don't attempt to create the base directory when -d is specified.

MFC after:	1 month
This commit is contained in:
Xin LI 2011-06-15 19:09:58 +00:00
parent 2191e465cc
commit 6a635ff4b4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=223115

View File

@ -163,7 +163,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
* If we'll need to use it or we're updating it,
* then create the base home directory if necessary
*/
if (arg != NULL || getarg(args, 'm') != NULL) {
if ((arg != NULL || getarg(args, 'm') != NULL) && (getarg(args, 'd') == NULL)) {
int l = strlen(cnf->home);
if (l > 1 && cnf->home[l-1] == '/') /* Shave off any trailing path delimiter */