mirror of
https://github.com/samba-team/samba.git
synced 2025-03-27 22:50:26 +03:00
Another winbind test - fill in later.
(This used to be commit 99071c45d05231e5683b37823bcca90542f4e332)
This commit is contained in:
parent
e485a1a498
commit
a3f96dd229
38
testsuite/nsswitch/domusers.exp
Normal file
38
testsuite/nsswitch/domusers.exp
Normal file
@ -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
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user