Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/nss
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2012-12-23 20:56:29 +0100
committerArthur de Jong <arthur@arthurdejong.org>2012-12-23 20:56:29 +0100
commitade4c9a0c0e9d251c9d1ffee3dcf4abfb007a6b6 (patch)
tree79e69076dda3b7a918eef47b85c53084c282c069 /nss
parenta7b5935ec4b09e75ac5bf6de73ec80984d54cd68 (diff)
merge NSS_BYNAME and NSS_BYINT32 into NSS_BYGEN and rename to NSS_GETONE
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1876 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nss')
-rw-r--r--nss/aliases.c3
-rw-r--r--nss/common.h12
-rw-r--r--nss/ethers.c19
-rw-r--r--nss/group.c33
-rw-r--r--nss/hosts.c24
-rw-r--r--nss/networks.c20
-rw-r--r--nss/passwd.c20
-rw-r--r--nss/protocols.c20
-rw-r--r--nss/rpc.c20
-rw-r--r--nss/services.c34
-rw-r--r--nss/shadow.c8
11 files changed, 102 insertions, 111 deletions
diff --git a/nss/aliases.c b/nss/aliases.c
index 6ffe150..54e0049 100644
--- a/nss/aliases.c
+++ b/nss/aliases.c
@@ -53,7 +53,8 @@ nss_status_t _nss_ldap_getaliasbyname_r(const char *name,
char *buffer, size_t buflen,
int *errnop)
{
- NSS_BYNAME(NSLCD_ACTION_ALIAS_BYNAME, name,
+ NSS_GETONE(NSLCD_ACTION_ALIAS_BYNAME,
+ WRITE_STRING(fp, name),
read_aliasent(fp, result, buffer, buflen, errnop));
}
diff --git a/nss/common.h b/nss/common.h
index adce4cf..fccbdf9 100644
--- a/nss/common.h
+++ b/nss/common.h
@@ -107,7 +107,7 @@
the result structure, the user buffer with length and the
errno to return. This macro should be called through some of
the customized ones below. */
-#define NSS_BYGEN(action, writefn, readfn) \
+#define NSS_GETONE(action, writefn, readfn) \
TFILE *fp; \
int32_t tmpint32; \
nss_status_t retv; \
@@ -127,16 +127,6 @@
} \
return retv;
-/* This macro can be used to generate a get..byname() function
- body. */
-#define NSS_BYNAME(action, name, readfn) \
- NSS_BYGEN(action, WRITE_STRING(fp, name), readfn)
-
-/* This macro can be used to generate a get..by..() function
- body where the value should be passed as an int32_t. */
-#define NSS_BYINT32(action, val, readfn) \
- NSS_BYGEN(action, WRITE_INT32(fp, val), readfn)
-
/* This macro generates a simple setent() function body. This closes any
open streams so that NSS_GETENT() can open a new file. */
#define NSS_SETENT(fp) \
diff --git a/nss/ethers.c b/nss/ethers.c
index 7369e88..c374975 100644
--- a/nss/ethers.c
+++ b/nss/ethers.c
@@ -49,7 +49,8 @@ nss_status_t _nss_ldap_gethostton_r(const char *name,
struct etherent *result, char *buffer,
size_t buflen, int *errnop)
{
- NSS_BYNAME(NSLCD_ACTION_ETHER_BYNAME, name,
+ NSS_GETONE(NSLCD_ACTION_ETHER_BYNAME,
+ WRITE_STRING(fp, name),
read_etherent(fp, result, buffer, buflen, errnop));
}
@@ -58,9 +59,9 @@ nss_status_t _nss_ldap_getntohost_r(const struct ether_addr *addr,
struct etherent *result, char *buffer,
size_t buflen, int *errnop)
{
- NSS_BYGEN(NSLCD_ACTION_ETHER_BYETHER,
- WRITE(fp, addr, sizeof(uint8_t[6])),
- read_etherent(fp, result, buffer, buflen, errnop));
+ NSS_GETONE(NSLCD_ACTION_ETHER_BYETHER,
+ WRITE(fp, addr, sizeof(uint8_t[6])),
+ read_etherent(fp, result, buffer, buflen, errnop));
}
/* thread-local file pointer to an ongoing request */
@@ -153,8 +154,8 @@ static nss_status_t read_result(TFILE *fp, nss_XbyY_args_t *args, int wantname)
/* map a hostname to the corresponding ethernet address */
static nss_status_t ethers_gethostton(nss_backend_t UNUSED(*be), void *args)
{
- NSS_BYNAME(NSLCD_ACTION_ETHER_BYNAME,
- NSS_ARGS(args)->key.name,
+ NSS_GETONE(NSLCD_ACTION_ETHER_BYNAME,
+ WRITE_STRING(fp, NSS_ARGS(args)->key.name),
read_result(fp, args, 0));
}
@@ -162,9 +163,9 @@ static nss_status_t ethers_gethostton(nss_backend_t UNUSED(*be), void *args)
static nss_status_t ethers_getntohost(nss_backend_t UNUSED(*be), void *args)
{
struct ether_addr *addr = (struct ether_addr *)(NSS_ARGS(args)->key.ether);
- NSS_BYGEN(NSLCD_ACTION_ETHER_BYETHER,
- WRITE(fp, addr, sizeof(uint8_t[6])),
- read_result(fp, args, 1));
+ NSS_GETONE(NSLCD_ACTION_ETHER_BYETHER,
+ WRITE(fp, addr, sizeof(uint8_t[6])),
+ read_result(fp, args, 1));
}
static nss_backend_op_t ethers_ops[] = {
diff --git a/nss/group.c b/nss/group.c
index 2f6d8be..69d0f02 100644
--- a/nss/group.c
+++ b/nss/group.c
@@ -118,8 +118,8 @@ static nss_status_t read_gids(TFILE *fp, gid_t skipgroup, long int *start,
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,
+ NSS_GETONE(NSLCD_ACTION_GROUP_BYNAME,
+ WRITE_STRING(fp, name),
read_group(fp, result, buffer, buflen, errnop));
}
@@ -127,9 +127,9 @@ nss_status_t _nss_ldap_getgrnam_r(const char *name, struct group *result,
nss_status_t _nss_ldap_getgrgid_r(gid_t gid, struct group *result,
char *buffer, size_t buflen, int *errnop)
{
- NSS_BYINT32(NSLCD_ACTION_GROUP_BYGID,
- gid,
- read_group(fp, result, buffer, buflen, errnop));
+ NSS_GETONE(NSLCD_ACTION_GROUP_BYGID,
+ WRITE_INT32(fp, gid),
+ read_group(fp, result, buffer, buflen, errnop));
}
/* thread-local file pointer to an ongoing request */
@@ -172,13 +172,13 @@ nss_status_t _nss_ldap_initgroups_dyn(const char *user, gid_t skipgroup,
gid_t **groupsp, long int limit,
int *errnop)
{
-/* temporarily map the buffer and buflen names so the check in NSS_BYNAME
+/* temporarily map the buffer and buflen names so the check in NSS_GETONE
for validity of the buffer works (renaming the parameters may cause
confusion) */
#define buffer groupsp
#define buflen *size
- NSS_BYNAME(NSLCD_ACTION_GROUP_BYMEMBER,
- user,
+ NSS_GETONE(NSLCD_ACTION_GROUP_BYMEMBER,
+ WRITE_STRING(fp, user),
read_gids(fp, skipgroup, start, size, groupsp, limit, errnop));
#undef buffer
#undef buflen
@@ -217,16 +217,16 @@ static nss_status_t read_result(TFILE *fp, nss_XbyY_args_t *args)
static nss_status_t group_getgrnam(nss_backend_t UNUSED(*be), void *args)
{
- NSS_BYNAME(NSLCD_ACTION_GROUP_BYNAME,
- NSS_ARGS(args)->key.name,
+ NSS_GETONE(NSLCD_ACTION_GROUP_BYNAME,
+ WRITE_STRING(fp, NSS_ARGS(args)->key.name),
read_result(fp, args));
}
static nss_status_t group_getgrgid(nss_backend_t UNUSED(*be), void *args)
{
- NSS_BYINT32(NSLCD_ACTION_GROUP_BYGID,
- NSS_ARGS(args)->key.gid,
- read_result(fp, args));
+ NSS_GETONE(NSLCD_ACTION_GROUP_BYGID,
+ WRITE_INT32(fp, NSS_ARGS(args)->key.gid),
+ read_result(fp, args));
}
static nss_status_t group_setgrent(nss_backend_t *be, void UNUSED(*args))
@@ -250,12 +250,11 @@ static nss_status_t group_getgroupsbymember(nss_backend_t UNUSED(*be), void *arg
struct nss_groupsbymem *argp = (struct nss_groupsbymem *)args;
long int start = (long int)argp->numgids;
gid_t skipgroup = (start > 0) ? argp->gid_array[0] : (gid_t)-1;
- NSS_BYNAME(NSLCD_ACTION_GROUP_BYMEMBER,
- argp->username,
+ NSS_GETONE(NSLCD_ACTION_GROUP_BYMEMBER,
+ WRITE_STRING(fp, argp->username),
read_gids(fp, skipgroup, &start, NULL, (gid_t **)&argp->gid_array,
argp->maxgids, &NSS_ARGS(args)->erange);
- argp->numgids = (int)start;
- );
+ argp->numgids = (int)start);
}
static nss_backend_op_t group_ops[] = {
diff --git a/nss/hosts.c b/nss/hosts.c
index 9b6690c..55205ae 100644
--- a/nss/hosts.c
+++ b/nss/hosts.c
@@ -158,8 +158,8 @@ nss_status_t _nss_ldap_gethostbyname2_r(const char *name, int af,
size_t buflen, int *errnop,
int *h_errnop)
{
- NSS_BYNAME(NSLCD_ACTION_HOST_BYNAME,
- name,
+ NSS_GETONE(NSLCD_ACTION_HOST_BYNAME,
+ WRITE_STRING(fp, name),
read_hostent(fp, result, buffer, buflen, errnop, h_errnop, af, 0));
}
@@ -187,9 +187,9 @@ nss_status_t _nss_ldap_gethostbyaddr_r(const void *addr, socklen_t len,
char *buffer, size_t buflen,
int *errnop, int *h_errnop)
{
- NSS_BYGEN(NSLCD_ACTION_HOST_BYADDR,
- WRITE_ADDRESS(fp, af, len, addr),
- read_hostent(fp, result, buffer, buflen, errnop, h_errnop, af, 0));
+ NSS_GETONE(NSLCD_ACTION_HOST_BYADDR,
+ WRITE_ADDRESS(fp, af, len, addr),
+ read_hostent(fp, result, buffer, buflen, errnop, h_errnop, af, 0));
}
/* thread-local file pointer to an ongoing request */
@@ -265,18 +265,18 @@ static nss_status_t read_result(TFILE *fp, int af, int retry,
static nss_status_t hosts_gethostbyname(nss_backend_t UNUSED(*be), void *args)
{
- NSS_BYNAME(NSLCD_ACTION_HOST_BYNAME,
- NSS_ARGS(args)->key.name,
+ NSS_GETONE(NSLCD_ACTION_HOST_BYNAME,
+ WRITE_STRING(fp, NSS_ARGS(args)->key.name),
read_result(fp, AF_INET, 0, args));
}
static nss_status_t hosts_gethostbyaddr(nss_backend_t UNUSED(*be), void *args)
{
- NSS_BYGEN(NSLCD_ACTION_HOST_BYADDR,
- WRITE_ADDRESS(fp, NSS_ARGS(args)->key.hostaddr.type,
- NSS_ARGS(args)->key.hostaddr.len,
- NSS_ARGS(args)->key.hostaddr.addr),
- read_result(fp, NSS_ARGS(args)->key.hostaddr.type, 0, args));
+ NSS_GETONE(NSLCD_ACTION_HOST_BYADDR,
+ WRITE_ADDRESS(fp, NSS_ARGS(args)->key.hostaddr.type,
+ NSS_ARGS(args)->key.hostaddr.len,
+ NSS_ARGS(args)->key.hostaddr.addr),
+ read_result(fp, NSS_ARGS(args)->key.hostaddr.type, 0, args));
}
static nss_status_t hosts_sethostent(nss_backend_t *be, void UNUSED(*args))
diff --git a/nss/networks.c b/nss/networks.c
index daeedb5..586b91d 100644
--- a/nss/networks.c
+++ b/nss/networks.c
@@ -118,8 +118,8 @@ nss_status_t _nss_ldap_getnetbyname_r(const char *name,
size_t buflen, int *errnop,
int *h_errnop)
{
- NSS_BYNAME(NSLCD_ACTION_NETWORK_BYNAME,
- name,
+ NSS_GETONE(NSLCD_ACTION_NETWORK_BYNAME,
+ WRITE_STRING(fp, name),
read_netent(fp, result, buffer, buflen, errnop, h_errnop));
}
@@ -130,9 +130,9 @@ nss_status_t _nss_ldap_getnetbyaddr_r(uint32_t addr, int UNUSED(af),
size_t buflen, int *errnop,
int *h_errnop)
{
- NSS_BYGEN(NSLCD_ACTION_NETWORK_BYADDR,
- WRITE_ADDRESS(fp, addr),
- read_netent(fp, result, buffer, buflen, errnop, h_errnop));
+ NSS_GETONE(NSLCD_ACTION_NETWORK_BYADDR,
+ WRITE_ADDRESS(fp, addr),
+ read_netent(fp, result, buffer, buflen, errnop, h_errnop));
}
/* thread-local file pointer to an ongoing request */
@@ -194,16 +194,16 @@ static nss_status_t read_result(TFILE *fp, nss_XbyY_args_t *args)
static nss_status_t networks_getnetbyname(nss_backend_t UNUSED(*be), void *args)
{
- NSS_BYNAME(NSLCD_ACTION_NETWORK_BYNAME,
- NSS_ARGS(args)->key.name,
+ NSS_GETONE(NSLCD_ACTION_NETWORK_BYNAME,
+ WRITE_STRING(fp, NSS_ARGS(args)->key.name),
read_result(fp, args));
}
static nss_status_t networks_getnetbyaddr(nss_backend_t UNUSED(*be), void *args)
{
- NSS_BYGEN(NSLCD_ACTION_NETWORK_BYADDR,
- WRITE_ADDRESS(fp, NSS_ARGS(args)->key.netaddr.net),
- read_result(fp, args));
+ NSS_GETONE(NSLCD_ACTION_NETWORK_BYADDR,
+ WRITE_ADDRESS(fp, NSS_ARGS(args)->key.netaddr.net),
+ read_result(fp, args));
}
static nss_status_t networks_setnetent(nss_backend_t *be, void UNUSED(*args))
diff --git a/nss/passwd.c b/nss/passwd.c
index 59014cd..db286a8 100644
--- a/nss/passwd.c
+++ b/nss/passwd.c
@@ -57,8 +57,8 @@ static nss_status_t read_passwd(TFILE *fp, struct passwd *result,
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,
+ NSS_GETONE(NSLCD_ACTION_PASSWD_BYNAME,
+ WRITE_STRING(fp, name),
read_passwd(fp, result, buffer, buflen, errnop));
}
@@ -66,9 +66,9 @@ nss_status_t _nss_ldap_getpwnam_r(const char *name, struct passwd *result,
nss_status_t _nss_ldap_getpwuid_r(uid_t uid, struct passwd *result,
char *buffer, size_t buflen, int *errnop)
{
- NSS_BYINT32(NSLCD_ACTION_PASSWD_BYUID,
- uid,
- read_passwd(fp, result, buffer, buflen, errnop));
+ NSS_GETONE(NSLCD_ACTION_PASSWD_BYUID,
+ WRITE_INT32(fp, uid),
+ read_passwd(fp, result, buffer, buflen, errnop));
}
/* thread-local file pointer to an ongoing request */
@@ -119,16 +119,16 @@ static nss_status_t read_result(TFILE *fp, nss_XbyY_args_t *args)
static nss_status_t passwd_getpwnam(nss_backend_t UNUSED(*be), void *args)
{
- NSS_BYNAME(NSLCD_ACTION_PASSWD_BYNAME,
- NSS_ARGS(args)->key.name,
+ NSS_GETONE(NSLCD_ACTION_PASSWD_BYNAME,
+ WRITE_STRING(fp, NSS_ARGS(args)->key.name),
read_result(fp, args));
}
static nss_status_t passwd_getpwuid(nss_backend_t UNUSED(*be), void *args)
{
- NSS_BYINT32(NSLCD_ACTION_PASSWD_BYUID,
- NSS_ARGS(args)->key.uid,
- read_result(fp, args));
+ NSS_GETONE(NSLCD_ACTION_PASSWD_BYUID,
+ WRITE_INT32(fp, NSS_ARGS(args)->key.uid),
+ read_result(fp, args));
}
/* open a connection to the nslcd and write the request */
diff --git a/nss/protocols.c b/nss/protocols.c
index b4c349e..cc1e60f 100644
--- a/nss/protocols.c
+++ b/nss/protocols.c
@@ -51,8 +51,8 @@ nss_status_t _nss_ldap_getprotobyname_r(const char *name,
char *buffer, size_t buflen,
int *errnop)
{
- NSS_BYNAME(NSLCD_ACTION_PROTOCOL_BYNAME,
- name,
+ NSS_GETONE(NSLCD_ACTION_PROTOCOL_BYNAME,
+ WRITE_STRING(fp, name),
read_protoent(fp, result, buffer, buflen, errnop));
}
@@ -61,9 +61,9 @@ 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,
- read_protoent(fp, result, buffer, buflen, errnop));
+ NSS_GETONE(NSLCD_ACTION_PROTOCOL_BYNUMBER,
+ WRITE_INT32(fp, number),
+ read_protoent(fp, result, buffer, buflen, errnop));
}
/* thread-local file pointer to an ongoing request */
@@ -119,16 +119,16 @@ static nss_status_t read_result(TFILE *fp, nss_XbyY_args_t *args)
static nss_status_t protocols_getprotobyname(nss_backend_t UNUSED(*be), void *args)
{
- NSS_BYNAME(NSLCD_ACTION_PROTOCOL_BYNAME,
- NSS_ARGS(args)->key.name,
+ NSS_GETONE(NSLCD_ACTION_PROTOCOL_BYNAME,
+ WRITE_STRING(fp, NSS_ARGS(args)->key.name),
read_result(fp, args));
}
static nss_status_t protocols_getprotobynumber(nss_backend_t UNUSED(*be), void *args)
{
- NSS_BYINT32(NSLCD_ACTION_PROTOCOL_BYNUMBER,
- NSS_ARGS(args)->key.number,
- read_result(fp, args));
+ NSS_GETONE(NSLCD_ACTION_PROTOCOL_BYNUMBER,
+ WRITE_INT32(fp, NSS_ARGS(args)->key.number),
+ read_result(fp, args));
}
static nss_status_t protocols_setprotoent(nss_backend_t *be, void UNUSED(*args))
diff --git a/nss/rpc.c b/nss/rpc.c
index d285022..507b970 100644
--- a/nss/rpc.c
+++ b/nss/rpc.c
@@ -50,8 +50,8 @@ 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,
+ NSS_GETONE(NSLCD_ACTION_RPC_BYNAME,
+ WRITE_STRING(fp, name),
read_rpcent(fp, result, buffer, buflen, errnop));
}
@@ -60,9 +60,9 @@ 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,
- read_rpcent(fp, result, buffer, buflen, errnop));
+ NSS_GETONE(NSLCD_ACTION_RPC_BYNUMBER,
+ WRITE_INT32(fp, number),
+ read_rpcent(fp, result, buffer, buflen, errnop));
}
/* thread-local file pointer to an ongoing request */
@@ -118,16 +118,16 @@ static nss_status_t read_result(TFILE *fp, nss_XbyY_args_t *args)
static nss_status_t rpc_getrpcbyname(nss_backend_t UNUSED(*be), void *args)
{
- NSS_BYNAME(NSLCD_ACTION_RPC_BYNAME,
- NSS_ARGS(args)->key.name,
+ NSS_GETONE(NSLCD_ACTION_RPC_BYNAME,
+ WRITE_STRING(fp, NSS_ARGS(args)->key.name),
read_result(fp, args));
}
static nss_status_t rpc_getrpcbynumber(nss_backend_t UNUSED(*be), void *args)
{
- NSS_BYINT32(NSLCD_ACTION_RPC_BYNUMBER,
- NSS_ARGS(args)->key.number,
- read_result(fp, args));
+ NSS_GETONE(NSLCD_ACTION_RPC_BYNUMBER,
+ WRITE_INT32(fp, NSS_ARGS(args)->key.number),
+ read_result(fp, args));
}
static nss_status_t rpc_setrpcent(nss_backend_t *be, void UNUSED(*args))
diff --git a/nss/services.c b/nss/services.c
index 76dd457..494a9aa 100644
--- a/nss/services.c
+++ b/nss/services.c
@@ -54,10 +54,10 @@ 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),
- read_servent(fp, result, buffer, buflen, errnop));
+ NSS_GETONE(NSLCD_ACTION_SERVICE_BYNAME,
+ WRITE_STRING(fp, name);
+ WRITE_STRING(fp, protocol),
+ read_servent(fp, result, buffer, buflen, errnop));
}
/* get a service entry by port and protocol */
@@ -66,11 +66,11 @@ nss_status_t _nss_ldap_getservbyport_r(int port, const char *protocol,
size_t buflen, int *errnop)
{
/* port is already in network byte order */
- NSS_BYGEN(NSLCD_ACTION_SERVICE_BYNUMBER,
- tmpint32 = ntohs(port);
- WRITE_INT32(fp, tmpint32);
- WRITE_STRING(fp, protocol),
- read_servent(fp, result, buffer, buflen, errnop));
+ NSS_GETONE(NSLCD_ACTION_SERVICE_BYNUMBER,
+ tmpint32 = ntohs(port);
+ WRITE_INT32(fp, tmpint32);
+ WRITE_STRING(fp, protocol),
+ read_servent(fp, result, buffer, buflen, errnop));
}
/* thread-local file pointer to an ongoing request */
@@ -127,18 +127,18 @@ static nss_status_t read_result(TFILE *fp, nss_XbyY_args_t *args)
static nss_status_t services_getservbyname(nss_backend_t UNUSED(*be), void *args)
{
- NSS_BYGEN(NSLCD_ACTION_SERVICE_BYNAME,
- WRITE_STRING(fp, NSS_ARGS(args)->key.serv.serv.name);
- WRITE_STRING(fp, NSS_ARGS(args)->key.serv.proto),
- read_result(fp, args));
+ NSS_GETONE(NSLCD_ACTION_SERVICE_BYNAME,
+ WRITE_STRING(fp, NSS_ARGS(args)->key.serv.serv.name);
+ WRITE_STRING(fp, NSS_ARGS(args)->key.serv.proto),
+ read_result(fp, args));
}
static nss_status_t services_getservbyport(nss_backend_t UNUSED(*be), void *args)
{
- NSS_BYGEN(NSLCD_ACTION_SERVICE_BYNUMBER,
- WRITE_INT32(fp, ntohs(NSS_ARGS(args)->key.serv.serv.port));
- WRITE_STRING(fp, NSS_ARGS(args)->key.serv.proto),
- read_result(fp, args));
+ NSS_GETONE(NSLCD_ACTION_SERVICE_BYNUMBER,
+ WRITE_INT32(fp, ntohs(NSS_ARGS(args)->key.serv.serv.port));
+ WRITE_STRING(fp, NSS_ARGS(args)->key.serv.proto),
+ read_result(fp, args));
}
static nss_status_t services_setservent(nss_backend_t *be, void UNUSED(*args))
diff --git a/nss/shadow.c b/nss/shadow.c
index db63cbc..53a2ad4 100644
--- a/nss/shadow.c
+++ b/nss/shadow.c
@@ -55,8 +55,8 @@ static nss_status_t read_spwd(TFILE *fp, struct spwd *result,
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,
+ NSS_GETONE(NSLCD_ACTION_SHADOW_BYNAME,
+ WRITE_STRING(fp, name),
read_spwd(fp, result, buffer, buflen, errnop));
}
@@ -125,8 +125,8 @@ static nss_status_t read_result(TFILE *fp, nss_XbyY_args_t *args)
static nss_status_t shadow_getspnam(nss_backend_t UNUSED(*be), void *args)
{
- NSS_BYNAME(NSLCD_ACTION_SHADOW_BYNAME,
- NSS_ARGS(args)->key.name,
+ NSS_GETONE(NSLCD_ACTION_SHADOW_BYNAME,
+ WRITE_STRING(fp, NSS_ARGS(args)->key. name),
read_result(fp, args));
}