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
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} ||
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);
}