1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

idmap_nss: Increase debug on failures

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
This commit is contained in:
Samuel Cabrero 2023-11-29 12:55:13 +01:00
parent de2f59c61a
commit c8e4777a92

View File

@ -62,24 +62,36 @@ static NTSTATUS idmap_nss_unixids_to_sids(struct idmap_domain *dom, struct id_ma
switch (ids[i]->xid.type) {
case ID_TYPE_UID:
errno = 0;
pw = getpwuid((uid_t)ids[i]->xid.id);
if (!pw) {
DBG_DEBUG("getpwuid(%lu) failed: %s\n",
(unsigned long)ids[i]->xid.id,
errno != 0
? strerror(errno)
: "not found");
ids[i]->status = ID_UNMAPPED;
continue;
}
name = pw->pw_name;
break;
case ID_TYPE_GID:
errno = 0;
gr = getgrgid((gid_t)ids[i]->xid.id);
if (!gr) {
DBG_DEBUG("getgrgid(%lu) failed: %s\n",
(unsigned long)ids[i]->xid.id,
errno != 0
? strerror(errno)
: "not found");
ids[i]->status = ID_UNMAPPED;
continue;
}
name = gr->gr_name;
break;
default: /* ?? */
DBG_WARNING("Unexpected xid type %d\n",
ids[i]->xid.type);
ids[i]->status = ID_UNKNOWN;
continue;
}