components/samba/samba/patches/7167490-8952.patch
changeset 899 dc77409b0afa
parent 898 1b10a9e1d78c
child 900 63d3bf696d85
equal deleted inserted replaced
898:1b10a9e1d78c 899:dc77409b0afa
     1 From 7a64da3189a1e901aff66aa5e2e46e4a9c03750f Mon Sep 17 00:00:00 2001
       
     2 From: Ira Cooper <[email protected]>
       
     3 Date: Wed, 23 May 2012 21:39:03 -0400
       
     4 Subject: [PATCH] s3-passdb: Fix negative SID->uid/gid cache handling. (bug #8952)
       
     5 
       
     6 -1 uid/gid signals a non existent uid/gid.
       
     7 
       
     8 Signed-off-by: Stefan Metzmacher <[email protected]>
       
     9 ---
       
    10  source3/passdb/lookup_sid.c |   17 +++++++++++++++++
       
    11  1 files changed, 17 insertions(+), 0 deletions(-)
       
    12 
       
    13 diff --git a/source3/passdb/lookup_sid.c b/source3/passdb/lookup_sid.c
       
    14 index 5cf391f..2afa86e 100644
       
    15 --- a/source3/passdb/lookup_sid.c
       
    16 +++ b/source3/passdb/lookup_sid.c
       
    17 @@ -1490,7 +1490,24 @@ bool sids_to_unix_ids(const struct dom_sid *sids, uint32_t num_sids,
       
    18  			continue;
       
    19  		}
       
    20  	}
       
    21 +
       
    22  done:
       
    23 +	for (i=0; i<num_sids; i++) {
       
    24 +		switch(ids[i].type) {
       
    25 +		case WBC_ID_TYPE_GID:
       
    26 +			if (ids[i].id.gid == (gid_t)-1) {
       
    27 +				ids[i].type = WBC_ID_TYPE_NOT_SPECIFIED;
       
    28 +			}
       
    29 +			break;
       
    30 +		case WBC_ID_TYPE_UID:
       
    31 +			if (ids[i].id.uid == (uid_t)-1) {
       
    32 +				ids[i].type = WBC_ID_TYPE_NOT_SPECIFIED;
       
    33 +			}
       
    34 +			break;
       
    35 +		case WBC_ID_TYPE_NOT_SPECIFIED:
       
    36 +			break;
       
    37 +		}
       
    38 +	}
       
    39  	ret = true;
       
    40  fail:
       
    41  	TALLOC_FREE(wbc_ids);
       
    42 -- 
       
    43 1.7.4.1
       
    44