summaryrefslogtreecommitdiff
path: root/lib/util
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util')
-rw-r--r--lib/util/config.mk2
-rw-r--r--lib/util/util.c11
2 files changed, 8 insertions, 5 deletions
diff --git a/lib/util/config.mk b/lib/util/config.mk
index 47e026865e..6dc8354948 100644
--- a/lib/util/config.mk
+++ b/lib/util/config.mk
@@ -2,7 +2,7 @@
PUBLIC_DEPENDENCIES = \
LIBTALLOC LIBCRYPTO \
SOCKET_WRAPPER LIBREPLACE_NETWORK \
- CHARSET EXECINFO
+ CHARSET EXECINFO UID_WRAPPER
LIBSAMBA-UTIL_VERSION = 0.0.1
LIBSAMBA-UTIL_SOVERSION = 0
diff --git a/lib/util/util.c b/lib/util/util.c
index dea140148f..2a809d3ccb 100644
--- a/lib/util/util.c
+++ b/lib/util/util.c
@@ -133,14 +133,17 @@ _PUBLIC_ bool directory_create_or_exist(const char *dname, uid_t uid,
umask(old_umask);
return false;
}
- if ((st.st_uid != uid) ||
- ((st.st_mode & 0777) != dir_perms)) {
-#ifndef UID_WRAPPER_REPLACE
+ if (st.st_uid != uid && !uwrap_enabled()) {
+ DEBUG(0, ("invalid ownership on directory "
+ "%s\n", dname));
+ umask(old_umask);
+ return false;
+ }
+ if ((st.st_mode & 0777) != dir_perms) {
DEBUG(0, ("invalid permissions on directory "
"%s\n", dname));
umask(old_umask);
return false;
-#endif
}
}
return true;