From 12c5adb49ae103c2bb706d92a4b2fd29b7a91f70 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Fri, 16 Feb 2024 16:38:11 +0100 Subject: [PATCH] libwbclient: prepare wbcCtxLookupName() for dealing with WBC_SID_NAME_UNKNOWN This changes the wbcErr from WBC_ERR_DOMAIN_NOT_FOUND to WBC_ERR_NOT_MAPPED. Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher --- nsswitch/libwbclient/wbc_sid.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nsswitch/libwbclient/wbc_sid.c b/nsswitch/libwbclient/wbc_sid.c index fd825102950..747addb1f5b 100644 --- a/nsswitch/libwbclient/wbc_sid.c +++ b/nsswitch/libwbclient/wbc_sid.c @@ -218,11 +218,14 @@ wbcErr wbcCtxLookupName(struct wbcContext *ctx, &response); BAIL_ON_WBC_ERROR(wbc_status); + *name_type = (enum wbcSidType)response.data.sid.type; + if (*name_type == WBC_SID_NAME_UNKNOWN) { + return WBC_ERR_NOT_MAPPED; + } + wbc_status = wbcStringToSid(response.data.sid.sid, sid); BAIL_ON_WBC_ERROR(wbc_status); - *name_type = (enum wbcSidType)response.data.sid.type; - wbc_status = WBC_ERR_SUCCESS; done: