From ba6e3033a966572a9b44eaae8d0284ca33204583 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Sat, 16 May 2009 07:04:00 +0000 Subject: merge r885 from trunk git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@886 ef36b2f9-881f-0410-afb5-c4e39611909c --- nss/common.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'nss/common.h') 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); \ -- cgit v1.2.3