Merge pull request #392 from hallyn/2021-07-25/useradd-defaults

useradd: create /etc/default saving defaults.
This commit is contained in:
Christian Brauner 2021-07-26 10:20:56 +02:00 committed by GitHub
commit 065aae682c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -567,6 +567,14 @@ static int set_defaults (void)
assert (wlen == (int) len -1);
}
ret = mkdir(dirname(NEW_USER_FILE), 0755);
if (-1 == ret && EEXIST != errno) {
fprintf (stderr,
_("%s: cannot create directory for defaults file\n"),
Prog);
goto setdef_err;
}
/*
* Create a temporary file to copy the new output to.
*/