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/alias.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/alias.c')
-rw-r--r-- | nslcd/alias.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/nslcd/alias.c b/nslcd/alias.c index 49b0fd3..9d7f74a 100644 --- a/nslcd/alias.c +++ b/nslcd/alias.c @@ -98,6 +98,19 @@ static void alias_init(void) alias_attrs[2]=NULL; } +/* macros for expanding the NSLCD_ALIAS macro */ +#define NSLCD_STRING(field) WRITE_STRING(fp,field) +#define NSLCD_STRINGLIST(field) WRITE_STRINGLIST_NUM(fp,field,result->alias_members_len) +#define ALIAS_NAME result->alias_name +#define ALIAS_RCPTS result->alias_members + +static int write_aliasent(TFILE *fp,struct aliasent *result) +{ + int32_t tmpint32,tmp2int32; + NSLCD_ALIAS; + return 0; +} + static enum nss_status _nss_ldap_parse_alias( MYLDAP_SESSION *session,LDAPMessage *e,struct ldap_state UNUSED(*state),void *result, char *buffer,size_t buflen) @@ -118,15 +131,9 @@ static enum nss_status _nss_ldap_parse_alias( return stat; } -/* macros for expanding the NSLCD_ALIAS macro */ -#define NSLCD_STRING(field) WRITE_STRING(fp,field) -#define NSLCD_STRINGLIST(field) WRITE_STRINGLIST_NUM(fp,field,result.alias_members_len) -#define ALIAS_NAME result.alias_name -#define ALIAS_RCPTS result.alias_members - int nslcd_alias_byname(TFILE *fp,MYLDAP_SESSION *session) { - int32_t tmpint32,tmp2int32; + int32_t tmpint32; char name[256]; char filter[1024]; /* these are here for now until we rewrite the LDAP code */ @@ -150,9 +157,8 @@ int nslcd_alias_byname(TFILE *fp,MYLDAP_SESSION *session) /* write the response */ WRITE_INT32(fp,retv); if (retv==NSLCD_RESULT_SUCCESS) - { - NSLCD_ALIAS; - } + if (write_aliasent(fp,&result)) + return -1; WRITE_FLUSH(fp); /* we're done */ return 0; @@ -160,7 +166,7 @@ int nslcd_alias_byname(TFILE *fp,MYLDAP_SESSION *session) int nslcd_alias_all(TFILE *fp,MYLDAP_SESSION *session) { - int32_t tmpint32,tmp2int32; + int32_t tmpint32; struct ent_context context; /* these are here for now until we rewrite the LDAP code */ struct aliasent result; @@ -182,7 +188,8 @@ int nslcd_alias_all(TFILE *fp,MYLDAP_SESSION *session) { /* write the result */ WRITE_INT32(fp,retv); - NSLCD_ALIAS; + if (write_aliasent(fp,&result)) + return -1; } /* write the final result code */ WRITE_INT32(fp,retv); |