2 # @
(#
) Test reverse lookup of user ids from getent match getpwuid
() output
9 set output
[target_compile
"$srcdir/$subdir/getpwuid.c" \
10 "$srcdir/$subdir/getpwuid" executable {additional_flags="-g"}]
13 perror
"compile getpwuid"
18 #
Get list of uids using getent
20 set output
[util_start
"getent" "passwd" ""]
25 foreach
{line
} [split $output
"\n"] {
29 set pwd_entry
[split $line
":"]
30 set user
[lindex $pwd_entry
0]
32 if {[regexp
{^
[^
/]+/} $user
]} {
36 # Only lookup winbindd users
38 set uid
[lindex $pwd_entry
2]
39 set gid
[lindex $pwd_entry
3]
41 # Test lookup of uid succeeds
43 set output
[util_start
"$srcdir/$subdir/getpwuid" "$uid" ""]
47 set test_desc
"getpwuid $uid ($user)"
49 if {[regexp
"PASS:" $output]} {
58 perror
"No domain users returned from getent"