s3-auth use security_token_has_sid() from the common code
authorAndrew Bartlett <abartlet@samba.org>
Fri, 17 Sep 2010 04:55:56 +0000 (14:55 +1000)
committerAndrew Tridgell <tridge@samba.org>
Thu, 14 Oct 2010 02:35:04 +0000 (02:35 +0000)
The wrapper call is left here to avoid changing semantics for
the NULL parameter case.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
source3/auth/token_util.c

index 826801ce504acc28346bbafcba21bfacfb1045ac..17078d1e96e1ec71213f03575c47f6ab7a170f71 100644 (file)
 
 bool nt_token_check_sid ( const struct dom_sid *sid, const struct security_token *token )
 {
-       int i;
-
        if ( !sid || !token )
                return False;
 
-       for ( i=0; i<token->num_sids; i++ ) {
-               if ( dom_sid_equal( sid, &token->sids[i] ) )
-                       return True;
-       }
-
-       return False;
+       return security_token_has_sid(token, sid);
 }
 
 bool nt_token_check_domain_rid( struct security_token *token, uint32 rid )
@@ -983,7 +976,7 @@ bool user_in_group_sid(const char *username, const struct dom_sid *group_sid)
                return False;
        }
 
-       result = nt_token_check_sid(group_sid, token);
+       result = security_token_has_sid(token, group_sid);
 
        TALLOC_FREE(mem_ctx);
        return result;