summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2007-12-23 00:35:06 +0100
committerVolker Lendecke <vl@samba.org>2007-12-23 00:49:32 +0100
commit24e694796d9c7658292af1ea6261889d2c120b35 (patch)
tree28960a50b04b71486e2781b4915fa24cd2587fff /source3/nsswitch
parent85065a4f364baa4a43cd3b4d1fb0c8e2a0152855 (diff)
downloadsamba-24e694796d9c7658292af1ea6261889d2c120b35.tar.gz
samba-24e694796d9c7658292af1ea6261889d2c120b35.tar.bz2
samba-24e694796d9c7658292af1ea6261889d2c120b35.zip
Fix wbcAllocate[GU]id
wbcRequestResponse() returns a wbcErr, not NSS_STATUS (This used to be commit 1bbdbdef991408af07afaba7bc0b4da55f06aed8)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/libwbclient/wbc_idmap.c26
1 files changed, 14 insertions, 12 deletions
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;
}