diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 17:47:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 17:47:29 +0000 |
commit | 4f5791ebd03eaec1c7da0865a383175b05102712 (patch) | |
tree | 8ce7b00f7a76baa386372422adebbe64510812d4 /testsuite/nsswitch/getgrgid.exp | |
parent | Initial commit. (diff) | |
download | samba-4f5791ebd03eaec1c7da0865a383175b05102712.tar.xz samba-4f5791ebd03eaec1c7da0865a383175b05102712.zip |
Adding upstream version 2:4.17.12+dfsg.upstream/2%4.17.12+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testsuite/nsswitch/getgrgid.exp')
-rw-r--r-- | testsuite/nsswitch/getgrgid.exp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/testsuite/nsswitch/getgrgid.exp b/testsuite/nsswitch/getgrgid.exp new file mode 100644 index 0000000..c53749f --- /dev/null +++ b/testsuite/nsswitch/getgrgid.exp @@ -0,0 +1,50 @@ +# +# @(#) Test reverse lookup of group ids from getent match getgrgid() output +# + +load_lib util-defs.exp +load_lib compile.exp + +# Compile getgruid.c + +simple_compile "getgrgid" + +# Get list of gids using getent + +set output [util_start "getent" "group" ""] +set got_entries 0 + +verbose $output + +foreach {line} [split $output "\n"] { + + # Process user + + set grp_entry [split $line ":"] + set group [lindex $grp_entry 0] + + if {[regexp {^[^/]+/} $group]} { + + set got_entries 1 + + # Only lookup winbindd users + + set gid [lindex $grp_entry 2] + + # Test lookup of gid succeeds + + set output [util_start "$srcdir/$subdir/getgrgid" "$gid" ""] + verbose $output + + if {[regexp "PASS:" $output]} { + pass "getgrgid $gid ($group)" + } else { + fail "getgrgid $gid ($group)" + } + } + +} + +if {!$got_entries} { + perror "No domain groups returned from getent" +} |