1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-29 02:50:28 +03:00

wbinfo: return "NOT MAPPED" instead of "S-0-0" for unmapped id-to-sid

Currently wbinfo --unix-ids-to-sids prints "S-0-0" for failed
mappings. Let it print "NOT MAPPED" instead.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Oct 10 02:57:40 CEST 2017 on sn-devel-144
This commit is contained in:
Ralph Boehme 2017-10-09 13:25:21 +02:00 committed by Jeremy Allison
parent 0666093cb0
commit 76a1c5a162
2 changed files with 7 additions and 1 deletions

View File

@ -179,7 +179,7 @@ while [ ${i} -lt ${NUMGROUPS} ] ; do
GIDS="$GIDS g$(expr ${i} + ${GID_START})"
i=$(expr "$i" + 1)
done
NUM_VALID_SIDS=$($wbinfo --unix-ids-to-sids="$GIDS" | grep -v ^S-0-0 | wc -l)
NUM_VALID_SIDS=$($wbinfo --unix-ids-to-sids="$GIDS" | grep -v ^"NOT MAPPED" | wc -l)
testit "Count number of valid sids found" \
test ${NUM_VALID_SIDS} = ${NUMGROUPS} ||

View File

@ -1105,6 +1105,12 @@ static bool wbinfo_xids_to_sids(const char *arg)
for (i=0; i<num_xids; i++) {
char str[WBC_SID_STRING_BUFLEN];
struct wbcDomainSid null_sid = { 0 };
if (memcmp(&null_sid, &sids[i], sizeof(struct wbcDomainSid)) == 0) {
d_printf("NOT MAPPED\n");
continue;
}
wbcSidToStringBuf(&sids[i], str, sizeof(str));
d_printf("%s\n", str);
}