diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2007-12-25 17:02:20 +0000 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2007-12-25 17:02:20 +0000 |
commit | 35c147a6fc15b787d88be6f0fb54bc9650d52731 (patch) | |
tree | 89baa5dbff24c6357d400ae3b57fd4975706703d | |
parent | c5527db3081076cb41e3b1e7e184c32d2e9d2c93 (diff) |
remove NSLCD_RESULT_UNAVAIL because it's not needed anymore (the connection is broken when an error occurs) and rename NSLCD_RESULT_NOTFOUND into NSLCD_RESULT_END to better match its meaning
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@530 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r-- | nslcd.h | 16 | ||||
-rw-r--r-- | nslcd/common.h | 2 | ||||
-rw-r--r-- | nss/common.c | 3 | ||||
-rw-r--r-- | nss/group.c | 2 |
4 files changed, 10 insertions, 13 deletions
@@ -37,14 +37,15 @@ int32 NSLCD_VERSION int32 NSLCD_ACTION_* (the original request type) [result(s)] + NSLCD_RESULT_END A result looks like: - int32 NSLCD_RESULT_* (response code) + int32 NSLCD_RESULT_SUCCESS [result value(s)] If a response would return multiple values (e.g. for NSLCD_ACTION_*_ALL - functions) each return value will be preceded by a NSLCD_RESULT_* value. - The last value will be marked by a result value other than - NSLCD_RESULT_SUCCESS. Note that the server may including a trailing - NSLCD_RESULT_NOTFOUND after all the results. + functions) each return value will be preceded by a NSLCD_RESULT_SUCCESS + value. After the last returned result the server sends + NSLCD_RESULT_END. If some error occurs the server terminates the + connection to signal an error condition (breaking the protocol). These are the available data types: INT32 - 32-bit integer value @@ -197,10 +198,7 @@ #define NSLCD_ACTION_SHADOW_ALL 2005 /* Request result codes. */ -#define NSLCD_RESULT_NOTFOUND 3 /* key was not found */ +#define NSLCD_RESULT_END 3 /* key was not found */ #define NSLCD_RESULT_SUCCESS 0 /* everything ok */ -/* We need this for now, get rid of it later. */ -#define NSLCD_RESULT_UNAVAIL 2 /* sevice unavailable */ - #endif /* not _NSLCD_H */ diff --git a/nslcd/common.h b/nslcd/common.h index 69b7b2f..4a8aa8b 100644 --- a/nslcd/common.h +++ b/nslcd/common.h @@ -141,7 +141,7 @@ int nslcd_shadow_all(TFILE *fp,MYLDAP_SESSION *session); writefn; \ } \ /* write the final result code */ \ - WRITE_INT32(fp,NSLCD_RESULT_NOTFOUND); \ + WRITE_INT32(fp,NSLCD_RESULT_END); \ return 0; \ } diff --git a/nss/common.c b/nss/common.c index f014cb8..958f09b 100644 --- a/nss/common.c +++ b/nss/common.c @@ -43,8 +43,7 @@ enum nss_status nslcd2nss(int32_t code) { switch (code) { - case NSLCD_RESULT_UNAVAIL: return NSS_STATUS_UNAVAIL; - case NSLCD_RESULT_NOTFOUND: return NSS_STATUS_NOTFOUND; + case NSLCD_RESULT_END: return NSS_STATUS_NOTFOUND; case NSLCD_RESULT_SUCCESS: return NSS_STATUS_SUCCESS; default: return NSS_STATUS_UNAVAIL; } diff --git a/nss/group.c b/nss/group.c index 6745074..75f3bae 100644 --- a/nss/group.c +++ b/nss/group.c @@ -77,7 +77,7 @@ static enum nss_status read_gids( READ_TYPE(fp,res,int32_t); } /* return the proper status code */ - return (res==(int32_t)NSLCD_RESULT_NOTFOUND)?NSS_STATUS_SUCCESS:nslcd2nss(res); + return (res==(int32_t)NSLCD_RESULT_END)?NSS_STATUS_SUCCESS:nslcd2nss(res); } #endif /* REENABLE_WHEN_WORKING */ |