1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

nsswitch: maintain prototypes for the linux based functions only once

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13344

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
This commit is contained in:
Stefan Metzmacher 2017-10-21 14:08:15 +02:00
parent 329a229af3
commit b8c30abb02
6 changed files with 27 additions and 96 deletions

View File

@ -30,6 +30,7 @@
*/ */
#include "nsswitch/winbind_nss_solaris.h" #include "nsswitch/winbind_nss_solaris.h"
#include "nsswitch/winbind_nss_linux.h"
#elif HAVE_NSS_H #elif HAVE_NSS_H
@ -37,6 +38,10 @@
* Linux (glibc) * Linux (glibc)
*/ */
#include <nss.h>
typedef enum nss_status NSS_STATUS;
#include "nsswitch/winbind_nss_linux.h" #include "nsswitch/winbind_nss_linux.h"
#elif HAVE_NS_API_H #elif HAVE_NS_API_H
@ -60,6 +65,7 @@
*/ */
#include "nsswitch/winbind_nss_netbsd.h" #include "nsswitch/winbind_nss_netbsd.h"
#include "nsswitch/winbind_nss_linux.h"
#else /* Nothing's defined. Neither gnu nor netbsd nor sun nor hp */ #else /* Nothing's defined. Neither gnu nor netbsd nor sun nor hp */

View File

@ -24,25 +24,6 @@
#include "winbind_client.h" #include "winbind_client.h"
/* Make sure that the module gets registered needed by freebsd 5.1 */ /* Make sure that the module gets registered needed by freebsd 5.1 */
extern enum nss_status _nss_winbind_getgrent_r(struct group *, char *, size_t,
int *);
extern enum nss_status _nss_winbind_getgrnam_r(const char *, struct group *,
char *, size_t, int *);
extern enum nss_status _nss_winbind_getgrgid_r(gid_t gid, struct group *, char *,
size_t, int *);
extern enum nss_status _nss_winbind_setgrent(void);
extern enum nss_status _nss_winbind_endgrent(void);
extern enum nss_status _nss_winbind_initgroups_dyn(char *, gid_t, long int *,
long int *, gid_t **, long int , int *);
extern enum nss_status _nss_winbind_getpwent_r(struct passwd *, char *, size_t,
int *);
extern enum nss_status _nss_winbind_getpwnam_r(const char *, struct passwd *,
char *, size_t, int *);
extern enum nss_status _nss_winbind_getpwuid_r(gid_t gid, struct passwd *, char *,
size_t, int *);
extern enum nss_status _nss_winbind_setpwent(void);
extern enum nss_status _nss_winbind_endpwent(void);
ns_mtab *nss_module_register(const char *, unsigned int *, nss_module_unregister_fn *); ns_mtab *nss_module_register(const char *, unsigned int *, nss_module_unregister_fn *);
NSS_METHOD_PROTOTYPE(__nss_compat_getgrnam_r); NSS_METHOD_PROTOTYPE(__nss_compat_getgrnam_r);

View File

@ -36,28 +36,6 @@ static pthread_mutex_t winbind_nss_mutex = PTHREAD_MUTEX_INITIALIZER;
#define MAX_GETPWENT_USERS 250 #define MAX_GETPWENT_USERS 250
#define MAX_GETGRENT_USERS 250 #define MAX_GETGRENT_USERS 250
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 uid, struct passwd *result,
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_getgrlst_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);
NSS_STATUS _nss_winbind_initgroups_dyn(char *user, gid_t group, long int *start,
long int *size, gid_t **groups,
long int limit, int *errnop);
/************************************************************************* /*************************************************************************
************************************************************************/ ************************************************************************/

View File

@ -22,8 +22,26 @@
#ifndef _WINBIND_NSS_LINUX_H #ifndef _WINBIND_NSS_LINUX_H
#define _WINBIND_NSS_LINUX_H #define _WINBIND_NSS_LINUX_H
#include <nss.h> NSS_STATUS _nss_winbind_setpwent(void);
NSS_STATUS _nss_winbind_endpwent(void);
typedef enum nss_status NSS_STATUS; NSS_STATUS _nss_winbind_getpwent_r(struct passwd *result, char *buffer,
size_t buflen, int *errnop);
NSS_STATUS _nss_winbind_getpwuid_r(uid_t uid, struct passwd *result,
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_getgrlst_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);
NSS_STATUS _nss_winbind_initgroups_dyn(char *user, gid_t group, long int *start,
long int *size, gid_t **groups,
long int limit, int *errnop);
#endif /* _WINBIND_NSS_LINUX_H */ #endif /* _WINBIND_NSS_LINUX_H */

View File

@ -38,32 +38,6 @@
static struct group _winbind_group; static struct group _winbind_group;
static char _winbind_groupbuf[1024]; static char _winbind_groupbuf[1024];
/*
* We need a proper prototype for this :-)
*/
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 uid, struct passwd *result,
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_getgrlst_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);
NSS_STATUS _nss_winbind_initgroups_dyn(char *user, gid_t group, long int *start,
long int *size, gid_t **groups,
long int limit, int *errnop);
int int
netbsdwinbind_endgrent(void *nsrv, void *nscb, va_list ap) netbsdwinbind_endgrent(void *nsrv, void *nscb, va_list ap)
{ {

View File

@ -34,30 +34,4 @@ typedef nss_status_t NSS_STATUS;
#define NSS_STATUS_UNAVAIL NSS_UNAVAIL #define NSS_STATUS_UNAVAIL NSS_UNAVAIL
#define NSS_STATUS_TRYAGAIN NSS_TRYAGAIN #define NSS_STATUS_TRYAGAIN NSS_TRYAGAIN
/* The solaris winbind is implemented as a wrapper around the linux
version. */
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);
NSS_STATUS _nss_winbind_initgroups_dyn(char *user, gid_t group, long int *start,
long int *size, gid_t **groups,
long int limit, int *errnop);
#endif /* _WINBIND_NSS_SOLARIS_H */ #endif /* _WINBIND_NSS_SOLARIS_H */