summaryrefslogtreecommitdiff
path: root/lib/uid_wrapper
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2010-01-30 14:25:51 +0100
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2010-02-05 19:47:26 +0100
commite4d29bb4fd0564c39863b56c1a285d6e23e257ab (patch)
treecff2e4c2bd7c6c64d2425cbf294abedebad0e086 /lib/uid_wrapper
parent16aa0744c6820c5400b73fd4889608c38fc55b39 (diff)
downloadsamba-e4d29bb4fd0564c39863b56c1a285d6e23e257ab.tar.gz
samba-e4d29bb4fd0564c39863b56c1a285d6e23e257ab.tar.bz2
samba-e4d29bb4fd0564c39863b56c1a285d6e23e257ab.zip
s4:UID wrapper - Make it work on older distributions
On my older CentOS 4 installation I had the problem with the missing substitution prototypes ("uwrap_*"). So I added them to "uid_wrapper.h". Also, I made the head of the "uid_wrapper.c" file more like the one of "nss_wrapper.c" - it shouldn't change that much, I did it only to be consistent. This patch should fix the build on older distributions while keep it running on newer ones.
Diffstat (limited to 'lib/uid_wrapper')
-rw-r--r--lib/uid_wrapper/uid_wrapper.c12
-rw-r--r--lib/uid_wrapper/uid_wrapper.h12
2 files changed, 20 insertions, 4 deletions
diff --git a/lib/uid_wrapper/uid_wrapper.c b/lib/uid_wrapper/uid_wrapper.c
index f7f04316bf..93ebb7c189 100644
--- a/lib/uid_wrapper/uid_wrapper.c
+++ b/lib/uid_wrapper/uid_wrapper.c
@@ -15,10 +15,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifdef _SAMBA_BUILD_
+
#define UID_WRAPPER_NOT_REPLACE
-#include "includes.h"
+#include "../replace/replace.h"
+#include <talloc.h>
#include "system/passwd.h"
-#include "system/filesys.h"
+
+#else /* _SAMBA_BUILD_ */
+
+#error uid_wrapper_only_supported_in_samba_yet
+
+#endif
#ifndef _PUBLIC_
#define _PUBLIC_
diff --git a/lib/uid_wrapper/uid_wrapper.h b/lib/uid_wrapper/uid_wrapper.h
index 5d7c99d2b2..3d42223882 100644
--- a/lib/uid_wrapper/uid_wrapper.h
+++ b/lib/uid_wrapper/uid_wrapper.h
@@ -18,6 +18,16 @@
#ifndef __UID_WRAPPER_H__
#define __UID_WRAPPER_H__
+int uwrap_enabled(void);
+int uwrap_seteuid(uid_t euid);
+uid_t uwrap_geteuid(void);
+int uwrap_setegid(gid_t egid);
+uid_t uwrap_getegid(void);
+int uwrap_setgroups(size_t size, const gid_t *list);
+int uwrap_getgroups(int size, gid_t *list);
+uid_t uwrap_getuid(void);
+gid_t uwrap_getgid(void);
+
#ifdef seteuid
#undef seteuid
#endif
@@ -58,6 +68,4 @@
#endif
#define getgid uwrap_getgid
-int uwrap_enabled(void);
-
#endif /* __UID_WRAPPER_H__ */