1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-10 12:58:35 +03:00

lib:util: Log mkdir error on correct debug levels

For smbd we want an error and for smbclient we only want it in NOTICE
debug level.
The default log level of smbclient is log level 1 so we need notice to
not spam the user.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14253

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Mon Jan 27 15:55:24 UTC 2020 on sn-devel-184
This commit is contained in:
Andreas Schneider 2020-01-27 14:58:10 +01:00 committed by Günther Deschner
parent f9173c18a6
commit 0ad6a243b2

View File

@ -353,9 +353,12 @@ _PUBLIC_ bool directory_create_or_exist(const char *dname,
old_umask = umask(0);
ret = mkdir(dname, dir_perms);
if (ret == -1 && errno != EEXIST) {
DBG_WARNING("mkdir failed on directory %s: %s\n",
int dbg_level = geteuid() == 0 ? DBGLVL_ERR : DBGLVL_NOTICE;
DBG_PREFIX(dbg_level,
("mkdir failed on directory %s: %s\n",
dname,
strerror(errno));
strerror(errno)));
umask(old_umask);
return false;
}