Ignore:
Timestamp:
Aug 20, 2008, 9:10:33 AM (17 years ago)
Author:
Paul Smedley
Message:

Update trunk to v3.2.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/samba/source/auth/auth_util.c

    r138 r149  
    2626#undef DBGC_CLASS
    2727#define DBGC_CLASS DBGC_AUTH
     28
     29/****************************************************************************
     30 Ensure primary group SID is always at position 0 in a
     31 auth_serversupplied_info struct.
     32****************************************************************************/
     33
     34static void sort_sid_array_for_smbd(auth_serversupplied_info *result,
     35                                const DOM_SID *pgroup_sid)
     36{
     37        unsigned int i;
     38
     39        if (!result->sids) {
     40                return;
     41        }
     42
     43        if (sid_compare(&result->sids[0], pgroup_sid)==0) {
     44                return;
     45        }
     46
     47        for (i = 1; i < result->num_sids; i++) {
     48                if (sid_compare(pgroup_sid,
     49                                &result->sids[i]) == 0) {
     50                        sid_copy(&result->sids[i], &result->sids[0]);
     51                        sid_copy(&result->sids[0], pgroup_sid);
     52                        return;
     53                }
     54        }
     55}
    2856
    2957/****************************************************************************
     
    16801708        }
    16811709
     1710        /* Ensure the primary group sid is at position 0. */
     1711        sort_sid_array_for_smbd(result, &group_sid);
     1712
    16821713        result->login_server = talloc_strdup(result,
    16831714                                             info3->base.logon_server.string);
     
    19151946                memcpy(&result->sids[i], &info->sids[i+2].sid, sizeof(result->sids[i]));
    19161947        }
     1948
     1949        /* Ensure the primary group sid is at position 0. */
     1950        sort_sid_array_for_smbd(result, &group_sid);
    19171951
    19181952        /* ensure we are never given NULL session keys */
Note: See TracChangeset for help on using the changeset viewer.