Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/nss/common.h
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2009-05-16 09:04:00 +0200
committerArthur de Jong <arthur@arthurdejong.org>2009-05-16 09:04:00 +0200
commitba6e3033a966572a9b44eaae8d0284ca33204583 (patch)
tree5d806a19872de8666f428c320e2b2b5c6c0a2120 /nss/common.h
parent97159a4685aee67fdcdee8dec32ebba90aa9af35 (diff)
merge r885 from trunk
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@886 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nss/common.h')
-rw-r--r--nss/common.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/nss/common.h b/nss/common.h
index 3d2de88..01fce97 100644
--- a/nss/common.h
+++ b/nss/common.h
@@ -108,6 +108,17 @@ TFILE *nslcd_client_open(void)
bodies. These functions have very common code so this can
easily be reused. */
+#ifndef SKIP_BUFCHECK
+#define NSS_BUFCHECK \
+ if ((buffer==NULL)||(buflen<=0)) \
+ { \
+ *errnop=EINVAL; \
+ return NSS_STATUS_UNAVAIL; \
+ }
+#else /* SKIP_BUFCHECK */
+#define NSS_BUFCHECK /* empty */
+#endif /* SKIP_BUFCHECK */
+
/* This is a generic get..by..() generation macro. The action
parameter is the NSLCD_ACTION_.. action, the param is the
operation for writing the parameter and readfn is the function
@@ -121,11 +132,7 @@ TFILE *nslcd_client_open(void)
int32_t tmpint32; \
enum nss_status retv; \
/* check that we have a valid buffer */ \
- if ((buffer==NULL)||(buflen<=0)) \
- { \
- *errnop=EINVAL; \
- return NSS_STATUS_UNAVAIL; \
- } \
+ NSS_BUFCHECK \
/* open socket and write request */ \
OPEN_SOCK(fp); \
WRITE_REQUEST(fp,action); \