summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2007-09-03 21:47:36 +0000
committerArthur de Jong <arthur@arthurdejong.org>2007-09-03 21:47:36 +0000
commitd8026047e2b35abda4c8ef3ba747a0c037d5446d (patch)
tree31d9fdd840897e0dbb499ba75803ef7664c2ac52
parent7b7d982ac09aad6d12ef57447aa46d17637039b0 (diff)
include service name in attlst storage and functions
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@373 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r--nslcd/alias.c18
-rw-r--r--nslcd/ether.c22
-rw-r--r--nslcd/group.c28
-rw-r--r--nslcd/host.c22
-rw-r--r--nslcd/netgroup.c16
-rw-r--r--nslcd/network.c22
-rw-r--r--nslcd/passwd.c36
-rw-r--r--nslcd/protocol.c22
-rw-r--r--nslcd/rpc.c22
-rw-r--r--nslcd/service.c24
-rw-r--r--nslcd/shadow.c32
11 files changed, 132 insertions, 132 deletions
diff --git a/nslcd/alias.c b/nslcd/alias.c
index dc9bc89..2c830bd 100644
--- a/nslcd/alias.c
+++ b/nslcd/alias.c
@@ -46,13 +46,13 @@
#include "ldap-schema.h"
/* the attributes to request with searches */
-static const char *attlst[3];
+static const char *alias_attlst[3];
-static void attlst_init(void)
+static void alias_attlst_init(void)
{
- attlst[0] = attmap_alias_cn;
- attlst[1] = attmap_alias_rfc822MailMember;
- attlst[2] = NULL;
+ attlst[0]=attmap_alias_cn;
+ attlst[1]=attmap_alias_rfc822MailMember;
+ attlst[2]=NULL;
}
static enum nss_status _nss_ldap_parse_alias(
@@ -108,8 +108,8 @@ int nslcd_alias_byname(TFILE *fp)
LA_INIT(a);
LA_STRING(a)=name;
LA_TYPE(a)=LA_TYPE_STRING;
- attlst_init();
- _nss_ldap_searchbyname(&a,_nss_ldap_filt_getaliasbyname,LM_ALIASES,attlst,fp,write_alias);
+ alias_attlst_init();
+ _nss_ldap_searchbyname(&a,_nss_ldap_filt_getaliasbyname,LM_ALIASES,alias_attlst,fp,write_alias);
WRITE_FLUSH(fp);
/* we're done */
return 0;
@@ -133,8 +133,8 @@ int nslcd_alias_all(TFILE *fp)
if (_nss_ldap_ent_context_init(&alias_context)==NULL)
return -1;
/* loop over all results */
- attlst_init();
- while ((retv=nss2nslcd(_nss_ldap_getent(&alias_context,&result,buffer,1024,&errnop,_nss_ldap_filt_getaliasent,LM_ALIASES,attlst,_nss_ldap_parse_alias)))==NSLCD_RESULT_SUCCESS)
+ alias_attlst_init();
+ while ((retv=nss2nslcd(_nss_ldap_getent(&alias_context,&result,buffer,1024,&errnop,_nss_ldap_filt_getaliasent,LM_ALIASES,alias_attlst,_nss_ldap_parse_alias)))==NSLCD_RESULT_SUCCESS)
{
/* write the result */
WRITE_INT32(fp,retv);
diff --git a/nslcd/ether.c b/nslcd/ether.c
index 9cc9705..bf17bb9 100644
--- a/nslcd/ether.c
+++ b/nslcd/ether.c
@@ -75,13 +75,13 @@ struct ether
};
/* the attributes to request with searches */
-static const char *attlst[3];
+static const char *ether_attlst[3];
-static void attlst_init(void)
+static void ether_attlst_init(void)
{
- attlst[0] = attmap_ether_cn;
- attlst[1] = attmap_ether_macAddress;
- attlst[2] = NULL;
+ ether_attlst[0]=attmap_ether_cn;
+ ether_attlst[1]=attmap_ether_macAddress;
+ ether_attlst[2]=NULL;
}
static enum nss_status
@@ -137,8 +137,8 @@ int nslcd_ether_byname(TFILE *fp)
LA_INIT(a);
LA_STRING(a)=name;
LA_TYPE(a)=LA_TYPE_STRING;
- attlst_init();
- retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_gethostton,LM_ETHERS,attlst,_nss_ldap_parse_ether));
+ ether_attlst_init();
+ retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_gethostton,LM_ETHERS,ether_attlst,_nss_ldap_parse_ether));
/* write the response */
WRITE_INT32(fp,retv);
if (retv==NSLCD_RESULT_SUCCESS)
@@ -173,8 +173,8 @@ int nslcd_ether_byether(TFILE *fp)
and we're looking for 1:0:e:... (leading zeros) */
LA_STRING(a)=ether_ntoa(&addr);
LA_TYPE(a)=LA_TYPE_STRING;
- attlst_init();
- retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_getntohost,LM_ETHERS,attlst,_nss_ldap_parse_ether));
+ ether_attlst_init();
+ retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_getntohost,LM_ETHERS,ether_attlst,_nss_ldap_parse_ether));
/* write the response */
WRITE_INT32(fp,retv);
if (retv==NSLCD_RESULT_SUCCESS)
@@ -204,8 +204,8 @@ int nslcd_ether_all(TFILE *fp)
if (_nss_ldap_ent_context_init(&ether_context)==NULL)
return -1;
/* loop over all results */
- attlst_init();
- while ((retv=nss2nslcd(_nss_ldap_getent(&ether_context,&result,buffer,1024,&errnop,_nss_ldap_filt_getetherent,LM_ETHERS,attlst,_nss_ldap_parse_ether)))==NSLCD_RESULT_SUCCESS)
+ ether_attlst_init();
+ while ((retv=nss2nslcd(_nss_ldap_getent(&ether_context,&result,buffer,1024,&errnop,_nss_ldap_filt_getetherent,LM_ETHERS,ether_attlst,_nss_ldap_parse_ether)))==NSLCD_RESULT_SUCCESS)
{
/* write the result */
WRITE_INT32(fp,retv);
diff --git a/nslcd/group.c b/nslcd/group.c
index c61940b..7a93dd8 100644
--- a/nslcd/group.c
+++ b/nslcd/group.c
@@ -113,16 +113,16 @@ static enum nss_status ng_chase (const char *dn, ldap_initgroups_args_t * lia);
static enum nss_status ng_chase_backlink (const char ** membersOf, ldap_initgroups_args_t * lia);
/* the attributes to request with searches */
-static const char *attlst[6];
+static const char *group_attlst[6];
-static void attlst_init(void)
+static void group_attlst_init(void)
{
- attlst[0] = attmap_group_cn;
- attlst[1] = attmap_group_userPassword;
- attlst[2] = attmap_group_memberUid;
- attlst[3] = attmap_group_uniqueMember;
- attlst[4] = attmap_group_gidNumber;
- attlst[5] = NULL;
+ group_attlst[0]=attmap_group_cn;
+ group_attlst[1]=attmap_group_userPassword;
+ group_attlst[2]=attmap_group_memberUid;
+ group_attlst[3]=attmap_group_uniqueMember;
+ group_attlst[4]=attmap_group_gidNumber;
+ group_attlst[5]=NULL;
}
/*
@@ -1157,8 +1157,8 @@ int nslcd_group_byname(TFILE *fp)
LA_INIT(a);
LA_STRING(a)=name;
LA_TYPE(a)=LA_TYPE_STRING;
- attlst_init();
- retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_getgrnam,LM_GROUP,attlst,_nss_ldap_parse_gr));
+ group_attlst_init();
+ retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_getgrnam,LM_GROUP,group_attlst,_nss_ldap_parse_gr));
/* write the response */
WRITE_INT32(fp,NSLCD_VERSION);
WRITE_INT32(fp,NSLCD_ACTION_GROUP_BYNAME);
@@ -1196,8 +1196,8 @@ int nslcd_group_bygid(TFILE *fp)
LA_INIT(a);
LA_NUMBER(a)=gid;
LA_TYPE(a)=LA_TYPE_NUMBER;
- attlst_init();
- retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_getgrgid,LM_GROUP,attlst,_nss_ldap_parse_gr));
+ group_attlst_init();
+ retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_getgrgid,LM_GROUP,group_attlst,_nss_ldap_parse_gr));
/* write the response */
WRITE_INT32(fp,NSLCD_VERSION);
WRITE_INT32(fp,NSLCD_ACTION_GROUP_BYGID);
@@ -1285,8 +1285,8 @@ int nslcd_group_all(TFILE *fp)
if (_nss_ldap_ent_context_init(&gr_context)==NULL)
return -1;
/* loop over all results */
- attlst_init();
- while ((retv=nss2nslcd(_nss_ldap_getent(&gr_context,&result,buffer,1024,&errnop,_nss_ldap_filt_getgrent,LM_GROUP,attlst,_nss_ldap_parse_gr)))==NSLCD_RESULT_SUCCESS)
+ group_attlst_init();
+ while ((retv=nss2nslcd(_nss_ldap_getent(&gr_context,&result,buffer,1024,&errnop,_nss_ldap_filt_getgrent,LM_GROUP,group_attlst,_nss_ldap_parse_gr)))==NSLCD_RESULT_SUCCESS)
{
/* write the result */
WRITE_INT32(fp,retv);
diff --git a/nslcd/host.c b/nslcd/host.c
index c8105d3..78b5b43 100644
--- a/nslcd/host.c
+++ b/nslcd/host.c
@@ -61,13 +61,13 @@
#endif
/* the attributes to request with searches */
-static const char *attlst[3];
+static const char *host_attlst[3];
-static void attlst_init(void)
+static void host_attlst_init(void)
{
- attlst[0] = attmap_host_cn;
- attlst[1] = attmap_host_ipHostNumber;
- attlst[2] = NULL;
+ host_attlst[0]=attmap_host_cn;
+ host_attlst[1]=attmap_host_ipHostNumber;
+ host_attlst[2]=NULL;
}
/* write a single host entry to the stream */
@@ -276,8 +276,8 @@ int nslcd_host_byname(TFILE *fp)
LA_INIT(a);
LA_STRING(a)=name;
LA_TYPE(a)=LA_TYPE_STRING;
- attlst_init();
- retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_gethostbyname,LM_HOSTS,attlst,
+ host_attlst_init();
+ retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_gethostbyname,LM_HOSTS,host_attlst,
#ifdef INET6
(af == AF_INET6)?_nss_ldap_parse_hostv6:_nss_ldap_parse_hostv4));
#else
@@ -334,8 +334,8 @@ int nslcd_host_byaddr(TFILE *fp)
LA_INIT(a);
LA_STRING(a)=name;
LA_TYPE(a)=LA_TYPE_STRING;
- attlst_init();
- retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_gethostbyaddr,LM_HOSTS,attlst,
+ host_attlst_init();
+ retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_gethostbyaddr,LM_HOSTS,host_attlst,
#ifdef INET6
(af == AF_INET6)?_nss_ldap_parse_hostv6:_nss_ldap_parse_hostv4));
#else
@@ -368,9 +368,9 @@ int nslcd_host_all(TFILE *fp)
if (_nss_ldap_ent_context_init(&host_context)==NULL)
return -1;
/* loop over all results */
- attlst_init();
+ host_attlst_init();
while ((retv=nss2nslcd(_nss_ldap_getent(&host_context,&result,buffer,1024,&errnop,_nss_ldap_filt_gethostent,LM_HOSTS,
- attlst,
+ host_attlst,
#ifdef INET6
(_res.options&RES_USE_INET6)?_nss_ldap_parse_hostv6:_nss_ldap_parse_hostv4
#else
diff --git a/nslcd/netgroup.c b/nslcd/netgroup.c
index 339b2d3..f926377 100644
--- a/nslcd/netgroup.c
+++ b/nslcd/netgroup.c
@@ -115,14 +115,14 @@ struct mynetgrent
while (0)
/* the attributes to request with searches */
-static const char *attlst[4];
+static const char *netgroup_attlst[4];
-static void attlst_init(void)
+static void netgroup_attlst_init(void)
{
- attlst[0] = attmap_netgroup_cn;
- attlst[1] = attmap_netgroup_nisNetgroupTriple;
- attlst[2] = attmap_netgroup_memberNisNetgroup;
- attlst[3] = NULL;
+ netgroup_attlst[0]=attmap_netgroup_cn;
+ netgroup_attlst[1]=attmap_netgroup_nisNetgroupTriple;
+ netgroup_attlst[2]=attmap_netgroup_memberNisNetgroup;
+ netgroup_attlst[3]=NULL;
}
static char *
@@ -322,8 +322,8 @@ int nslcd_netgroup_byname(TFILE *fp)
LA_INIT(a);
LA_STRING(a)=name;
LA_TYPE(a)=LA_TYPE_STRING;
- attlst_init();
- stat=_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_getnetgrent,LM_NETGROUP,attlst,_nss_ldap_load_netgr);
+ netgroup_attlst_init();
+ stat=_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_getnetgrent,LM_NETGROUP,netgroup_attlst,_nss_ldap_load_netgr);
if (_nss_ldap_ent_context_init(&netgroup_context)==NULL)
return -1;
/* loop over all results */
diff --git a/nslcd/network.c b/nslcd/network.c
index c3a9149..21ee082 100644
--- a/nslcd/network.c
+++ b/nslcd/network.c
@@ -59,13 +59,13 @@
#endif /* HAVE_USERSEC_H */
/* the attributes to request with searches */
-static const char *attlst[3];
+static const char *network_attlst[3];
-static void attlst_init(void)
+static void network_attlst_init(void)
{
- attlst[0] = attmap_network_cn;
- attlst[1] = attmap_network_ipNetworkNumber;
- attlst[2] = NULL;
+ network_attlst[0]=attmap_network_cn;
+ network_attlst[1]=attmap_network_ipNetworkNumber;
+ network_attlst[2]=NULL;
}
/* write a single network entry to the stream */
@@ -140,8 +140,8 @@ int nslcd_network_byname(TFILE *fp)
LA_INIT(a);
LA_STRING(a)=name;
LA_TYPE(a)=LA_TYPE_STRING;
- attlst_init();
- retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_getnetbyname,LM_NETWORKS,attlst,_nss_ldap_parse_net));
+ network_attlst_init();
+ retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_getnetbyname,LM_NETWORKS,network_attlst,_nss_ldap_parse_net));
/* write the response */
WRITE_INT32(fp,retv);
if (retv==NSLCD_RESULT_SUCCESS)
@@ -198,8 +198,8 @@ int nslcd_network_byaddr(TFILE *fp)
while (retv==456)
{
/* do the request */
- attlst_init();
- retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_getnetbyaddr,LM_NETWORKS,attlst,_nss_ldap_parse_net));
+ network_attlst_init();
+ retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_getnetbyaddr,LM_NETWORKS,network_attlst,_nss_ldap_parse_net));
/* if no entry was found, retry with .0 stripped from the end */
if ((retv==NSLCD_RESULT_NOTFOUND) &&
(strlen(name)>2) &&
@@ -237,8 +237,8 @@ int nslcd_network_all(TFILE *fp)
if (_nss_ldap_ent_context_init(&net_context)==NULL)
return -1;
/* loop over all results */
- attlst_init();
- while ((retv=nss2nslcd(_nss_ldap_getent(&net_context,&result,buffer,1024,&errnop,_nss_ldap_filt_getnetent,LM_NETWORKS,attlst,_nss_ldap_parse_net)))==NSLCD_RESULT_SUCCESS)
+ network_attlst_init();
+ while ((retv=nss2nslcd(_nss_ldap_getent(&net_context,&result,buffer,1024,&errnop,_nss_ldap_filt_getnetent,LM_NETWORKS,network_attlst,_nss_ldap_parse_net)))==NSLCD_RESULT_SUCCESS)
{
/* write the result */
WRITE_INT32(fp,retv);
diff --git a/nslcd/passwd.c b/nslcd/passwd.c
index 0f0b4b2..da35854 100644
--- a/nslcd/passwd.c
+++ b/nslcd/passwd.c
@@ -60,20 +60,20 @@
#endif
/* the attributes to request with searches */
-static const char *attlst[10];
+static const char *passwd_attlst[10];
-static void attlst_init(void)
+static void passwd_attlst_init(void)
{
- attlst[0] = attmap_passwd_uid;
- attlst[1] = attmap_passwd_userPassword;
- attlst[2] = attmap_passwd_uidNumber;
- attlst[3] = attmap_passwd_gidNumber;
- attlst[4] = attmap_passwd_cn;
- attlst[5] = attmap_passwd_homeDirectory;
- attlst[6] = attmap_passwd_loginShell;
- attlst[7] = attmap_passwd_gecos;
- attlst[8] = attmap_objectClass;
- attlst[9] = NULL;
+ passwd_attlst[0]=attmap_passwd_uid;
+ passwd_attlst[1]=attmap_passwd_userPassword;
+ passwd_attlst[2]=attmap_passwd_uidNumber;
+ passwd_attlst[3]=attmap_passwd_gidNumber;
+ passwd_attlst[4]=attmap_passwd_cn;
+ passwd_attlst[5]=attmap_passwd_homeDirectory;
+ passwd_attlst[6]=attmap_passwd_loginShell;
+ passwd_attlst[7]=attmap_passwd_gecos;
+ passwd_attlst[8]=attmap_objectClass;
+ passwd_attlst[9]=NULL;
}
static inline enum nss_status _nss_ldap_assign_emptystring(
@@ -211,8 +211,8 @@ int nslcd_passwd_byname(TFILE *fp)
LA_INIT(a);
LA_STRING(a)=name;
LA_TYPE(a)=LA_TYPE_STRING;
- attlst_init();
- retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_getpwnam,LM_PASSWD,attlst,_nss_ldap_parse_pw));
+ passwd_attlst_init();
+ retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_getpwnam,LM_PASSWD,passwd_attlst,_nss_ldap_parse_pw));
/* write the response */
WRITE_INT32(fp,NSLCD_VERSION);
WRITE_INT32(fp,NSLCD_ACTION_PASSWD_BYNAME);
@@ -244,8 +244,8 @@ int nslcd_passwd_byuid(TFILE *fp)
LA_INIT(a);
LA_NUMBER(a)=uid;
LA_TYPE(a)=LA_TYPE_NUMBER;
- attlst_init();
- retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_getpwuid,LM_PASSWD,attlst,_nss_ldap_parse_pw));
+ passwd_attlst_init();
+ retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_getpwuid,LM_PASSWD,passwd_attlst,_nss_ldap_parse_pw));
/* write the response */
WRITE_INT32(fp,NSLCD_VERSION);
WRITE_INT32(fp,NSLCD_ACTION_PASSWD_BYUID);
@@ -277,8 +277,8 @@ int nslcd_passwd_all(TFILE *fp)
if (_nss_ldap_ent_context_init(&pw_context)==NULL)
return -1;
/* go over results */
- attlst_init();
- while ((retv=nss2nslcd(_nss_ldap_getent(&pw_context,&result,buffer,1024,&errnop,_nss_ldap_filt_getpwent,LM_PASSWD,attlst,_nss_ldap_parse_pw)))==NSLCD_RESULT_SUCCESS)
+ passwd_attlst_init();
+ while ((retv=nss2nslcd(_nss_ldap_getent(&pw_context,&result,buffer,1024,&errnop,_nss_ldap_filt_getpwent,LM_PASSWD,passwd_attlst,_nss_ldap_parse_pw)))==NSLCD_RESULT_SUCCESS)
{
/* write the result */
WRITE_INT32(fp,retv);
diff --git a/nslcd/protocol.c b/nslcd/protocol.c
index 035697d..aacf37b 100644
--- a/nslcd/protocol.c
+++ b/nslcd/protocol.c
@@ -56,13 +56,13 @@
#include "ldap-schema.h"
/* the attributes to request with searches */
-static const char *attlst[3];
+static const char *protocol_attlst[3];
-static void attlst_init(void)
+static void protocol_attlst_init(void)
{
- attlst[0] = attmap_protocol_cn;
- attlst[1] = attmap_protocol_ipProtocolNumber;
- attlst[2] = NULL;
+ protocol_attlst[0]=attmap_protocol_cn;
+ protocol_attlst[1]=attmap_protocol_ipProtocolNumber;
+ protocol_attlst[2]=NULL;
}
static enum nss_status _nss_ldap_parse_proto (LDAPMessage *e,
@@ -126,8 +126,8 @@ int nslcd_protocol_byname(TFILE *fp)
LA_INIT(a);
LA_STRING(a)=name;
LA_TYPE(a)=LA_TYPE_STRING;
- attlst_init();
- retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_getprotobyname,LM_PROTOCOLS,attlst,_nss_ldap_parse_proto));
+ protocol_attlst_init();
+ retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_getprotobyname,LM_PROTOCOLS,protocol_attlst,_nss_ldap_parse_proto));
/* write the response */
WRITE_INT32(fp,retv);
if (retv==NSLCD_RESULT_SUCCESS)
@@ -160,8 +160,8 @@ int nslcd_protocol_bynumber(TFILE *fp)
LA_INIT(a);
LA_NUMBER(a)=protocol;
LA_TYPE(a)=LA_TYPE_NUMBER;
- attlst_init();
- retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_getprotobynumber,LM_PROTOCOLS,attlst,_nss_ldap_parse_proto));
+ protocol_attlst_init();
+ retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_getprotobynumber,LM_PROTOCOLS,protocol_attlst,_nss_ldap_parse_proto));
/* write the response */
WRITE_INT32(fp,retv);
if (retv==NSLCD_RESULT_SUCCESS)
@@ -191,8 +191,8 @@ int nslcd_protocol_all(TFILE *fp)
if (_nss_ldap_ent_context_init(&protocol_context)==NULL)
return -1;
/* loop over all results */
- attlst_init();
- while ((retv=nss2nslcd(_nss_ldap_getent(&protocol_context,&result,buffer,1024,&errnop,_nss_ldap_filt_getprotoent,LM_PROTOCOLS,attlst,_nss_ldap_parse_proto)))==NSLCD_RESULT_SUCCESS)
+ protocol_attlst_init();
+ while ((retv=nss2nslcd(_nss_ldap_getent(&protocol_context,&result,buffer,1024,&errnop,_nss_ldap_filt_getprotoent,LM_PROTOCOLS,protocol_attlst,_nss_ldap_parse_proto)))==NSLCD_RESULT_SUCCESS)
{
/* write the result code */
WRITE_INT32(fp,retv);
diff --git a/nslcd/rpc.c b/nslcd/rpc.c
index ad92541..f1c912b 100644
--- a/nslcd/rpc.c
+++ b/nslcd/rpc.c
@@ -68,13 +68,13 @@
#define RPC_NUMBER result->r_number
/* the attributes to request with searches */
-static const char *attlst[3];
+static const char *rpc_attlst[3];
-static void attlst_init(void)
+static void rpc_attlst_init(void)
{
- attlst[0] = attmap_rpc_cn;
- attlst[1] = attmap_rpc_oncRpcNumber;
- attlst[2] = NULL;
+ rpc_attlst[0]=attmap_rpc_cn;
+ rpc_attlst[1]=attmap_rpc_oncRpcNumber;
+ rpc_attlst[2]=NULL;
}
/* write a single rpc entry to the stream */
@@ -138,8 +138,8 @@ int nslcd_rpc_byname(TFILE *fp)
LA_INIT(a);
LA_STRING(a)=name;
LA_TYPE(a)=LA_TYPE_STRING;
- attlst_init();
- retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_getrpcbyname,LM_RPC,attlst,_nss_ldap_parse_rpc));
+ rpc_attlst_init();
+ retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_getrpcbyname,LM_RPC,rpc_attlst,_nss_ldap_parse_rpc));
/* write the response */
WRITE_INT32(fp,retv);
if (retv==NSLCD_RESULT_SUCCESS)
@@ -170,8 +170,8 @@ int nslcd_rpc_bynumber(TFILE *fp)
LA_INIT(a);
LA_NUMBER(a)=number;
LA_TYPE(a)=LA_TYPE_NUMBER;
- attlst_init();
- retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_getrpcbynumber,LM_RPC,attlst,_nss_ldap_parse_rpc));
+ rpc_attlst_init();
+ retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_getrpcbynumber,LM_RPC,rpc_attlst,_nss_ldap_parse_rpc));
/* write the response */
WRITE_INT32(fp,retv);
if (retv==NSLCD_RESULT_SUCCESS)
@@ -199,8 +199,8 @@ int nslcd_rpc_all(TFILE *fp)
if (_nss_ldap_ent_context_init(&rpc_context)==NULL)
return -1;
/* loop over all results */
- attlst_init();
- while ((retv=nss2nslcd(_nss_ldap_getent(&rpc_context,&result,buffer,1024,&errnop,_nss_ldap_filt_getrpcent,LM_RPC,attlst,_nss_ldap_parse_rpc)))==NSLCD_RESULT_SUCCESS)
+ rpc_attlst_init();
+ while ((retv=nss2nslcd(_nss_ldap_getent(&rpc_context,&result,buffer,1024,&errnop,_nss_ldap_filt_getrpcent,LM_RPC,rpc_attlst,_nss_ldap_parse_rpc)))==NSLCD_RESULT_SUCCESS)
{
/* write the result code */
WRITE_INT32(fp,retv);
diff --git a/nslcd/service.c b/nslcd/service.c
index 58a6f09..8c3722e 100644
--- a/nslcd/service.c
+++ b/nslcd/service.c
@@ -69,14 +69,14 @@
#define SERVICE_PROTOCOL result->s_proto
/* the attributes to request with searches */
-static const char *attlst[4];
+static const char *service_attlst[4];
-static void attlst_init(void)
+static void service_attlst_init(void)
{
- attlst[0] = attmap_service_cn;
- attlst[1] = attmap_service_ipServicePort;
- attlst[2] = attmap_service_ipServiceProtocol;
- attlst[3] = NULL;
+ service_attlst[0]=attmap_service_cn;
+ service_attlst[1]=attmap_service_ipServicePort;
+ service_attlst[2]=attmap_service_ipServiceProtocol;
+ service_attlst[3]=NULL;
}
/* write a single host entry to the stream */
@@ -225,10 +225,10 @@ int nslcd_service_byname(TFILE *fp)
LA_STRING(a)=name;
LA_TYPE(a)=(strlen(protocol)==0)?LA_TYPE_STRING:LA_TYPE_STRING_AND_STRING;
LA_STRING2(a)=protocol;
- attlst_init();
+ service_attlst_init();
retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,
((strlen(protocol)==0)?_nss_ldap_filt_getservbyname:_nss_ldap_filt_getservbynameproto),
- LM_SERVICES,attlst,_nss_ldap_parse_serv));
+ LM_SERVICES,service_attlst,_nss_ldap_parse_serv));
/* write the response */
WRITE_INT32(fp,retv);
if (retv==NSLCD_RESULT_SUCCESS)
@@ -262,10 +262,10 @@ int nslcd_service_bynumber(TFILE *fp)
LA_NUMBER(a)=number;
LA_TYPE(a)=(strlen(protocol)==0)?LA_TYPE_NUMBER:LA_TYPE_NUMBER_AND_STRING;
LA_STRING2(a)=protocol;
- attlst_init();
+ service_attlst_init();
retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,
((strlen(protocol)==0)?_nss_ldap_filt_getservbyport:_nss_ldap_filt_getservbyportproto),
- LM_SERVICES,attlst,_nss_ldap_parse_serv));
+ LM_SERVICES,service_attlst,_nss_ldap_parse_serv));
/* write the response */
WRITE_INT32(fp,retv);
if (retv==NSLCD_RESULT_SUCCESS)
@@ -293,8 +293,8 @@ int nslcd_service_all(TFILE *fp)
if (_nss_ldap_ent_context_init(&serv_context)==NULL)
return -1;
/* loop over all results */
- attlst_init();
- while ((retv=nss2nslcd(_nss_ldap_getent(&serv_context,&result,buffer,1024,&errnop,_nss_ldap_filt_getservent,LM_SERVICES,attlst,_nss_ldap_parse_serv)))==NSLCD_RESULT_SUCCESS)
+ service_attlst_init();
+ while ((retv=nss2nslcd(_nss_ldap_getent(&serv_context,&result,buffer,1024,&errnop,_nss_ldap_filt_getservent,LM_SERVICES,service_attlst,_nss_ldap_parse_serv)))==NSLCD_RESULT_SUCCESS)
{
/* write the result code */
WRITE_INT32(fp,retv);
diff --git a/nslcd/shadow.c b/nslcd/shadow.c
index 0a3539b..a971b7a 100644
--- a/nslcd/shadow.c
+++ b/nslcd/shadow.c
@@ -53,20 +53,20 @@
#include "ldap-schema.h"
/* the attributes to request with searches */
-static const char *attlst[10];
+static const char *shadow_attlst[10];
-static void attlst_init(void)
+static void shadow_attlst_init(void)
{
- attlst[0] = attmap_shadow_uid;
- attlst[1] = attmap_shadow_userPassword;
- attlst[2] = attmap_shadow_shadowLastChange;
- attlst[3] = attmap_shadow_shadowMax;
- attlst[4] = attmap_shadow_shadowMin;
- attlst[5] = attmap_shadow_shadowWarning;
- attlst[6] = attmap_shadow_shadowInactive;
- attlst[7] = attmap_shadow_shadowExpire;
- attlst[8] = attmap_shadow_shadowFlag;
- attlst[9] = NULL;
+ shadow_attlst[0]=attmap_shadow_uid;
+ shadow_attlst[1]=attmap_shadow_userPassword;
+ shadow_attlst[2]=attmap_shadow_shadowLastChange;
+ shadow_attlst[3]=attmap_shadow_shadowMax;
+ shadow_attlst[4]=attmap_shadow_shadowMin;
+ shadow_attlst[5]=attmap_shadow_shadowWarning;
+ shadow_attlst[6]=attmap_shadow_shadowInactive;
+ shadow_attlst[7]=attmap_shadow_shadowExpire;
+ shadow_attlst[8]=attmap_shadow_shadowFlag;
+ shadow_attlst[9]=NULL;
}
static int
@@ -192,8 +192,8 @@ int nslcd_shadow_byname(TFILE *fp)
LA_INIT(a);
LA_STRING(a)=name;
LA_TYPE(a)=LA_TYPE_STRING;
- attlst_init();
- retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_getspnam,LM_SHADOW,attlst,_nss_ldap_parse_sp));
+ shadow_attlst_init();
+ retv=nss2nslcd(_nss_ldap_getbyname(&a,&result,buffer,1024,&errnop,_nss_ldap_filt_getspnam,LM_SHADOW,shadow_attlst,_nss_ldap_parse_sp));
/* write the response */
WRITE_INT32(fp,retv);
if (retv==NSLCD_RESULT_SUCCESS)
@@ -223,8 +223,8 @@ int nslcd_shadow_all(TFILE *fp)
if (_nss_ldap_ent_context_init(&shadow_context)==NULL)
return -1;
/* loop over all results */
- attlst_init();
- while ((retv=nss2nslcd(_nss_ldap_getent(&shadow_context,&result,buffer,1024,&errnop,_nss_ldap_filt_getspent,LM_SHADOW,attlst,_nss_ldap_parse_sp)))==NSLCD_RESULT_SUCCESS)
+ shadow_attlst_init();
+ while ((retv=nss2nslcd(_nss_ldap_getent(&shadow_context,&result,buffer,1024,&errnop,_nss_ldap_filt_getspent,LM_SHADOW,shadow_attlst,_nss_ldap_parse_sp)))==NSLCD_RESULT_SUCCESS)
{
/* write the result */
WRITE_INT32(fp,retv);