From 76a1c5a1625f3593de0feac47741a3405b4c9275 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Mon, 9 Oct 2017 13:25:21 +0200 Subject: [PATCH] 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 Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Tue Oct 10 02:57:40 CEST 2017 on sn-devel-144 --- nsswitch/tests/test_idmap_rfc2307.sh | 2 +- nsswitch/wbinfo.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/nsswitch/tests/test_idmap_rfc2307.sh b/nsswitch/tests/test_idmap_rfc2307.sh index 35daa39a592..7dc697d67a2 100755 --- a/nsswitch/tests/test_idmap_rfc2307.sh +++ b/nsswitch/tests/test_idmap_rfc2307.sh @@ -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} || diff --git a/nsswitch/wbinfo.c b/nsswitch/wbinfo.c index 67a97b5bbc0..9cd299a2174 100644 --- a/nsswitch/wbinfo.c +++ b/nsswitch/wbinfo.c @@ -1105,6 +1105,12 @@ static bool wbinfo_xids_to_sids(const char *arg) for (i=0; i