nss-pam-ldapd commit: r1877 - nss-pam-ldapd/nslcd
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
nss-pam-ldapd commit: r1877 - nss-pam-ldapd/nslcd
- 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: r1877 - nss-pam-ldapd/nslcd
- Date: Sun, 23 Dec 2012 21:05:50 +0100 (CET)
Author: arthur
Date: Sun Dec 23 21:05:50 2012
New Revision: 1877
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?revision=1877&view=revision
Log:
move the action argument to NSLCD_HANDLE to the front
Modified:
nss-pam-ldapd/nslcd/alias.c
nss-pam-ldapd/nslcd/common.h
nss-pam-ldapd/nslcd/ether.c
nss-pam-ldapd/nslcd/group.c
nss-pam-ldapd/nslcd/host.c
nss-pam-ldapd/nslcd/netgroup.c
nss-pam-ldapd/nslcd/network.c
nss-pam-ldapd/nslcd/passwd.c
nss-pam-ldapd/nslcd/protocol.c
nss-pam-ldapd/nslcd/rpc.c
nss-pam-ldapd/nslcd/service.c
nss-pam-ldapd/nslcd/shadow.c
Modified: nss-pam-ldapd/nslcd/alias.c
==============================================================================
--- nss-pam-ldapd/nslcd/alias.c Sun Dec 23 20:56:29 2012 (r1876)
+++ nss-pam-ldapd/nslcd/alias.c Sun Dec 23 21:05:50 2012 (r1877)
@@ -118,21 +118,19 @@
}
NSLCD_HANDLE(
- alias, byname,
+ alias, byname, NSLCD_ACTION_ALIAS_BYNAME,
char name[256];
char filter[4096];
READ_STRING(fp, name);
log_setrequest("alias=\"%s\"", name);,
- NSLCD_ACTION_ALIAS_BYNAME,
mkfilter_alias_byname(name, filter, sizeof(filter)),
write_alias(fp, entry, name)
)
NSLCD_HANDLE(
- alias, all,
+ alias, all, NSLCD_ACTION_ALIAS_ALL,
const char *filter;
log_setrequest("alias(all)");,
- NSLCD_ACTION_ALIAS_ALL,
(filter = alias_filter, 0),
write_alias(fp, entry, NULL)
)
Modified: nss-pam-ldapd/nslcd/common.h
==============================================================================
--- nss-pam-ldapd/nslcd/common.h Sun Dec 23 20:56:29 2012 (r1876)
+++ nss-pam-ldapd/nslcd/common.h Sun Dec 23 21:05:50 2012 (r1877)
@@ -233,13 +233,13 @@
int nslcd_pam_pwmod(TFILE *fp, MYLDAP_SESSION *session, uid_t calleruid);
/* macros for generating service handling code */
-#define NSLCD_HANDLE(db, fn, readfn, action, mkfilter, writefn) \
+#define NSLCD_HANDLE(db, fn, action, readfn, mkfilter, writefn) \
int nslcd_##db##_##fn(TFILE *fp, MYLDAP_SESSION *session) \
- NSLCD_HANDLE_BODY(db, fn, readfn, action, mkfilter, writefn)
-#define NSLCD_HANDLE_UID(db, fn, readfn, action, mkfilter, writefn) \
+ NSLCD_HANDLE_BODY(db, fn, action, readfn, mkfilter, writefn)
+#define NSLCD_HANDLE_UID(db, fn, action, readfn, mkfilter, writefn) \
int nslcd_##db##_##fn(TFILE *fp, MYLDAP_SESSION *session, uid_t calleruid) \
- NSLCD_HANDLE_BODY(db, fn, readfn, action, mkfilter, writefn)
-#define NSLCD_HANDLE_BODY(db, fn, readfn, action, mkfilter, writefn) \
+ NSLCD_HANDLE_BODY(db, fn, action, readfn, mkfilter, writefn)
+#define NSLCD_HANDLE_BODY(db, fn, action, readfn, mkfilter, writefn) \
{ \
/* define common variables */ \
int32_t tmpint32; \
Modified: nss-pam-ldapd/nslcd/ether.c
==============================================================================
--- nss-pam-ldapd/nslcd/ether.c Sun Dec 23 20:56:29 2012 (r1876)
+++ nss-pam-ldapd/nslcd/ether.c Sun Dec 23 21:05:50 2012 (r1877)
@@ -154,18 +154,17 @@
}
NSLCD_HANDLE(
- ether, byname,
+ ether, byname, NSLCD_ACTION_ETHER_BYNAME,
char name[256];
char filter[4096];
READ_STRING(fp, name);
log_setrequest("ether=\"%s\"", name);,
- NSLCD_ACTION_ETHER_BYNAME,
mkfilter_ether_byname(name, filter, sizeof(filter)),
write_ether(fp, entry, name, NULL)
)
NSLCD_HANDLE(
- ether, byether,
+ ether, byether, NSLCD_ACTION_ETHER_BYETHER,
struct ether_addr addr;
char addrstr[20];
char filter[4096];
@@ -173,16 +172,14 @@
if (ether_ntoa_r(&addr, addrstr) == NULL)
return -1;
log_setrequest("ether=%s", addrstr);,
- NSLCD_ACTION_ETHER_BYETHER,
mkfilter_ether_byether(addrstr, filter, sizeof(filter)),
write_ether(fp, entry, NULL, addrstr)
)
NSLCD_HANDLE(
- ether, all,
+ ether, all, NSLCD_ACTION_ETHER_ALL,
const char *filter;
log_setrequest("ether(all)");,
- NSLCD_ACTION_ETHER_ALL,
(filter = ether_filter, 0),
write_ether(fp, entry, NULL, NULL)
)
Modified: nss-pam-ldapd/nslcd/group.c
==============================================================================
--- nss-pam-ldapd/nslcd/group.c Sun Dec 23 20:56:29 2012 (r1876)
+++ nss-pam-ldapd/nslcd/group.c Sun Dec 23 21:05:50 2012 (r1877)
@@ -309,7 +309,7 @@
}
NSLCD_HANDLE(
- group, byname,
+ group, byname, NSLCD_ACTION_GROUP_BYNAME,
char name[256];
char filter[4096];
READ_STRING(fp, name);
@@ -319,24 +319,22 @@
log_log(LOG_WARNING, "request denied by validnames option");
return -1;
},
- NSLCD_ACTION_GROUP_BYNAME,
mkfilter_group_byname(name, filter, sizeof(filter)),
write_group(fp, entry, name, NULL, 1, session)
)
NSLCD_HANDLE(
- group, bygid,
+ group, bygid, NSLCD_ACTION_GROUP_BYGID,
gid_t gid;
char filter[4096];
READ_INT32(fp, gid);
log_setrequest("group=%lu", (unsigned long int)gid);,
- NSLCD_ACTION_GROUP_BYGID,
mkfilter_group_bygid(gid, filter, sizeof(filter)),
write_group(fp, entry, NULL, &gid, 1, session)
)
NSLCD_HANDLE(
- group, bymember,
+ group, bymember, NSLCD_ACTION_GROUP_BYMEMBER,
char name[256];
char filter[4096];
READ_STRING(fp, name);
@@ -356,16 +354,14 @@
WRITE_INT32(fp, NSLCD_RESULT_END);
return 0;
},
- NSLCD_ACTION_GROUP_BYMEMBER,
mkfilter_group_bymember(session, name, filter, sizeof(filter)),
write_group(fp, entry, NULL, NULL, 0, session)
)
NSLCD_HANDLE(
- group, all,
+ group, all, NSLCD_ACTION_GROUP_ALL,
const char *filter;
log_setrequest("group(all)");,
- NSLCD_ACTION_GROUP_ALL,
(filter = group_filter, 0),
write_group(fp, entry, NULL, NULL, 1, session)
)
Modified: nss-pam-ldapd/nslcd/host.c
==============================================================================
--- nss-pam-ldapd/nslcd/host.c Sun Dec 23 20:56:29 2012 (r1876)
+++ nss-pam-ldapd/nslcd/host.c Sun Dec 23 21:05:50 2012 (r1877)
@@ -147,18 +147,17 @@
}
NSLCD_HANDLE(
- host, byname,
+ host, byname, NSLCD_ACTION_HOST_BYNAME,
char name[256];
char filter[4096];
READ_STRING(fp, name);
log_setrequest("host=\"%s\"", name);,
- NSLCD_ACTION_HOST_BYNAME,
mkfilter_host_byname(name, filter, sizeof(filter)),
write_host(fp, entry)
)
NSLCD_HANDLE(
- host, byaddr,
+ host, byaddr, NSLCD_ACTION_HOST_BYADDR,
int af;
char addr[64];
int len = sizeof(addr);
@@ -172,17 +171,15 @@
return -1;
}
log_setrequest("host=%s", addrstr);,
- NSLCD_ACTION_HOST_BYADDR,
mkfilter_host_byaddr(addrstr, filter, sizeof(filter)),
write_host(fp, entry)
)
NSLCD_HANDLE(
- host, all,
+ host, all, NSLCD_ACTION_HOST_ALL,
const char *filter;
log_setrequest("host(all)");,
- NSLCD_ACTION_HOST_ALL,
(filter = host_filter, 0),
write_host(fp, entry)
)
Modified: nss-pam-ldapd/nslcd/netgroup.c
==============================================================================
--- nss-pam-ldapd/nslcd/netgroup.c Sun Dec 23 20:56:29 2012 (r1876)
+++ nss-pam-ldapd/nslcd/netgroup.c Sun Dec 23 21:05:50 2012 (r1877)
@@ -236,12 +236,11 @@
}
NSLCD_HANDLE(
- netgroup, byname,
+ netgroup, byname, NSLCD_ACTION_NETGROUP_BYNAME,
char name[256];
char filter[4096];
READ_STRING(fp, name);
log_setrequest("netgroup=\"%s\"", name);,
- NSLCD_ACTION_NETGROUP_BYNAME,
mkfilter_netgroup_byname(name, filter, sizeof(filter)),
write_netgroup(fp, entry, name)
)
Modified: nss-pam-ldapd/nslcd/network.c
==============================================================================
--- nss-pam-ldapd/nslcd/network.c Sun Dec 23 20:56:29 2012 (r1876)
+++ nss-pam-ldapd/nslcd/network.c Sun Dec 23 21:05:50 2012 (r1877)
@@ -146,18 +146,17 @@
}
NSLCD_HANDLE(
- network, byname,
+ network, byname, NSLCD_ACTION_NETWORK_BYNAME,
char name[256];
char filter[4096];
READ_STRING(fp, name);
log_setrequest("network=\"%s\"", name);,
- NSLCD_ACTION_NETWORK_BYNAME,
mkfilter_network_byname(name, filter, sizeof(filter)),
write_network(fp, entry)
)
NSLCD_HANDLE(
- network, byaddr,
+ network, byaddr, NSLCD_ACTION_NETWORK_BYADDR,
int af;
char addr[64];
int len = sizeof(addr);
@@ -171,16 +170,14 @@
return -1;
}
log_setrequest("network=%s", addrstr);,
- NSLCD_ACTION_NETWORK_BYADDR,
mkfilter_network_byaddr(addrstr, filter, sizeof(filter)),
write_network(fp, entry)
)
NSLCD_HANDLE(
- network, all,
+ network, all, NSLCD_ACTION_NETWORK_ALL,
const char *filter;
log_setrequest("network(all)");,
- NSLCD_ACTION_NETWORK_ALL,
(filter = network_filter, 0),
write_network(fp, entry)
)
Modified: nss-pam-ldapd/nslcd/passwd.c
==============================================================================
--- nss-pam-ldapd/nslcd/passwd.c Sun Dec 23 20:56:29 2012 (r1876)
+++ nss-pam-ldapd/nslcd/passwd.c Sun Dec 23 21:05:50 2012 (r1877)
@@ -539,7 +539,7 @@
}
NSLCD_HANDLE_UID(
- passwd, byname,
+ passwd, byname, NSLCD_ACTION_PASSWD_BYNAME,
char name[256];
char filter[4096];
READ_STRING(fp, name);
@@ -550,13 +550,12 @@
return -1;
}
nsswitch_check_reload();,
- NSLCD_ACTION_PASSWD_BYNAME,
mkfilter_passwd_byname(name, filter, sizeof(filter)),
write_passwd(fp, entry, name, NULL, calleruid)
)
NSLCD_HANDLE_UID(
- passwd, byuid,
+ passwd, byuid, NSLCD_ACTION_PASSWD_BYUID,
uid_t uid;
char filter[4096];
READ_INT32(fp, uid);
@@ -570,17 +569,15 @@
return 0;
}
nsswitch_check_reload();,
- NSLCD_ACTION_PASSWD_BYUID,
mkfilter_passwd_byuid(uid, filter, sizeof(filter)),
write_passwd(fp, entry, NULL, &uid, calleruid)
)
NSLCD_HANDLE_UID(
- passwd, all,
+ passwd, all, NSLCD_ACTION_PASSWD_ALL,
const char *filter;
log_setrequest("passwd(all)");
nsswitch_check_reload();,
- NSLCD_ACTION_PASSWD_ALL,
(filter = passwd_filter, 0),
write_passwd(fp, entry, NULL, NULL, calleruid)
)
Modified: nss-pam-ldapd/nslcd/protocol.c
==============================================================================
--- nss-pam-ldapd/nslcd/protocol.c Sun Dec 23 20:56:29 2012 (r1876)
+++ nss-pam-ldapd/nslcd/protocol.c Sun Dec 23 21:05:50 2012 (r1877)
@@ -166,32 +166,29 @@
}
NSLCD_HANDLE(
- protocol, byname,
+ protocol, byname, NSLCD_ACTION_PROTOCOL_BYNAME,
char name[256];
char filter[4096];
READ_STRING(fp, name);
log_setrequest("protocol=\"%s\"", name);,
- NSLCD_ACTION_PROTOCOL_BYNAME,
mkfilter_protocol_byname(name, filter, sizeof(filter)),
write_protocol(fp, entry, name)
)
NSLCD_HANDLE(
- protocol, bynumber,
+ protocol, bynumber, NSLCD_ACTION_PROTOCOL_BYNUMBER,
int protocol;
char filter[4096];
READ_INT32(fp, protocol);
log_setrequest("protocol=%lu", (unsigned long int)protocol);,
- NSLCD_ACTION_PROTOCOL_BYNUMBER,
mkfilter_protocol_bynumber(protocol, filter, sizeof(filter)),
write_protocol(fp, entry, NULL)
)
NSLCD_HANDLE(
- protocol, all,
+ protocol, all, NSLCD_ACTION_PROTOCOL_ALL,
const char *filter;
log_setrequest("protocol(all)");,
- NSLCD_ACTION_PROTOCOL_ALL,
(filter = protocol_filter, 0),
write_protocol(fp, entry, NULL)
)
Modified: nss-pam-ldapd/nslcd/rpc.c
==============================================================================
--- nss-pam-ldapd/nslcd/rpc.c Sun Dec 23 20:56:29 2012 (r1876)
+++ nss-pam-ldapd/nslcd/rpc.c Sun Dec 23 21:05:50 2012 (r1877)
@@ -164,32 +164,29 @@
}
NSLCD_HANDLE(
- rpc, byname,
+ rpc, byname, NSLCD_ACTION_RPC_BYNAME,
char name[256];
char filter[4096];
READ_STRING(fp, name);
log_setrequest("rpc=\"%s\"", name);,
- NSLCD_ACTION_RPC_BYNAME,
mkfilter_rpc_byname(name, filter, sizeof(filter)),
write_rpc(fp, entry, name)
)
NSLCD_HANDLE(
- rpc, bynumber,
+ rpc, bynumber, NSLCD_ACTION_RPC_BYNUMBER,
int number;
char filter[4096];
READ_INT32(fp, number);
log_setrequest("rpc=%lu", (unsigned long int)number);,
- NSLCD_ACTION_RPC_BYNUMBER,
mkfilter_rpc_bynumber(number, filter, sizeof(filter)),
write_rpc(fp, entry, NULL)
)
NSLCD_HANDLE(
- rpc, all,
+ rpc, all, NSLCD_ACTION_RPC_ALL,
const char *filter;
log_setrequest("rpc(all)");,
- NSLCD_ACTION_RPC_ALL,
(filter = rpc_filter, 0),
write_rpc(fp, entry, NULL)
)
Modified: nss-pam-ldapd/nslcd/service.c
==============================================================================
--- nss-pam-ldapd/nslcd/service.c Sun Dec 23 20:56:29 2012 (r1876)
+++ nss-pam-ldapd/nslcd/service.c Sun Dec 23 21:05:50 2012 (r1877)
@@ -203,36 +203,33 @@
}
NSLCD_HANDLE(
- service, byname,
+ service, byname, NSLCD_ACTION_SERVICE_BYNAME,
char name[256];
char protocol[256];
char filter[4096];
READ_STRING(fp, name);
READ_STRING(fp, protocol);
log_setrequest("service=\"%s\"/%s", name, protocol);,
- NSLCD_ACTION_SERVICE_BYNAME,
mkfilter_service_byname(name, protocol, filter, sizeof(filter)),
write_service(fp, entry, name, protocol)
)
NSLCD_HANDLE(
- service, bynumber,
+ service, bynumber, NSLCD_ACTION_SERVICE_BYNUMBER,
int number;
char protocol[256];
char filter[4096];
READ_INT32(fp, number);
READ_STRING(fp, protocol);
log_setrequest("service=%lu/%s", (unsigned long int)number, protocol);,
- NSLCD_ACTION_SERVICE_BYNUMBER,
mkfilter_service_bynumber(number, protocol, filter, sizeof(filter)),
write_service(fp, entry, NULL, protocol)
)
NSLCD_HANDLE(
- service, all,
+ service, all, NSLCD_ACTION_SERVICE_ALL,
const char *filter;
log_setrequest("service(all)");,
- NSLCD_ACTION_SERVICE_ALL,
(filter = service_filter, 0),
write_service(fp, entry, NULL, NULL)
)
Modified: nss-pam-ldapd/nslcd/shadow.c
==============================================================================
--- nss-pam-ldapd/nslcd/shadow.c Sun Dec 23 20:56:29 2012 (r1876)
+++ nss-pam-ldapd/nslcd/shadow.c Sun Dec 23 21:05:50 2012 (r1877)
@@ -361,21 +361,19 @@
}
NSLCD_HANDLE(
- shadow, byname,
+ shadow, byname, NSLCD_ACTION_SHADOW_BYNAME,
char name[256];
char filter[4096];
READ_STRING(fp, name);
log_setrequest("shadow=\"%s\"", name);,
- NSLCD_ACTION_SHADOW_BYNAME,
mkfilter_shadow_byname(name, filter, sizeof(filter)),
write_shadow(fp, entry, name)
)
NSLCD_HANDLE(
- shadow, all,
+ shadow, all, NSLCD_ACTION_SHADOW_ALL,
const char *filter;
log_setrequest("shadow(all)");,
- NSLCD_ACTION_SHADOW_ALL,
(filter = shadow_filter, 0),
write_shadow(fp, entry, NULL)
)
--
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: r1877 - nss-pam-ldapd/nslcd,
Commits of the nss-pam-ldapd project