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/groupmem_dom.exp | |
parent | Initial commit. (diff) | |
download | samba-upstream.tar.xz samba-upstream.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/groupmem_dom.exp')
-rw-r--r-- | testsuite/nsswitch/groupmem_dom.exp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/testsuite/nsswitch/groupmem_dom.exp b/testsuite/nsswitch/groupmem_dom.exp new file mode 100644 index 0000000..3ba34bb --- /dev/null +++ b/testsuite/nsswitch/groupmem_dom.exp @@ -0,0 +1,33 @@ +# +# @(#) Test whether members of domain groups all have domain names +# + +load_lib util-defs.exp + +set group_list [split [util_start "getent group" ""] "\n"] +set failed 0 + +foreach { group } $group_list { + set group_entry [split $group ":"] + + set group_name [lindex $group_entry 0] + set group_members [split [lindex $group_entry 3] ","] + + if { [regexp {^[^/]+/} $group_name] } { + + verbose "group $group_name has members $group_members" + + foreach { user } $group_members { + if { ![regexp {^[^/]+/} $user] } { + fail "group $group has non-domain user $user" + set failed 1 + } + } + } else { + verbose "ignoring non-domain group $group_name" + } +} + +if { !$failed } { + pass "domain groups contain only domain members" +} |