diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2007-09-14 20:50:25 +0000 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2007-09-14 20:50:25 +0000 |
commit | 4a6c9a3248ca675cf8b9d5610a64fd2c73eedc34 (patch) | |
tree | 85f82bb182d9a814cd718d99305a4ebe6dc891bd /nslcd/ether.c | |
parent | f645df69737893f7846e70f27d0b9ab41165078e (diff) |
make use of write_*ent() functions consistent
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@395 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nslcd/ether.c')
-rw-r--r-- | nslcd/ether.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/nslcd/ether.c b/nslcd/ether.c index 7aee6a7..eb6c144 100644 --- a/nslcd/ether.c +++ b/nslcd/ether.c @@ -141,6 +141,19 @@ static void ether_init(void) ether_attrs[2]=NULL; } +/* macros for expanding the NSLCD_ETHER macro */ +#define NSLCD_STRING(field) WRITE_STRING(fp,field) +#define NSLCD_TYPE(field,type) WRITE_TYPE(fp,field,type) +#define ETHER_NAME result->e_name +#define ETHER_ADDR result->e_addr + +static int write_ether(TFILE *fp,struct ether *result) +{ + int32_t tmpint32; + NSLCD_ETHER; + return 0; +} + static enum nss_status _nss_ldap_parse_ether( MYLDAP_SESSION *session,LDAPMessage *e, struct ldap_state UNUSED(*state),void *result,char *buffer, @@ -160,12 +173,6 @@ static enum nss_status _nss_ldap_parse_ether( return NSS_STATUS_SUCCESS; } -/* macros for expanding the NSLCD_ETHER macro */ -#define NSLCD_STRING(field) WRITE_STRING(fp,field) -#define NSLCD_TYPE(field,type) WRITE_TYPE(fp,field,type) -#define ETHER_NAME result.e_name -#define ETHER_ADDR result.e_addr - int nslcd_ether_byname(TFILE *fp,MYLDAP_SESSION *session) { int32_t tmpint32; @@ -192,9 +199,8 @@ int nslcd_ether_byname(TFILE *fp,MYLDAP_SESSION *session) /* write the response */ WRITE_INT32(fp,retv); if (retv==NSLCD_RESULT_SUCCESS) - { - NSLCD_ETHER; - } + if (write_ether(fp,&result)) + return -1; WRITE_FLUSH(fp); /* we're done */ return 0; @@ -226,9 +232,8 @@ int nslcd_ether_byether(TFILE *fp,MYLDAP_SESSION *session) /* write the response */ WRITE_INT32(fp,retv); if (retv==NSLCD_RESULT_SUCCESS) - { - NSLCD_ETHER; - } + if (write_ether(fp,&result)) + return -1; WRITE_FLUSH(fp); /* we're done */ return 0; @@ -258,7 +263,8 @@ int nslcd_ether_all(TFILE *fp,MYLDAP_SESSION *session) { /* write the result */ WRITE_INT32(fp,retv); - NSLCD_ETHER; + if (write_ether(fp,&result)) + return -1; } /* write the final result code */ WRITE_INT32(fp,retv); |