Ignore:
Timestamp:
Sep 30, 2007, 3:42:50 AM (18 years ago)
Author:
Paul Smedley
Message:

Update trunk to 3.2.0pre1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/samba/source/smbd/sec_ctx.c

    r1 r77  
    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
    8    the Free Software Foundation; either version 2 of the License, or
     8   the Free Software Foundation; either version of the License, or
    99   (at your option) any later version.
    1010   
     
    1515   
    1616   You should have received a copy of the GNU General Public License
    17    along with this program; if not, write to the Free Software
    18    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     17   along with this program.  If not, see <http://www.gnu.org/licenses/>.
    1918*/
    2019
     
    193192        if (sec_ctx_stack_ndx == MAX_SEC_CTX_DEPTH) {
    194193                DEBUG(0, ("Security context stack overflow!\n"));
    195                 smb_panic("Security context stack overflow!\n");
     194                smb_panic("Security context stack overflow!");
    196195        }
    197196
     
    227226        return True;
    228227}
     228
     229
     230
     231
     232
     233
     234
     235
     236
     237
     238
     239
     240
     241
     242
     243
     244
     245
     246
     247
     248
     249
     250
     251
     252
     253
     254
     255
     256
     257
     258
     259
     260
     261
     262
     263
     264
     265
     266
     267
     268
     269
     270
     271
     272
     273
     274
     275
     276
     277
     278
     279
     280
     281
     282
     283
     284
     285
     286
     287
     288
     289
     290
     291
     292
     293
     294
    229295
    230296/****************************************************************************
     
    249315        debug_unix_user_token(DBGC_CLASS, 5, uid, gid, ngroups, groups);
    250316
    251         gain_root();
    252 
    253 #ifdef HAVE_SETGROUPS
    254         sys_setgroups(ngroups, groups);
    255 #endif
     317        /* Change uid, gid and supplementary group list. */
     318        set_unix_security_ctx(uid, gid, ngroups, groups);
    256319
    257320        ctx_p->ut.ngroups = ngroups;
     
    283346        }
    284347
    285         become_id(uid, gid);
    286 
    287348        ctx_p->ut.uid = uid;
    288349        ctx_p->ut.gid = gid;
     
    322383        if (sec_ctx_stack_ndx == 0) {
    323384                DEBUG(0, ("Security context stack underflow!\n"));
    324                 smb_panic("Security context stack underflow!\n");
     385                smb_panic("Security context stack underflow!");
    325386        }
    326387
     
    344405        current_user.uid = getuid();
    345406#else
    346         gain_root();
    347 
    348407        prev_ctx_p = &sec_ctx_stack[sec_ctx_stack_ndx];
    349408
    350 #ifdef HAVE_SETGROUPS
    351         sys_setgroups(prev_ctx_p->ut.ngroups, prev_ctx_p->ut.groups);
    352 #endif
    353 
    354         become_id(prev_ctx_p->ut.uid, prev_ctx_p->ut.gid);
     409        /* Change uid, gid and supplementary group list. */
     410        set_unix_security_ctx(prev_ctx_p->ut.uid,
     411                        prev_ctx_p->ut.gid,
     412                        prev_ctx_p->ut.ngroups,
     413);
    355414
    356415        /* Update current_user stuff */
Note: See TracChangeset for help on using the changeset viewer.