X-Git-Url: https://vcs.maemo.org/git/?p=samba;a=blobdiff_plain;f=testsuite%2Fnsswitch%2Fdomusers.exp;fp=testsuite%2Fnsswitch%2Fdomusers.exp;h=3b291ab398b3a49d2d099fd93ad1f405b3444ea3;hp=0000000000000000000000000000000000000000;hb=6bca4ca307d55b6dc888e56cee47aebcddbce786;hpb=7fd70fa738b636089bcc6c961aa3eaa02f20dda2 diff --git a/testsuite/nsswitch/domusers.exp b/testsuite/nsswitch/domusers.exp new file mode 100644 index 0000000..3b291ab --- /dev/null +++ b/testsuite/nsswitch/domusers.exp @@ -0,0 +1,38 @@ +# +# @(#) Test that all users are members of the Domain Users group. +# +# Note that this isn't necessarily true all the time but you have to +# explicitly move people out of that group so it should be OK for te +# + +load_lib util-defs.exp +load_lib $srcdir/lib/nsswitch-config.exp + +# Get list of users and stick usernames in a hash + +set user_list [util_start "getent" "passwd" ""] + +foreach { user } [split $user_list "\n"] { + set user_elts [split $user ":"] + set users([lindex $user_elts 0]) 1 +} + +# Get list of groups + +set group_list [util_start "getent" "group" ""] + +foreach { group } [split $group_list "\n"] { + set group_elts [split $group ":"] + + # Look for domain users group + + if { ![regexp "Domain Users" [lindex $group_elts 0]] } { + continue + } + + # Check each member of group was found in getent passwd + + foreach { mem } [split [lindex $group_elts 3] ","] { + set mems($mem) 1 + } +}