Ignore:
Timestamp:
Nov 27, 2012, 4:43:17 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.0

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source3/smbd/sec_ctx.c

    r414 r745  
    33   uid/user handling
    44   Copyright (C) Tim Potter 2000
    5    
     5
    66   This program is free software; you can redistribute it and/or modify
    77   it under the terms of the GNU General Public License as published by
    88   the Free Software Foundation; either version 3 of the License, or
    99   (at your option) any later version.
    10    
     10
    1111   This program is distributed in the hope that it will be useful,
    1212   but WITHOUT ANY WARRANTY; without even the implied warranty of
    1313   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1414   GNU General Public License for more details.
    15    
     15
    1616   You should have received a copy of the GNU General Public License
    1717   along with this program.  If not, see <http://www.gnu.org/licenses/>.
     
    1919
    2020#include "includes.h"
     21#include "smbd/smbd.h"
    2122#include "smbd/globals.h"
     23#include "libcli/security/security_token.h"
     24#include "auth.h"
     25#include "smbprofile.h"
    2226
    2327extern struct current_user current_user;
     
    2731****************************************************************************/
    2832
    29 bool unix_token_equal(const UNIX_USER_TOKEN *t1, const UNIX_USER_TOKEN *t2)
     33bool unix_token_equal(const struct security_unix_token *t1, const struct security_unix_token *t2)
    3034{
    3135        if (t1->uid != t2->uid || t1->gid != t2->gid ||
     
    8185                }
    8286        }
    83  
     87
    8488        /* Set effective group id */
    8589
     
    132136****************************************************************************/
    133137
    134 static int get_current_groups(gid_t gid, size_t *p_ngroups, gid_t **p_groups)
     138static int get_current_groups(gid_t gid, uint32_t *p_ngroups, gid_t **p_groups)
    135139{
    136140        int i;
     
    168172        (*p_groups) = groups;
    169173
    170         DEBUG( 3, ( "get_current_groups: user is in %u groups: ", ngroups));
     174        DEBUG( 4, ( "get_current_groups: user is in %u groups: ", ngroups));
    171175        for (i = 0; i < ngroups; i++ ) {
    172                 DEBUG( 3, ( "%s%d", (i ? ", " : ""), (int)groups[i] ) );
    173         }
    174         DEBUG( 3, ( "\n" ) );
     176                DEBUG( 4, ( "%s%d", (i ? ", " : ""), (int)groups[i] ) );
     177        }
     178        DEBUG( 4, ( "\n" ) );
    175179
    176180        return ngroups;
     
    207211        ctx_p->ut.gid = getegid();
    208212
    209         DEBUG(3, ("push_sec_ctx(%u, %u) : sec_ctx_stack_ndx = %d\n",
     213        DEBUG(4, ("push_sec_ctx(%u, %u) : sec_ctx_stack_ndx = %d\n",
    210214                  (unsigned int)ctx_p->ut.uid, (unsigned int)ctx_p->ut.gid, sec_ctx_stack_ndx ));
    211215
     
    301305****************************************************************************/
    302306
    303 void set_sec_ctx(uid_t uid, gid_t gid, int ngroups, gid_t *groups, NT_USER_TOKEN *token)
     307void set_sec_ctx(uid_t uid, gid_t gid, int ngroups, gid_t *groups, struct security_token *token)
    304308{
    305309        struct sec_ctx *ctx_p = &sec_ctx_stack[sec_ctx_stack_ndx];
    306        
     310
    307311        /* Set the security context */
    308312
    309         DEBUG(3, ("setting sec ctx (%u, %u) - sec_ctx_stack_ndx = %d\n",
     313        DEBUG(4, ("setting sec ctx (%u, %u) - sec_ctx_stack_ndx = %d\n",
    310314                (unsigned int)uid, (unsigned int)gid, sec_ctx_stack_ndx));
    311315
    312         debug_nt_user_token(DBGC_CLASS, 5, token);
     316        security_token_debug(DBGC_CLASS, 5, token);
    313317        debug_unix_user_token(DBGC_CLASS, 5, uid, gid, ngroups, groups);
    314318
     
    324328
    325329        TALLOC_FREE(ctx_p->token);
    326        
     330
    327331        if (ngroups) {
    328332                ctx_p->ut.groups = (gid_t *)memdup(groups,
     
    415419        current_user.nt_user_token = prev_ctx_p->token;
    416420
    417         DEBUG(3, ("pop_sec_ctx (%u, %u) - sec_ctx_stack_ndx = %d\n",
     421        DEBUG(4, ("pop_sec_ctx (%u, %u) - sec_ctx_stack_ndx = %d\n",
    418422                (unsigned int)geteuid(), (unsigned int)getegid(), sec_ctx_stack_ndx));
    419423
Note: See TracChangeset for help on using the changeset viewer.