summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2010-09-24 13:04:06 +0000
committerArthur de Jong <arthur@arthurdejong.org>2010-09-24 13:04:06 +0000
commite21d0b3e3a87c9a361ecde9560c3fd07226e97d1 (patch)
tree0bbb3533783e17276abd69128d685169a0bd963f
parent2bdae403811d7d995cd921b4232c9f9256068ab5 (diff)
switch to using nss_status_t throughout the code and provide compatibility code to use whatever nss_status type is used on the system
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1214 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r--compat/nss_compat.h35
-rw-r--r--nss/aliases.c10
-rw-r--r--nss/common.h4
-rw-r--r--nss/ethers.c12
-rw-r--r--nss/group.c16
-rw-r--r--nss/hosts.c22
-rw-r--r--nss/netgroup.c8
-rw-r--r--nss/networks.c14
-rw-r--r--nss/passwd.c12
-rw-r--r--nss/protocols.c12
-rw-r--r--nss/prototypes.h106
-rw-r--r--nss/rpc.c12
-rw-r--r--nss/services.c12
-rw-r--r--nss/shadow.c10
14 files changed, 160 insertions, 125 deletions
diff --git a/compat/nss_compat.h b/compat/nss_compat.h
index 238f77c..2f79196 100644
--- a/compat/nss_compat.h
+++ b/compat/nss_compat.h
@@ -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
diff --git a/nss/aliases.c b/nss/aliases.c
index 064fee2..042132a 100644
--- a/nss/aliases.c
+++ b/nss/aliases.c
@@ -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 @@ static enum nss_status read_aliasent(
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 @@ enum nss_status _nss_ldap_getaliasbyname_r(
/* 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);
}
diff --git a/nss/common.h b/nss/common.h
index deb532f..e7182de 100644
--- a/nss/common.h
+++ b/nss/common.h
@@ -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 */ \
diff --git a/nss/ethers.c b/nss/ethers.c
index 303c745..f23af43 100644
--- a/nss/ethers.c
+++ b/nss/ethers.c
@@ -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 @@ static enum nss_status read_etherent(
}
/* 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 @@ enum nss_status _nss_ldap_gethostton_r(
}
/* 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 @@ enum nss_status _nss_ldap_getntohost_r(
/* 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 @@ enum nss_status _nss_ldap_getetherent_r(
read_etherent(etherentfp,result,buffer,buflen,errnop));
}
-enum nss_status _nss_ldap_endetherent(void)
+nss_status_t _nss_ldap_endetherent(void)
{
NSS_ENDENT(etherentfp);
}
diff --git a/nss/group.c b/nss/group.c
index 5e716a8..45cfeaa 100644
--- a/nss/group.c
+++ b/nss/group.c
@@ -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 @@ static enum nss_status read_group(
/* 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 @@ static enum nss_status read_gids(
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 @@ enum nss_status _nss_ldap_getgrgid_r(gid_t gid,struct group *result,char *buffer
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 @@ enum nss_status _nss_ldap_initgroups_dyn(
/* 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);
}
diff --git a/nss/hosts.c b/nss/hosts.c
index b73324b..6d5c406 100644
--- a/nss/hosts.c
+++ b/nss/hosts.c
@@ -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 @@ static enum nss_status read_hostent(
/* 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 @@ static enum nss_status read_hostent_erronempty(
/* 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 @@ static enum nss_status read_hostent_nextonempty(
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 @@ enum nss_status _nss_ldap_gethostbyname2_r(
/* 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 @@ enum nss_status _nss_ldap_gethostbyname_r(
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 @@ enum nss_status _nss_ldap_gethostbyaddr_r(
/* 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 @@ enum nss_status _nss_ldap_gethostent_r(
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);
}
diff --git a/nss/netgroup.c b/nss/netgroup.c
index 93fc923..6315707 100644
--- a/nss/netgroup.c
+++ b/nss/netgroup.c
@@ -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 @@ static enum nss_status read_netgrent(
/* 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 @@ enum nss_status _nss_ldap_setnetgrent(const char *group,struct __netgrent UNUSED
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);
}
diff --git a/nss/networks.c b/nss/networks.c
index a86dcc4..8273f27 100644
--- a/nss/networks.c
+++ b/nss/networks.c
@@ -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 @@ static enum nss_status read_netent(
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 @@ static enum nss_status read_netent(
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 @@ enum nss_status _nss_ldap_getnetbyname_r(const char *name,struct netent *result,
/* 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 @@ enum nss_status _nss_ldap_getnetbyaddr_r(uint32_t addr,int UNUSED(af),struct net
/* 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);
}
diff --git a/nss/passwd.c b/nss/passwd.c
index d6e3ab1..6787d60 100644
--- a/nss/passwd.c
+++ b/nss/passwd.c
@@ -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 @@ static enum nss_status read_passwd(
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 @@ enum nss_status _nss_ldap_getpwuid_r(uid_t uid,struct passwd *result,char *buffe
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);
}
diff --git a/nss/protocols.c b/nss/protocols.c
index ff834a0..165c24f 100644
--- a/nss/protocols.c
+++ b/nss/protocols.c
@@ -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 @@ static enum nss_status read_protoent(
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 @@ enum nss_status _nss_ldap_getprotobynumber_r(int number,struct protoent *result,
/* 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);
}
diff --git a/nss/prototypes.h b/nss/prototypes.h
index a2f9eff..862b04a 100644
--- a/nss/prototypes.h
+++ b/nss/prototypes.h
@@ -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 */
diff --git a/nss/rpc.c b/nss/rpc.c
index ddfd8ee..596d650 100644
--- a/nss/rpc.c
+++ b/nss/rpc.c
@@ -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 @@ static enum nss_status read_rpcent(
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 @@ enum nss_status _nss_ldap_getrpcbynumber_r(int number,struct rpcent *result,char
/* 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);
}
diff --git a/nss/services.c b/nss/services.c
index e5ae0ae..066acb5 100644
--- a/nss/services.c
+++ b/nss/services.c
@@ -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 @@ static enum nss_status read_servent(
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_getservbyname_r(const char *name,const char *protocol,
}
-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 @@ enum nss_status _nss_ldap_getservbyport_r(int port,const char *protocol,struct s
/* 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);
}
diff --git a/nss/shadow.c b/nss/shadow.c
index a2dd154..8132e17 100644
--- a/nss/shadow.c
+++ b/nss/shadow.c
@@ -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 @@ static enum nss_status read_spwd(
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 @@ enum nss_status _nss_ldap_getspnam_r(const char *name,struct spwd *result,char *
/* 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);
}