summaryrefslogtreecommitdiff
path: root/source3/nsswitch/winbind_nss_config.h
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-04-25 05:47:50 +0000
committerAndrew Tridgell <tridge@samba.org>2001-04-25 05:47:50 +0000
commit5f9dca64daea8bf910a66e1178ad0336628fdc9f (patch)
tree16e3da57db7ae142a68559ff1031bfcede85ac85 /source3/nsswitch/winbind_nss_config.h
parent77076b01d286ad296930cd83cafc3a4bf0ae5db6 (diff)
downloadsamba-5f9dca64daea8bf910a66e1178ad0336628fdc9f.tar.gz
samba-5f9dca64daea8bf910a66e1178ad0336628fdc9f.tar.bz2
samba-5f9dca64daea8bf910a66e1178ad0336628fdc9f.zip
merge some of the nsswitch code from tng to head
the libnss_winbind.so from head now works with the winbindd from tng (This used to be commit 67ccfd2826548a6ca22562f9fb3ae156a57bd7db)
Diffstat (limited to 'source3/nsswitch/winbind_nss_config.h')
-rw-r--r--source3/nsswitch/winbind_nss_config.h62
1 files changed, 54 insertions, 8 deletions
diff --git a/source3/nsswitch/winbind_nss_config.h b/source3/nsswitch/winbind_nss_config.h
index c663842a81..5c09a5dd1b 100644
--- a/source3/nsswitch/winbind_nss_config.h
+++ b/source3/nsswitch/winbind_nss_config.h
@@ -70,17 +70,62 @@
#include <errno.h>
#include <pwd.h>
-#ifdef HAVE_NSS_H
+#ifdef HAVE_NSS_COMMON_H
+/* Sun Solaris */
+
+#include <nss_common.h>
+#include <nss_dbdefs.h>
+#include <nsswitch.h>
+
+typedef nss_status_t NSS_STATUS;
+
+#define NSS_STATUS_SUCCESS NSS_SUCCESS
+#define NSS_STATUS_NOTFOUND NSS_NOTFOUND
+#define NSS_STATUS_UNAVAIL NSS_UNAVAIL
+#define NSS_STATUS_TRYAGAIN NSS_TRYAGAIN
+
+#elif HAVE_NSS_H
+/* GNU */
+
#include <nss.h>
-#else
-/* Minimal needed to compile.. */
-enum nss_status {
-NSS_STATUS_SUCCESS,
-NSS_STATUS_NOTFOUND,
-NSS_STATUS_UNAVAIL
-};
+
+typedef enum nss_status NSS_STATUS;
+
+#else /* Nothing's defined. Neither gnu nor sun */
+
+typedef enum
+{
+ NSS_STATUS_SUCCESS,
+ NSS_STATUS_NOTFOUND,
+ NSS_STATUS_UNAVAIL,
+ NSS_STATUS_TRYAGAIN
+} NSS_STATUS;
+
#endif
+/* Declarations for functions in winbind_nss.c
+ needed in winbind_nss_solaris.c (solaris wrapper to nss) */
+
+NSS_STATUS _nss_winbind_setpwent(void);
+NSS_STATUS _nss_winbind_endpwent(void);
+NSS_STATUS _nss_winbind_getpwent_r(struct passwd* result, char* buffer,
+ size_t buflen, int* errnop);
+NSS_STATUS _nss_winbind_getpwuid_r(uid_t, struct passwd*, char* buffer,
+ size_t buflen, int* errnop);
+NSS_STATUS _nss_winbind_getpwnam_r(const char* name, struct passwd* result,
+ char* buffer, size_t buflen, int* errnop);
+
+NSS_STATUS _nss_winbind_setgrent(void);
+NSS_STATUS _nss_winbind_endgrent(void);
+NSS_STATUS _nss_winbind_getgrent_r(struct group* result, char* buffer,
+ size_t buflen, int* errnop);
+NSS_STATUS _nss_winbind_getgrnam_r(const char *name,
+ struct group *result, char *buffer,
+ size_t buflen, int *errnop);
+NSS_STATUS _nss_winbind_getgrgid_r(gid_t gid,
+ struct group *result, char *buffer,
+ size_t buflen, int *errnop);
+
/* I'm trying really hard not to include anything from smb.h with the
result of some silly looking redeclaration of structures. */
@@ -127,6 +172,7 @@ typedef int BOOL;
/* zero a structure given a pointer to the structure */
#define ZERO_STRUCTP(x) { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); }
+
/* Some systems (SCO) treat UNIX domain sockets as FIFOs */
#ifndef S_IFSOCK