s4:UID wrapper - Make it work on older distributions
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Sat, 30 Jan 2010 13:25:51 +0000 (14:25 +0100)
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Fri, 5 Feb 2010 18:47:26 +0000 (19:47 +0100)
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.

lib/uid_wrapper/uid_wrapper.c
lib/uid_wrapper/uid_wrapper.h

index f7f04316bfc77b6d99d827729e2ae739c7e37732..93ebb7c1897c3aeb63d8b336ace8417c61dc0b84 100644 (file)
    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_
index 5d7c99d2b27da60fe22d3bbe11c6b6a7e3c4862e..3d4222388296ccb637be543b92aeccbe67f7f5c4 100644 (file)
 #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__ */