summaryrefslogtreecommitdiff
path: root/lib/uid_wrapper
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-08-05 11:21:06 +1000
committerAndrew Tridgell <tridge@samba.org>2009-08-05 11:21:06 +1000
commit58e5e1ea8d4c5a9eb8d36aa8132fd1ba3985ca53 (patch)
treec66cc43d180750e40a4a7ffb42ca1bfe6bbd7f11 /lib/uid_wrapper
parentfd43e0ee09e3f82093e9a15dd6cbd2fbaa113426 (diff)
downloadsamba-58e5e1ea8d4c5a9eb8d36aa8132fd1ba3985ca53.tar.gz
samba-58e5e1ea8d4c5a9eb8d36aa8132fd1ba3985ca53.tar.bz2
samba-58e5e1ea8d4c5a9eb8d36aa8132fd1ba3985ca53.zip
make the UID_WRAPPER skip checks at runtime
This fixes two issues pointed out by Andrew. It adds a runtime uwrap_enabled() call that wraps the skips needed for uid emulation. It also makes the skip in the directory_create_or_exist() function only change the uid checking code, not the permissions code
Diffstat (limited to 'lib/uid_wrapper')
-rw-r--r--lib/uid_wrapper/uid_wrapper.c7
-rw-r--r--lib/uid_wrapper/uid_wrapper.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/uid_wrapper/uid_wrapper.c b/lib/uid_wrapper/uid_wrapper.c
index e009fa0b5c..948ff65b35 100644
--- a/lib/uid_wrapper/uid_wrapper.c
+++ b/lib/uid_wrapper/uid_wrapper.c
@@ -45,6 +45,13 @@ static void uwrap_init(void)
}
}
+#undef uwrap_enabled
+_PUBLIC_ int uwrap_enabled(void)
+{
+ uwrap_init();
+ return uwrap.enabled?1:0;
+}
+
_PUBLIC_ int uwrap_seteuid(uid_t euid)
{
uwrap_init();
diff --git a/lib/uid_wrapper/uid_wrapper.h b/lib/uid_wrapper/uid_wrapper.h
index e2df613f50..5d7c99d2b2 100644
--- a/lib/uid_wrapper/uid_wrapper.h
+++ b/lib/uid_wrapper/uid_wrapper.h
@@ -58,4 +58,6 @@
#endif
#define getgid uwrap_getgid
+int uwrap_enabled(void);
+
#endif /* __UID_WRAPPER_H__ */