| Last change
 on this file since 706 was             414, checked in by Herwig Bauernfeind, 16 years ago | 
        
          | 
Samba 3.5.0: Initial import
 | 
        
          | File size:
            935 bytes | 
      
      
| Line |  | 
|---|
| 1 | # | 
|---|
| 2 | # @(#) Test reverse lookup of group ids from getent match getgrgid() output | 
|---|
| 3 | # | 
|---|
| 4 |  | 
|---|
| 5 | load_lib util-defs.exp | 
|---|
| 6 | load_lib compile.exp | 
|---|
| 7 |  | 
|---|
| 8 | # Compile getgruid.c | 
|---|
| 9 |  | 
|---|
| 10 | simple_compile "getgrgid" | 
|---|
| 11 |  | 
|---|
| 12 | # Get list of gids using getent | 
|---|
| 13 |  | 
|---|
| 14 | set output [util_start "getent" "group" ""] | 
|---|
| 15 | set got_entries 0 | 
|---|
| 16 |  | 
|---|
| 17 | verbose $output | 
|---|
| 18 |  | 
|---|
| 19 | foreach {line} [split $output "\n"] { | 
|---|
| 20 |  | 
|---|
| 21 | # Process user | 
|---|
| 22 |  | 
|---|
| 23 | set grp_entry [split $line ":"] | 
|---|
| 24 | set group [lindex $grp_entry 0] | 
|---|
| 25 |  | 
|---|
| 26 | if {[regexp {^[^/]+/} $group]} { | 
|---|
| 27 |  | 
|---|
| 28 | set got_entries 1 | 
|---|
| 29 |  | 
|---|
| 30 | # Only lookup winbindd users | 
|---|
| 31 |  | 
|---|
| 32 | set gid [lindex $grp_entry 2] | 
|---|
| 33 |  | 
|---|
| 34 | # Test lookup of gid succeeds | 
|---|
| 35 |  | 
|---|
| 36 | set output [util_start "$srcdir/$subdir/getgrgid" "$gid" ""] | 
|---|
| 37 | verbose $output | 
|---|
| 38 |  | 
|---|
| 39 | if {[regexp "PASS:" $output]} { | 
|---|
| 40 | pass "getgrgid $gid ($group)" | 
|---|
| 41 | } else { | 
|---|
| 42 | fail "getgrgid $gid ($group)" | 
|---|
| 43 | } | 
|---|
| 44 | } | 
|---|
| 45 |  | 
|---|
| 46 | } | 
|---|
| 47 |  | 
|---|
| 48 | if {!$got_entries} { | 
|---|
| 49 | perror "No domain groups returned from getent" | 
|---|
| 50 | } | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.