Ignore:
Timestamp:
Nov 14, 2012, 12:59:34 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to 3.6.0

Location:
vendor/current/source4/ntvfs/unixuid
Files:
1 added
2 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source4/ntvfs/unixuid/vfs_unixuid.c

    r414 r740  
    3030#include <tevent.h>
    3131
     32#if defined(UID_WRAPPER)
     33#if !defined(UID_WRAPPER_REPLACE) && !defined(UID_WRAPPER_NOT_REPLACE)
     34#define UID_WRAPPER_REPLACE
     35#include "../uid_wrapper/uid_wrapper.h"
     36#endif
     37#else
     38#define uwrap_enabled() 0
     39#endif
     40
     41
    3242struct unixuid_private {
    3343        struct wbc_context *wbc_ctx;
     
    4151        uid_t uid;
    4252        gid_t gid;
    43         uint_t ngroups;
     53        unsigned int ngroups;
    4454        gid_t *groups;
    4555};
     
    163173        int i;
    164174        NTSTATUS status;
    165         struct id_mapping *ids;
     175        struct id_map *ids;
    166176        struct composite_context *ctx;
    167177        *sec = talloc(req, struct unix_sec_ctx);
     
    172182        }
    173183
    174         ids = talloc_array(req, struct id_mapping, token->num_sids);
     184        ids = talloc_array(req, struct id_map, token->num_sids);
    175185        NT_STATUS_HAVE_NO_MEMORY(ids);
    176 
    177         ids[0].unixid = NULL;
    178         ids[0].sid = token->user_sid;
    179         ids[0].status = NT_STATUS_NONE_MAPPED;
    180 
    181         ids[1].unixid = NULL;
    182         ids[1].sid = token->group_sid;
    183         ids[1].status = NT_STATUS_NONE_MAPPED;
    184186
    185187        (*sec)->ngroups = token->num_sids - 2;
     
    187189        NT_STATUS_HAVE_NO_MEMORY((*sec)->groups);
    188190
    189         for (i=0;i<(*sec)->ngroups;i++) {
    190                 ids[i+2].unixid = NULL;
    191                 ids[i+2].sid = token->sids[i+2];
    192                 ids[i+2].status = NT_STATUS_NONE_MAPPED;
     191        for (i=0;i<token->num_sids;i++) {
     192                ZERO_STRUCT(ids[i].xid);
     193                ids[i].sid = &token->sids[i];
     194                ids[i].status = ID_UNKNOWN;
    193195        }
    194196
     
    199201        NT_STATUS_NOT_OK_RETURN(status);
    200202
    201         if (ids[0].unixid->type == ID_TYPE_BOTH ||
    202             ids[0].unixid->type == ID_TYPE_UID) {
    203                 (*sec)->uid = ids[0].unixid->id;
     203        if (ids[0].xid.type == ID_TYPE_BOTH ||
     204            ids[0].xid.type == ID_TYPE_UID) {
     205                (*sec)->uid = ids[0].xid.id;
    204206        } else {
    205207                return NT_STATUS_INVALID_SID;
    206208        }
    207209
    208         if (ids[1].unixid->type == ID_TYPE_BOTH ||
    209             ids[1].unixid->type == ID_TYPE_GID) {
    210                 (*sec)->gid = ids[1].unixid->id;
     210        if (ids[1].xid.type == ID_TYPE_BOTH ||
     211            ids[1].xid.type == ID_TYPE_GID) {
     212                (*sec)->gid = ids[1].xid.id;
    211213        } else {
    212214                return NT_STATUS_INVALID_SID;
     
    214216
    215217        for (i=0;i<(*sec)->ngroups;i++) {
    216                 if (ids[i+2].unixid->type == ID_TYPE_BOTH ||
    217                     ids[i+2].unixid->type == ID_TYPE_GID) {
    218                         (*sec)->groups[i] = ids[i+2].unixid->id;
     218                if (ids[i+2].xid.type == ID_TYPE_BOTH ||
     219                    ids[i+2].xid.type == ID_TYPE_GID) {
     220                        (*sec)->groups[i] = ids[i+2].xid.id;
    219221                } else {
    220222                        return NT_STATUS_INVALID_SID;
     
    236238        NTSTATUS status;
    237239
    238         if (req->session_info == NULL) {
     240        /* If we are asked to set up, but have not had a successful
     241         * session setup or tree connect, then these may not be filled
     242         * in.  ACCESS_DENIED is the right error code here */
     243        if (req->session_info == NULL || priv == NULL) {
    239244                return NT_STATUS_ACCESS_DENIED;
    240245        }
Note: See TracChangeset for help on using the changeset viewer.