nss-pam-ldapd commit: r1214 - in nss-pam-ldapd: compat nss
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
nss-pam-ldapd commit: r1214 - in nss-pam-ldapd: compat nss
- From: Commits of the nss-pam-ldapd project <nss-pam-ldapd-commits [at] lists.arthurdejong.org>
- To: nss-pam-ldapd-commits [at] lists.arthurdejong.org
- Reply-to: nss-pam-ldapd-users [at] lists.arthurdejong.org
- Subject: nss-pam-ldapd commit: r1214 - in nss-pam-ldapd: compat nss
- Date: Fri, 24 Sep 2010 15:04:08 +0200 (CEST)
Author: arthur
Date: Fri Sep 24 15:04:06 2010
New Revision: 1214
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?view=rev&revision=1214
Log:
switch to using nss_status_t throughout the code and provide compatibility code
to use whatever nss_status type is used on the system
Modified:
nss-pam-ldapd/compat/nss_compat.h
nss-pam-ldapd/nss/aliases.c
nss-pam-ldapd/nss/common.h
nss-pam-ldapd/nss/ethers.c
nss-pam-ldapd/nss/group.c
nss-pam-ldapd/nss/hosts.c
nss-pam-ldapd/nss/netgroup.c
nss-pam-ldapd/nss/networks.c
nss-pam-ldapd/nss/passwd.c
nss-pam-ldapd/nss/protocols.c
nss-pam-ldapd/nss/prototypes.h
nss-pam-ldapd/nss/rpc.c
nss-pam-ldapd/nss/services.c
nss-pam-ldapd/nss/shadow.c
Modified: nss-pam-ldapd/compat/nss_compat.h
==============================================================================
--- nss-pam-ldapd/compat/nss_compat.h Fri Sep 24 09:26:10 2010 (r1213)
+++ nss-pam-ldapd/compat/nss_compat.h Fri Sep 24 15:04:06 2010 (r1214)
@@ -45,6 +45,41 @@
#include "compat/ether.h"
+/* define missing status codes */
+#ifndef HAVE_ENUM_NSS_STATUS
+#ifndef NSS_STATUS_SUCCESS
+#define NSS_STATUS_SUCCESS NSS_SUCCESS
+#endif
+#ifndef NSS_STATUS_NOTFOUND
+#define NSS_STATUS_NOTFOUND NSS_NOTFOUND
+#endif
+#ifndef NSS_STATUS_UNAVAIL
+#define NSS_STATUS_UNAVAIL NSS_UNAVAIL
+#endif
+#ifndef NSS_STATUS_TRYAGAIN
+#define NSS_STATUS_TRYAGAIN NSS_TRYAGAIN
+#endif
+#ifndef NSS_STATUS_RETURN
+#define NSS_STATUS_RETURN NSS_NOTFOUND
+#endif
+#endif /* not HAVE_ENUM_NSS_STATUS */
+
+/* define nss_status_t */
+#ifdef HAVE_ENUM_NSS_STATUS
+typedef enum nss_status nss_status_t;
+#endif
+
+#ifndef HAVE_ENUM_NSS_STATUS
+enum nss_status
+{
+ NSS_STATUS_TRYAGAIN = NSS_TRYAGAIN,
+ NSS_STATUS_UNAVAIL = NSS_UNAVAIL,
+ NSS_STATUS_NOTFOUND = NSS_NOTFOUND,
+ NSS_STATUS_SUCCESS = NSS_SUCCESS,
+ NSS_STATUS_RETURN = NSS_NOTFOUND
+};
+#endif
+
/* Define an aliasent if it was not found on the system. */
#ifndef HAVE_STRUCT_ALIASENT
struct aliasent
Modified: nss-pam-ldapd/nss/aliases.c
==============================================================================
--- nss-pam-ldapd/nss/aliases.c Fri Sep 24 09:26:10 2010 (r1213)
+++ nss-pam-ldapd/nss/aliases.c Fri Sep 24 15:04:06 2010 (r1214)
@@ -28,7 +28,7 @@
#include "prototypes.h"
#include "common.h"
-static enum nss_status read_aliasent(
+static nss_status_t read_aliasent(
TFILE *fp,struct aliasent *result,
char *buffer,size_t buflen,int *errnop)
{
@@ -46,7 +46,7 @@
return NSS_STATUS_SUCCESS;
}
-enum nss_status _nss_ldap_getaliasbyname_r(
+nss_status_t _nss_ldap_getaliasbyname_r(
const char *name,struct aliasent *result,
char *buffer,size_t buflen,int *errnop)
{
@@ -58,18 +58,18 @@
/* thread-local file pointer to an ongoing request */
static __thread TFILE *aliasentfp;
-enum nss_status _nss_ldap_setaliasent(void)
+nss_status_t _nss_ldap_setaliasent(void)
{
NSS_SETENT(aliasentfp);
}
-enum nss_status _nss_ldap_getaliasent_r(struct aliasent *result,char
*buffer,size_t buflen,int *errnop)
+nss_status_t _nss_ldap_getaliasent_r(struct aliasent *result,char
*buffer,size_t buflen,int *errnop)
{
NSS_GETENT(aliasentfp,NSLCD_ACTION_ALIAS_ALL,
read_aliasent(aliasentfp,result,buffer,buflen,errnop));
}
-enum nss_status _nss_ldap_endaliasent(void)
+nss_status_t _nss_ldap_endaliasent(void)
{
NSS_ENDENT(aliasentfp);
}
Modified: nss-pam-ldapd/nss/common.h
==============================================================================
--- nss-pam-ldapd/nss/common.h Fri Sep 24 09:26:10 2010 (r1213)
+++ nss-pam-ldapd/nss/common.h Fri Sep 24 15:04:06 2010 (r1214)
@@ -82,7 +82,7 @@
#define NSS_BYGEN(action,writefn,readfn) \
TFILE *fp; \
int32_t tmpint32; \
- enum nss_status retv; \
+ nss_status_t retv; \
if (!_nss_ldap_enablelookups) \
return NSS_STATUS_UNAVAIL; \
/* check that we have a valid buffer */ \
@@ -133,7 +133,7 @@
a response header. A single entry is read with the readfn() function. */
#define NSS_GETENT(fp,action,readfn) \
int32_t tmpint32; \
- enum nss_status retv; \
+ nss_status_t retv; \
if (!_nss_ldap_enablelookups) \
return NSS_STATUS_UNAVAIL; \
/* check that we have a valid buffer */ \
Modified: nss-pam-ldapd/nss/ethers.c
==============================================================================
--- nss-pam-ldapd/nss/ethers.c Fri Sep 24 09:26:10 2010 (r1213)
+++ nss-pam-ldapd/nss/ethers.c Fri Sep 24 15:04:06 2010 (r1214)
@@ -29,7 +29,7 @@
#include "common.h"
#include "compat/attrs.h"
-static enum nss_status read_etherent(
+static nss_status_t read_etherent(
TFILE *fp,struct etherent *result,
char *buffer,size_t buflen,int *errnop)
{
@@ -41,7 +41,7 @@
}
/* map a hostname to the corresponding ethernet address */
-enum nss_status _nss_ldap_gethostton_r(
+nss_status_t _nss_ldap_gethostton_r(
const char *name,struct etherent *result,
char *buffer,size_t buflen,int *errnop)
{
@@ -51,7 +51,7 @@
}
/* map an ethernet address to the corresponding hostname */
-enum nss_status _nss_ldap_getntohost_r(
+nss_status_t _nss_ldap_getntohost_r(
const struct ether_addr *addr,struct etherent *result,
char *buffer,size_t buflen,int *errnop)
{
@@ -63,12 +63,12 @@
/* thread-local file pointer to an ongoing request */
static __thread TFILE *etherentfp;
-enum nss_status _nss_ldap_setetherent(int UNUSED(stayopen))
+nss_status_t _nss_ldap_setetherent(int UNUSED(stayopen))
{
NSS_SETENT(etherentfp);
}
-enum nss_status _nss_ldap_getetherent_r(
+nss_status_t _nss_ldap_getetherent_r(
struct etherent *result,
char *buffer,size_t buflen,int *errnop)
{
@@ -76,7 +76,7 @@
read_etherent(etherentfp,result,buffer,buflen,errnop));
}
-enum nss_status _nss_ldap_endetherent(void)
+nss_status_t _nss_ldap_endetherent(void)
{
NSS_ENDENT(etherentfp);
}
Modified: nss-pam-ldapd/nss/group.c
==============================================================================
--- nss-pam-ldapd/nss/group.c Fri Sep 24 09:26:10 2010 (r1213)
+++ nss-pam-ldapd/nss/group.c Fri Sep 24 15:04:06 2010 (r1214)
@@ -30,7 +30,7 @@
#include "common.h"
#include "compat/attrs.h"
-static enum nss_status read_group(
+static nss_status_t read_group(
TFILE *fp,struct group *result,
char *buffer,size_t buflen,int *errnop)
{
@@ -45,7 +45,7 @@
/* read all group entries from the stream and add
gids of these groups to the list */
-static enum nss_status read_gids(
+static nss_status_t read_gids(
TFILE *fp,gid_t skipgroup,long int *start,long int *size,
gid_t **groupsp,long int limit,int *errnop)
{
@@ -99,14 +99,14 @@
return NSS_STATUS_SUCCESS;
}
-enum nss_status _nss_ldap_getgrnam_r(const char *name,struct group
*result,char *buffer,size_t buflen,int *errnop)
+nss_status_t _nss_ldap_getgrnam_r(const char *name,struct group *result,char
*buffer,size_t buflen,int *errnop)
{
NSS_BYNAME(NSLCD_ACTION_GROUP_BYNAME,
name,
read_group(fp,result,buffer,buflen,errnop));
}
-enum nss_status _nss_ldap_getgrgid_r(gid_t gid,struct group *result,char
*buffer,size_t buflen,int *errnop)
+nss_status_t _nss_ldap_getgrgid_r(gid_t gid,struct group *result,char
*buffer,size_t buflen,int *errnop)
{
NSS_BYTYPE(NSLCD_ACTION_GROUP_BYGID,
gid,gid_t,
@@ -125,7 +125,7 @@
limit IN - the maxium size of the array
*errnop OUT - for returning errno
*/
-enum nss_status _nss_ldap_initgroups_dyn(
+nss_status_t _nss_ldap_initgroups_dyn(
const char *user,gid_t skipgroup,long int *start,
long int *size,gid_t **groupsp,long int limit,int *errnop)
{
@@ -144,18 +144,18 @@
/* thread-local file pointer to an ongoing request */
static __thread TFILE *grentfp;
-enum nss_status _nss_ldap_setgrent(int UNUSED(stayopen))
+nss_status_t _nss_ldap_setgrent(int UNUSED(stayopen))
{
NSS_SETENT(grentfp);
}
-enum nss_status _nss_ldap_getgrent_r(struct group *result,char *buffer,size_t
buflen,int *errnop)
+nss_status_t _nss_ldap_getgrent_r(struct group *result,char *buffer,size_t
buflen,int *errnop)
{
NSS_GETENT(grentfp,NSLCD_ACTION_GROUP_ALL,
read_group(grentfp,result,buffer,buflen,errnop));
}
-enum nss_status _nss_ldap_endgrent(void)
+nss_status_t _nss_ldap_endgrent(void)
{
NSS_ENDENT(grentfp);
}
Modified: nss-pam-ldapd/nss/hosts.c
==============================================================================
--- nss-pam-ldapd/nss/hosts.c Fri Sep 24 09:26:10 2010 (r1213)
+++ nss-pam-ldapd/nss/hosts.c Fri Sep 24 15:04:06 2010 (r1214)
@@ -61,7 +61,7 @@
specified address family, result is stored in result
it will an empty entry if no addresses in the address family
were available */
-static enum nss_status read_hostent(
+static nss_status_t read_hostent(
TFILE *fp,int af,struct hostent *result,
char *buffer,size_t buflen,int *errnop,int *h_errnop)
{
@@ -108,11 +108,11 @@
/* this is a wrapper around read_hostent() that does error handling
if the read address list does not contain any addresses for the
specified address familiy */
-static enum nss_status read_hostent_erronempty(
+static nss_status_t read_hostent_erronempty(
TFILE *fp,int af,struct hostent *result,
char *buffer,size_t buflen,int *errnop,int *h_errnop)
{
- enum nss_status retv;
+ nss_status_t retv;
retv=read_hostent(fp,af,result,buffer,buflen,errnop,h_errnop);
/* check result */
if (retv!=NSS_STATUS_SUCCESS)
@@ -135,12 +135,12 @@
/* this is a wrapper around read_hostent() that skips to the
next address if the address list does not contain any addresses for the
specified address familiy */
-static enum nss_status read_hostent_nextonempty(
+static nss_status_t read_hostent_nextonempty(
TFILE *fp,int af,struct hostent *result,
char *buffer,size_t buflen,int *errnop,int *h_errnop)
{
int32_t tmpint32;
- enum nss_status retv;
+ nss_status_t retv;
/* check until we read an non-empty entry */
do
{
@@ -168,7 +168,7 @@
result - OUT - entry found
buffer,buflen - OUT - buffer to store allocated stuff on
errnop,h_errnop - OUT - for reporting errors */
-enum nss_status _nss_ldap_gethostbyname2_r(
+nss_status_t _nss_ldap_gethostbyname2_r(
const char *name,int af,struct hostent *result,
char *buffer,size_t buflen,int *errnop,int *h_errnop)
{
@@ -179,7 +179,7 @@
/* this function just calls the gethostbyname2() variant with the address
familiy set */
-enum nss_status _nss_ldap_gethostbyname_r(
+nss_status_t _nss_ldap_gethostbyname_r(
const char *name,struct hostent *result,
char *buffer,size_t buflen,int *errnop,int *h_errnop)
{
@@ -200,7 +200,7 @@
result - OUT - entry found
buffer,buflen - OUT - buffer to store allocated stuff on
errnop,h_errnop - OUT - for reporting errors */
-enum nss_status _nss_ldap_gethostbyaddr_r(
+nss_status_t _nss_ldap_gethostbyaddr_r(
const void *addr,socklen_t len,int af,struct hostent *result,
char *buffer,size_t buflen,int *errnop,int *h_errnop)
{
@@ -212,13 +212,13 @@
/* thread-local file pointer to an ongoing request */
static __thread TFILE *hostentfp;
-enum nss_status _nss_ldap_sethostent(int UNUSED(stayopen))
+nss_status_t _nss_ldap_sethostent(int UNUSED(stayopen))
{
NSS_SETENT(hostentfp);
}
/* this function only returns addresses of the AF_INET address family */
-enum nss_status _nss_ldap_gethostent_r(
+nss_status_t _nss_ldap_gethostent_r(
struct hostent *result,
char *buffer,size_t buflen,int *errnop,int *h_errnop)
{
@@ -226,7 +226,7 @@
read_hostent_nextonempty(hostentfp,AF_INET,result,buffer,buflen,errnop,h_errnop));
}
-enum nss_status _nss_ldap_endhostent(void)
+nss_status_t _nss_ldap_endhostent(void)
{
NSS_ENDENT(hostentfp);
}
Modified: nss-pam-ldapd/nss/netgroup.c
==============================================================================
--- nss-pam-ldapd/nss/netgroup.c Fri Sep 24 09:26:10 2010 (r1213)
+++ nss-pam-ldapd/nss/netgroup.c Fri Sep 24 15:04:06 2010 (r1214)
@@ -39,7 +39,7 @@
return NSS_STATUS_RETURN;
/* function for reading a single result entry */
-static enum nss_status read_netgrent(
+static nss_status_t read_netgrent(
TFILE *fp,struct __netgrent *result,
char *buffer,size_t buflen,int *errnop)
{
@@ -89,7 +89,7 @@
/* thread-local file pointer to an ongoing request */
static __thread TFILE *netgrentfp;
-enum nss_status _nss_ldap_setnetgrent(const char *group,struct __netgrent
UNUSED(*result))
+nss_status_t _nss_ldap_setnetgrent(const char *group,struct __netgrent
UNUSED(*result))
{
/* we cannot use NSS_SETENT() here because we have a parameter that is only
available in this function */
@@ -107,13 +107,13 @@
return NSS_STATUS_SUCCESS;
}
-enum nss_status _nss_ldap_getnetgrent_r(struct __netgrent *result,char
*buffer,size_t buflen,int *errnop)
+nss_status_t _nss_ldap_getnetgrent_r(struct __netgrent *result,char
*buffer,size_t buflen,int *errnop)
{
NSS_GETENT(netgrentfp,NSLCD_ACTION_NETGROUP_BYNAME,
read_netgrent(netgrentfp,result,buffer,buflen,errnop));
}
-enum nss_status _nss_ldap_endnetgrent(struct __netgrent UNUSED(* result))
+nss_status_t _nss_ldap_endnetgrent(struct __netgrent UNUSED(* result))
{
NSS_ENDENT(netgrentfp);
}
Modified: nss-pam-ldapd/nss/networks.c
==============================================================================
--- nss-pam-ldapd/nss/networks.c Fri Sep 24 09:26:10 2010 (r1213)
+++ nss-pam-ldapd/nss/networks.c Fri Sep 24 15:04:06 2010 (r1214)
@@ -59,7 +59,7 @@
/* read a single network entry from the stream, ignoring entries
that are not AF_INET (IPv4), result is stored in result */
-static enum nss_status read_netent(
+static nss_status_t read_netent(
TFILE *fp,struct netent *result,
char *buffer,size_t buflen,int *errnop,int *h_errnop)
{
@@ -67,7 +67,7 @@
int32_t numaddr,i;
int readaf;
size_t bufptr=0;
- enum nss_status retv=NSS_STATUS_NOTFOUND;
+ nss_status_t retv=NSS_STATUS_NOTFOUND;
/* read the network entry */
READ_BUF_STRING(fp,result->n_name);
READ_BUF_STRINGLIST(fp,result->n_aliases);
@@ -99,7 +99,7 @@
return retv;
}
-enum nss_status _nss_ldap_getnetbyname_r(const char *name,struct netent
*result,char *buffer,size_t buflen,int *errnop,int *h_errnop)
+nss_status_t _nss_ldap_getnetbyname_r(const char *name,struct netent
*result,char *buffer,size_t buflen,int *errnop,int *h_errnop)
{
NSS_BYNAME(NSLCD_ACTION_NETWORK_BYNAME,
name,
@@ -116,7 +116,7 @@
/* Note: the af parameter is ignored and is assumed to be AF_INET */
/* TODO: implement handling of af parameter */
-enum nss_status _nss_ldap_getnetbyaddr_r(uint32_t addr,int UNUSED(af),struct
netent *result,char *buffer,size_t buflen,int *errnop,int *h_errnop)
+nss_status_t _nss_ldap_getnetbyaddr_r(uint32_t addr,int UNUSED(af),struct
netent *result,char *buffer,size_t buflen,int *errnop,int *h_errnop)
{
NSS_BYGEN(NSLCD_ACTION_NETWORK_BYADDR,
WRITE_ADDRESS(fp,addr),
@@ -126,18 +126,18 @@
/* thread-local file pointer to an ongoing request */
static __thread TFILE *netentfp;
-enum nss_status _nss_ldap_setnetent(int UNUSED(stayopen))
+nss_status_t _nss_ldap_setnetent(int UNUSED(stayopen))
{
NSS_SETENT(netentfp);
}
-enum nss_status _nss_ldap_getnetent_r(struct netent *result,char
*buffer,size_t buflen,int *errnop,int *h_errnop)
+nss_status_t _nss_ldap_getnetent_r(struct netent *result,char *buffer,size_t
buflen,int *errnop,int *h_errnop)
{
NSS_GETENT(netentfp,NSLCD_ACTION_NETWORK_ALL,
read_netent(netentfp,result,buffer,buflen,errnop,h_errnop));
}
-enum nss_status _nss_ldap_endnetent(void)
+nss_status_t _nss_ldap_endnetent(void)
{
NSS_ENDENT(netentfp);
}
Modified: nss-pam-ldapd/nss/passwd.c
==============================================================================
--- nss-pam-ldapd/nss/passwd.c Fri Sep 24 09:26:10 2010 (r1213)
+++ nss-pam-ldapd/nss/passwd.c Fri Sep 24 15:04:06 2010 (r1214)
@@ -29,7 +29,7 @@
#include "common.h"
#include "compat/attrs.h"
-static enum nss_status read_passwd(
+static nss_status_t read_passwd(
TFILE *fp,struct passwd *result,
char *buffer,size_t buflen,int *errnop)
{
@@ -45,14 +45,14 @@
return NSS_STATUS_SUCCESS;
}
-enum nss_status _nss_ldap_getpwnam_r(const char *name,struct passwd
*result,char *buffer,size_t buflen,int *errnop)
+nss_status_t _nss_ldap_getpwnam_r(const char *name,struct passwd *result,char
*buffer,size_t buflen,int *errnop)
{
NSS_BYNAME(NSLCD_ACTION_PASSWD_BYNAME,
name,
read_passwd(fp,result,buffer,buflen,errnop));
}
-enum nss_status _nss_ldap_getpwuid_r(uid_t uid,struct passwd *result,char
*buffer,size_t buflen,int *errnop)
+nss_status_t _nss_ldap_getpwuid_r(uid_t uid,struct passwd *result,char
*buffer,size_t buflen,int *errnop)
{
NSS_BYTYPE(NSLCD_ACTION_PASSWD_BYUID,
uid,uid_t,
@@ -63,20 +63,20 @@
static __thread TFILE *pwentfp;
/* open a connection to the nslcd and write the request */
-enum nss_status _nss_ldap_setpwent(int UNUSED(stayopen))
+nss_status_t _nss_ldap_setpwent(int UNUSED(stayopen))
{
NSS_SETENT(pwentfp);
}
/* read password data from an opened stream */
-enum nss_status _nss_ldap_getpwent_r(struct passwd *result,char *buffer,size_t
buflen,int *errnop)
+nss_status_t _nss_ldap_getpwent_r(struct passwd *result,char *buffer,size_t
buflen,int *errnop)
{
NSS_GETENT(pwentfp,NSLCD_ACTION_PASSWD_ALL,
read_passwd(pwentfp,result,buffer,buflen,errnop));
}
/* close the stream opened with setpwent() above */
-enum nss_status _nss_ldap_endpwent(void)
+nss_status_t _nss_ldap_endpwent(void)
{
NSS_ENDENT(pwentfp);
}
Modified: nss-pam-ldapd/nss/protocols.c
==============================================================================
--- nss-pam-ldapd/nss/protocols.c Fri Sep 24 09:26:10 2010 (r1213)
+++ nss-pam-ldapd/nss/protocols.c Fri Sep 24 15:04:06 2010 (r1214)
@@ -29,7 +29,7 @@
#include "common.h"
#include "compat/attrs.h"
-static enum nss_status read_protoent(
+static nss_status_t read_protoent(
TFILE *fp,struct protoent *result,
char *buffer,size_t buflen,int *errnop)
{
@@ -41,14 +41,14 @@
return NSS_STATUS_SUCCESS;
}
-enum nss_status _nss_ldap_getprotobyname_r(const char *name,struct protoent
*result,char *buffer,size_t buflen,int *errnop)
+nss_status_t _nss_ldap_getprotobyname_r(const char *name,struct protoent
*result,char *buffer,size_t buflen,int *errnop)
{
NSS_BYNAME(NSLCD_ACTION_PROTOCOL_BYNAME,
name,
read_protoent(fp,result,buffer,buflen,errnop));
}
-enum nss_status _nss_ldap_getprotobynumber_r(int number,struct protoent
*result,char *buffer,size_t buflen,int *errnop)
+nss_status_t _nss_ldap_getprotobynumber_r(int number,struct protoent
*result,char *buffer,size_t buflen,int *errnop)
{
NSS_BYINT32(NSLCD_ACTION_PROTOCOL_BYNUMBER,
number,
@@ -58,18 +58,18 @@
/* thread-local file pointer to an ongoing request */
static __thread TFILE *protoentfp;
-enum nss_status _nss_ldap_setprotoent(int UNUSED(stayopen))
+nss_status_t _nss_ldap_setprotoent(int UNUSED(stayopen))
{
NSS_SETENT(protoentfp);
}
-enum nss_status _nss_ldap_getprotoent_r(struct protoent *result,char
*buffer,size_t buflen,int *errnop)
+nss_status_t _nss_ldap_getprotoent_r(struct protoent *result,char
*buffer,size_t buflen,int *errnop)
{
NSS_GETENT(protoentfp,NSLCD_ACTION_PROTOCOL_ALL,
read_protoent(protoentfp,result,buffer,buflen,errnop));
}
-enum nss_status _nss_ldap_endprotoent(void)
+nss_status_t _nss_ldap_endprotoent(void)
{
NSS_ENDENT(protoentfp);
}
Modified: nss-pam-ldapd/nss/prototypes.h
==============================================================================
--- nss-pam-ldapd/nss/prototypes.h Fri Sep 24 09:26:10 2010 (r1213)
+++ nss-pam-ldapd/nss/prototypes.h Fri Sep 24 15:04:06 2010 (r1214)
@@ -43,78 +43,78 @@
extern int _nss_ldap_enablelookups;
/* aliases - mail aliases */
-enum nss_status _nss_ldap_getaliasbyname_r(const char *name,struct aliasent
*result,char *buffer,size_t buflen,int *errnop);
-enum nss_status _nss_ldap_setaliasent(void);
-enum nss_status _nss_ldap_getaliasent_r(struct aliasent *result,char
*buffer,size_t buflen,int *errnop);
-enum nss_status _nss_ldap_endaliasent(void);
+nss_status_t _nss_ldap_getaliasbyname_r(const char *name,struct aliasent
*result,char *buffer,size_t buflen,int *errnop);
+nss_status_t _nss_ldap_setaliasent(void);
+nss_status_t _nss_ldap_getaliasent_r(struct aliasent *result,char
*buffer,size_t buflen,int *errnop);
+nss_status_t _nss_ldap_endaliasent(void);
/* ethers - ethernet numbers */
-enum nss_status _nss_ldap_gethostton_r(const char *name,struct etherent
*result,char *buffer,size_t buflen,int *errnop);
-enum nss_status _nss_ldap_getntohost_r(const struct ether_addr *addr,struct
etherent *result,char *buffer,size_t buflen,int *errnop);
-enum nss_status _nss_ldap_setetherent(int stayopen);
-enum nss_status _nss_ldap_getetherent_r(struct etherent *result,char
*buffer,size_t buflen,int *errnop);
-enum nss_status _nss_ldap_endetherent(void);
+nss_status_t _nss_ldap_gethostton_r(const char *name,struct etherent
*result,char *buffer,size_t buflen,int *errnop);
+nss_status_t _nss_ldap_getntohost_r(const struct ether_addr *addr,struct
etherent *result,char *buffer,size_t buflen,int *errnop);
+nss_status_t _nss_ldap_setetherent(int stayopen);
+nss_status_t _nss_ldap_getetherent_r(struct etherent *result,char
*buffer,size_t buflen,int *errnop);
+nss_status_t _nss_ldap_endetherent(void);
/* group - groups of users */
-enum nss_status _nss_ldap_getgrnam_r(const char *name,struct group
*result,char *buffer,size_t buflen,int *errnop);
-enum nss_status _nss_ldap_getgrgid_r(gid_t gid,struct group *result,char
*buffer,size_t buflen,int *errnop);
-enum nss_status _nss_ldap_initgroups_dyn(const char *user,gid_t group,long int
*start,long int *size,gid_t **groupsp,long int limit,int *errnop);
-enum nss_status _nss_ldap_setgrent(int stayopen);
-enum nss_status _nss_ldap_getgrent_r(struct group *result,char *buffer,size_t
buflen,int *errnop);
-enum nss_status _nss_ldap_endgrent(void);
+nss_status_t _nss_ldap_getgrnam_r(const char *name,struct group *result,char
*buffer,size_t buflen,int *errnop);
+nss_status_t _nss_ldap_getgrgid_r(gid_t gid,struct group *result,char
*buffer,size_t buflen,int *errnop);
+nss_status_t _nss_ldap_initgroups_dyn(const char *user,gid_t group,long int
*start,long int *size,gid_t **groupsp,long int limit,int *errnop);
+nss_status_t _nss_ldap_setgrent(int stayopen);
+nss_status_t _nss_ldap_getgrent_r(struct group *result,char *buffer,size_t
buflen,int *errnop);
+nss_status_t _nss_ldap_endgrent(void);
/* hosts - host names and numbers */
-enum nss_status _nss_ldap_gethostbyname_r(const char *name,struct hostent
*result,char *buffer,size_t buflen,int *errnop,int *h_errnop);
-enum nss_status _nss_ldap_gethostbyname2_r(const char *name,int af,struct
hostent *result,char *buffer,size_t buflen,int *errnop,int *h_errnop);
-enum nss_status _nss_ldap_gethostbyaddr_r(const void *addr,socklen_t len,int
af,struct hostent *result,char *buffer,size_t buflen,int *errnop,int *h_errnop);
-enum nss_status _nss_ldap_sethostent(int stayopen);
-enum nss_status _nss_ldap_gethostent_r(struct hostent *result,char
*buffer,size_t buflen,int *errnop,int *h_errnop);
-enum nss_status _nss_ldap_endhostent(void);
+nss_status_t _nss_ldap_gethostbyname_r(const char *name,struct hostent
*result,char *buffer,size_t buflen,int *errnop,int *h_errnop);
+nss_status_t _nss_ldap_gethostbyname2_r(const char *name,int af,struct hostent
*result,char *buffer,size_t buflen,int *errnop,int *h_errnop);
+nss_status_t _nss_ldap_gethostbyaddr_r(const void *addr,socklen_t len,int
af,struct hostent *result,char *buffer,size_t buflen,int *errnop,int *h_errnop);
+nss_status_t _nss_ldap_sethostent(int stayopen);
+nss_status_t _nss_ldap_gethostent_r(struct hostent *result,char *buffer,size_t
buflen,int *errnop,int *h_errnop);
+nss_status_t _nss_ldap_endhostent(void);
/* netgroup - list of host and users */
-enum nss_status _nss_ldap_setnetgrent(const char *group,struct __netgrent
*result);
-enum nss_status _nss_ldap_getnetgrent_r(struct __netgrent *result,char
*buffer,size_t buflen,int *errnop);
-enum nss_status _nss_ldap_endnetgrent(struct __netgrent *result);
+nss_status_t _nss_ldap_setnetgrent(const char *group,struct __netgrent
*result);
+nss_status_t _nss_ldap_getnetgrent_r(struct __netgrent *result,char
*buffer,size_t buflen,int *errnop);
+nss_status_t _nss_ldap_endnetgrent(struct __netgrent *result);
/* networks - network names and numbers */
-enum nss_status _nss_ldap_getnetbyname_r(const char *name,struct netent
*result,char *buffer,size_t buflen,int *errnop,int *h_errnop);
-enum nss_status _nss_ldap_getnetbyaddr_r(uint32_t addr,int af,struct netent
*result,char *buffer,size_t buflen,int *errnop,int *h_errnop);
-enum nss_status _nss_ldap_setnetent(int stayopen);
-enum nss_status _nss_ldap_getnetent_r(struct netent *result,char
*buffer,size_t buflen,int *errnop,int *h_errnop);
-enum nss_status _nss_ldap_endnetent(void);
+nss_status_t _nss_ldap_getnetbyname_r(const char *name,struct netent
*result,char *buffer,size_t buflen,int *errnop,int *h_errnop);
+nss_status_t _nss_ldap_getnetbyaddr_r(uint32_t addr,int af,struct netent
*result,char *buffer,size_t buflen,int *errnop,int *h_errnop);
+nss_status_t _nss_ldap_setnetent(int stayopen);
+nss_status_t _nss_ldap_getnetent_r(struct netent *result,char *buffer,size_t
buflen,int *errnop,int *h_errnop);
+nss_status_t _nss_ldap_endnetent(void);
/* passwd - user database and passwords */
-enum nss_status _nss_ldap_getpwnam_r(const char *name,struct passwd
*result,char *buffer,size_t buflen,int *errnop);
-enum nss_status _nss_ldap_getpwuid_r(uid_t uid,struct passwd *result,char
*buffer,size_t buflen,int *errnop);
-enum nss_status _nss_ldap_setpwent(int stayopen);
-enum nss_status _nss_ldap_getpwent_r(struct passwd *result,char *buffer,size_t
buflen,int *errnop);
-enum nss_status _nss_ldap_endpwent(void);
+nss_status_t _nss_ldap_getpwnam_r(const char *name,struct passwd *result,char
*buffer,size_t buflen,int *errnop);
+nss_status_t _nss_ldap_getpwuid_r(uid_t uid,struct passwd *result,char
*buffer,size_t buflen,int *errnop);
+nss_status_t _nss_ldap_setpwent(int stayopen);
+nss_status_t _nss_ldap_getpwent_r(struct passwd *result,char *buffer,size_t
buflen,int *errnop);
+nss_status_t _nss_ldap_endpwent(void);
/* protocols - network protocols */
-enum nss_status _nss_ldap_getprotobyname_r(const char *name,struct protoent
*result,char *buffer,size_t buflen,int *errnop);
-enum nss_status _nss_ldap_getprotobynumber_r(int number,struct protoent
*result,char *buffer,size_t buflen,int *errnop);
-enum nss_status _nss_ldap_setprotoent(int stayopen);
-enum nss_status _nss_ldap_getprotoent_r(struct protoent *result,char
*buffer,size_t buflen,int *errnop);
-enum nss_status _nss_ldap_endprotoent(void);
+nss_status_t _nss_ldap_getprotobyname_r(const char *name,struct protoent
*result,char *buffer,size_t buflen,int *errnop);
+nss_status_t _nss_ldap_getprotobynumber_r(int number,struct protoent
*result,char *buffer,size_t buflen,int *errnop);
+nss_status_t _nss_ldap_setprotoent(int stayopen);
+nss_status_t _nss_ldap_getprotoent_r(struct protoent *result,char
*buffer,size_t buflen,int *errnop);
+nss_status_t _nss_ldap_endprotoent(void);
/* rpc - remote procedure call names and numbers */
-enum nss_status _nss_ldap_getrpcbyname_r(const char *name,struct rpcent
*result,char *buffer,size_t buflen,int *errnop);
-enum nss_status _nss_ldap_getrpcbynumber_r(int number,struct rpcent
*result,char *buffer,size_t buflen,int *errnop);
-enum nss_status _nss_ldap_setrpcent(int stayopen);
-enum nss_status _nss_ldap_getrpcent_r(struct rpcent *result,char
*buffer,size_t buflen,int *errnop);
-enum nss_status _nss_ldap_endrpcent(void);
+nss_status_t _nss_ldap_getrpcbyname_r(const char *name,struct rpcent
*result,char *buffer,size_t buflen,int *errnop);
+nss_status_t _nss_ldap_getrpcbynumber_r(int number,struct rpcent *result,char
*buffer,size_t buflen,int *errnop);
+nss_status_t _nss_ldap_setrpcent(int stayopen);
+nss_status_t _nss_ldap_getrpcent_r(struct rpcent *result,char *buffer,size_t
buflen,int *errnop);
+nss_status_t _nss_ldap_endrpcent(void);
/* services - network services */
-enum nss_status _nss_ldap_getservbyname_r(const char *name,const char
*protocol,struct servent *result,char *buffer,size_t buflen,int *errnop);
-enum nss_status _nss_ldap_getservbyport_r(int port,const char *protocol,struct
servent *result,char *buffer,size_t buflen,int *errnop);
-enum nss_status _nss_ldap_setservent(int stayopen);
-enum nss_status _nss_ldap_getservent_r(struct servent *result,char
*buffer,size_t buflen,int *errnop);
-enum nss_status _nss_ldap_endservent(void);
+nss_status_t _nss_ldap_getservbyname_r(const char *name,const char
*protocol,struct servent *result,char *buffer,size_t buflen,int *errnop);
+nss_status_t _nss_ldap_getservbyport_r(int port,const char *protocol,struct
servent *result,char *buffer,size_t buflen,int *errnop);
+nss_status_t _nss_ldap_setservent(int stayopen);
+nss_status_t _nss_ldap_getservent_r(struct servent *result,char *buffer,size_t
buflen,int *errnop);
+nss_status_t _nss_ldap_endservent(void);
/* shadow - extended user information */
-enum nss_status _nss_ldap_getspnam_r(const char *name,struct spwd *result,char
*buffer,size_t buflen,int *errnop);
-enum nss_status _nss_ldap_setspent(int stayopen);
-enum nss_status _nss_ldap_getspent_r(struct spwd *result,char *buffer,size_t
buflen,int *errnop);
-enum nss_status _nss_ldap_endspent(void);
+nss_status_t _nss_ldap_getspnam_r(const char *name,struct spwd *result,char
*buffer,size_t buflen,int *errnop);
+nss_status_t _nss_ldap_setspent(int stayopen);
+nss_status_t _nss_ldap_getspent_r(struct spwd *result,char *buffer,size_t
buflen,int *errnop);
+nss_status_t _nss_ldap_endspent(void);
#endif /* not NSS__PROTOTYPES_H */
Modified: nss-pam-ldapd/nss/rpc.c
==============================================================================
--- nss-pam-ldapd/nss/rpc.c Fri Sep 24 09:26:10 2010 (r1213)
+++ nss-pam-ldapd/nss/rpc.c Fri Sep 24 15:04:06 2010 (r1214)
@@ -29,7 +29,7 @@
#include "common.h"
#include "compat/attrs.h"
-static enum nss_status read_rpcent(
+static nss_status_t read_rpcent(
TFILE *fp,struct rpcent *result,
char *buffer,size_t buflen,int *errnop)
{
@@ -41,14 +41,14 @@
return NSS_STATUS_SUCCESS;
}
-enum nss_status _nss_ldap_getrpcbyname_r(const char *name,struct rpcent
*result,char *buffer,size_t buflen,int *errnop)
+nss_status_t _nss_ldap_getrpcbyname_r(const char *name,struct rpcent
*result,char *buffer,size_t buflen,int *errnop)
{
NSS_BYNAME(NSLCD_ACTION_RPC_BYNAME,
name,
read_rpcent(fp,result,buffer,buflen,errnop));
}
-enum nss_status _nss_ldap_getrpcbynumber_r(int number,struct rpcent
*result,char *buffer,size_t buflen,int *errnop)
+nss_status_t _nss_ldap_getrpcbynumber_r(int number,struct rpcent *result,char
*buffer,size_t buflen,int *errnop)
{
NSS_BYINT32(NSLCD_ACTION_RPC_BYNUMBER,
number,
@@ -58,18 +58,18 @@
/* thread-local file pointer to an ongoing request */
static __thread TFILE *protoentfp;
-enum nss_status _nss_ldap_setrpcent(int UNUSED(stayopen))
+nss_status_t _nss_ldap_setrpcent(int UNUSED(stayopen))
{
NSS_SETENT(protoentfp);
}
-enum nss_status _nss_ldap_getrpcent_r(struct rpcent *result,char
*buffer,size_t buflen,int *errnop)
+nss_status_t _nss_ldap_getrpcent_r(struct rpcent *result,char *buffer,size_t
buflen,int *errnop)
{
NSS_GETENT(protoentfp,NSLCD_ACTION_RPC_ALL,
read_rpcent(protoentfp,result,buffer,buflen,errnop));
}
-enum nss_status _nss_ldap_endrpcent(void)
+nss_status_t _nss_ldap_endrpcent(void)
{
NSS_ENDENT(protoentfp);
}
Modified: nss-pam-ldapd/nss/services.c
==============================================================================
--- nss-pam-ldapd/nss/services.c Fri Sep 24 09:26:10 2010 (r1213)
+++ nss-pam-ldapd/nss/services.c Fri Sep 24 15:04:06 2010 (r1214)
@@ -29,7 +29,7 @@
#include "common.h"
#include "compat/attrs.h"
-static enum nss_status read_servent(
+static nss_status_t read_servent(
TFILE *fp,struct servent *result,
char *buffer,size_t buflen,int *errnop)
{
@@ -45,7 +45,7 @@
return NSS_STATUS_SUCCESS;
}
-enum nss_status _nss_ldap_getservbyname_r(const char *name,const char
*protocol,struct servent *result,char *buffer,size_t buflen,int *errnop)
+nss_status_t _nss_ldap_getservbyname_r(const char *name,const char
*protocol,struct servent *result,char *buffer,size_t buflen,int *errnop)
{
NSS_BYGEN(NSLCD_ACTION_SERVICE_BYNAME,
WRITE_STRING(fp,name);WRITE_STRING(fp,protocol),
@@ -53,7 +53,7 @@
}
-enum nss_status _nss_ldap_getservbyport_r(int port,const char *protocol,struct
servent *result,char *buffer,size_t buflen,int *errnop)
+nss_status_t _nss_ldap_getservbyport_r(int port,const char *protocol,struct
servent *result,char *buffer,size_t buflen,int *errnop)
{
NSS_BYGEN(NSLCD_ACTION_SERVICE_BYNUMBER,
WRITE_INT32(fp,ntohs(port));WRITE_STRING(fp,protocol),
@@ -63,18 +63,18 @@
/* thread-local file pointer to an ongoing request */
static __thread TFILE *protoentfp;
-enum nss_status _nss_ldap_setservent(int UNUSED(stayopen))
+nss_status_t _nss_ldap_setservent(int UNUSED(stayopen))
{
NSS_SETENT(protoentfp);
}
-enum nss_status _nss_ldap_getservent_r(struct servent *result,char
*buffer,size_t buflen,int *errnop)
+nss_status_t _nss_ldap_getservent_r(struct servent *result,char *buffer,size_t
buflen,int *errnop)
{
NSS_GETENT(protoentfp,NSLCD_ACTION_SERVICE_ALL,
read_servent(protoentfp,result,buffer,buflen,errnop));
}
-enum nss_status _nss_ldap_endservent(void)
+nss_status_t _nss_ldap_endservent(void)
{
NSS_ENDENT(protoentfp);
}
Modified: nss-pam-ldapd/nss/shadow.c
==============================================================================
--- nss-pam-ldapd/nss/shadow.c Fri Sep 24 09:26:10 2010 (r1213)
+++ nss-pam-ldapd/nss/shadow.c Fri Sep 24 15:04:06 2010 (r1214)
@@ -29,7 +29,7 @@
#include "common.h"
#include "compat/attrs.h"
-static enum nss_status read_spwd(
+static nss_status_t read_spwd(
TFILE *fp,struct spwd *result,
char *buffer,size_t buflen,int *errnop)
{
@@ -47,7 +47,7 @@
return NSS_STATUS_SUCCESS;
}
-enum nss_status _nss_ldap_getspnam_r(const char *name,struct spwd *result,char
*buffer,size_t buflen,int *errnop)
+nss_status_t _nss_ldap_getspnam_r(const char *name,struct spwd *result,char
*buffer,size_t buflen,int *errnop)
{
NSS_BYNAME(NSLCD_ACTION_SHADOW_BYNAME,
name,
@@ -57,18 +57,18 @@
/* thread-local file pointer to an ongoing request */
static __thread TFILE *spentfp;
-enum nss_status _nss_ldap_setspent(int UNUSED(stayopen))
+nss_status_t _nss_ldap_setspent(int UNUSED(stayopen))
{
NSS_SETENT(spentfp);
}
-enum nss_status _nss_ldap_getspent_r(struct spwd *result,char *buffer,size_t
buflen,int *errnop)
+nss_status_t _nss_ldap_getspent_r(struct spwd *result,char *buffer,size_t
buflen,int *errnop)
{
NSS_GETENT(spentfp,NSLCD_ACTION_SHADOW_ALL,
read_spwd(spentfp,result,buffer,buflen,errnop));
}
-enum nss_status _nss_ldap_endspent(void)
+nss_status_t _nss_ldap_endspent(void)
{
NSS_ENDENT(spentfp);
}
--
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits
- nss-pam-ldapd commit: r1214 - in nss-pam-ldapd: compat nss,
Commits of the nss-pam-ldapd project