trying to get HEAD building again. If you want the code
[gd/samba-autobuild/.git] / source3 / lib / util_sid.c
index 9dc0c8ca18dd16ad45426f8b6159d1f565687c22..00f14d7d26b059c12504e0f2c52a30e0d0e15967 100644 (file)
@@ -391,6 +391,9 @@ BOOL sid_peek_check_rid(const DOM_SID *exp_dom_sid, const DOM_SID *sid, uint32 *
        if (!exp_dom_sid || !sid || !rid)
                return False;
                        
+       if (sid->num_auths != (exp_dom_sid->num_auths+1)) {
+               return False;
+       }
 
        if (sid_compare_domain(exp_dom_sid, sid)!=0){
                *rid=(-1);
@@ -642,8 +645,9 @@ DOM_SID *sid_dup_talloc(TALLOC_CTX *ctx, DOM_SID *src)
        if(!src)
                return NULL;
        
-       if((dst = talloc_zero(ctx, sizeof(DOM_SID))) != NULL)
+       if((dst = talloc_zero(ctx, sizeof(DOM_SID))) != NULL) {
                sid_copy( dst, src);
+       }
        
        return dst;
 }