From 24e694796d9c7658292af1ea6261889d2c120b35 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 23 Dec 2007 00:35:06 +0100 Subject: Fix wbcAllocate[GU]id wbcRequestResponse() returns a wbcErr, not NSS_STATUS (This used to be commit 1bbdbdef991408af07afaba7bc0b4da55f06aed8) --- source3/nsswitch/libwbclient/wbc_idmap.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'source3/nsswitch/libwbclient/wbc_idmap.c') diff --git a/source3/nsswitch/libwbclient/wbc_idmap.c b/source3/nsswitch/libwbclient/wbc_idmap.c index 651c270a57..53f9678ee7 100644 --- a/source3/nsswitch/libwbclient/wbc_idmap.c +++ b/source3/nsswitch/libwbclient/wbc_idmap.c @@ -211,7 +211,7 @@ wbcErr wbcAllocateUid(uid_t *puid) { struct winbindd_request request; struct winbindd_response response; - NSS_STATUS result; + wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE; if (!puid) return WBC_ERR_INVALID_PARAM; @@ -223,16 +223,17 @@ wbcErr wbcAllocateUid(uid_t *puid) /* Make request */ - result = wbcRequestResponse(WINBINDD_ALLOCATE_UID, + wbc_status = wbcRequestResponse(WINBINDD_ALLOCATE_UID, &request, &response); - - if (result != NSS_STATUS_SUCCESS) - return WBC_ERR_UNKNOWN_FAILURE; + BAIL_ON_WBC_ERROR(wbc_status); /* Copy out result */ *puid = response.data.uid; - return WBC_ERR_SUCCESS; + wbc_status = WBC_ERR_SUCCESS; + + done: + return wbc_status; } /** @brief Obtain a new gid from Winbind @@ -246,7 +247,7 @@ wbcErr wbcAllocateGid(uid_t *pgid) { struct winbindd_request request; struct winbindd_response response; - NSS_STATUS result; + wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE; if (!pgid) return WBC_ERR_INVALID_PARAM; @@ -258,15 +259,16 @@ wbcErr wbcAllocateGid(uid_t *pgid) /* Make request */ - result = wbcRequestResponse(WINBINDD_ALLOCATE_GID, + wbc_status = wbcRequestResponse(WINBINDD_ALLOCATE_GID, &request, &response); - - if (result != NSS_STATUS_SUCCESS) - return WBC_ERR_UNKNOWN_FAILURE; + BAIL_ON_WBC_ERROR(wbc_status); /* Copy out result */ *pgid = response.data.gid; - return WBC_ERR_SUCCESS; + wbc_status = WBC_ERR_SUCCESS; + + done: + return wbc_status; } -- cgit