Merge pull request #231 from gjzkrug/useradd-maildir-fix

Removed hard-coded default mail spool in useradd
This commit is contained in:
Serge Hallyn 2021-12-04 22:26:51 -06:00 committed by GitHub
commit 19f08785f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2356,8 +2356,13 @@ static void create_mail (void)
mode_t mode;
spool = getdef_str ("MAIL_DIR");
#ifdef MAIL_SPOOL_DIR
if ((NULL == spool) && (getdef_str ("MAIL_FILE") == NULL)) {
spool = MAIL_SPOOL_DIR;
}
#endif /* MAIL_SPOOL_DIR */
if (NULL == spool) {
spool = "/var/mail";
return;
}
file = alloca (strlen (prefix) + strlen (spool) + strlen (user_name) + 2);
if (prefix[0])