Changeset 77 for trunk/samba/source/smbd/sec_ctx.c
- Timestamp:
- Sep 30, 2007, 3:42:50 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/samba/source/smbd/sec_ctx.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/samba/source/smbd/sec_ctx.c
r1 r77 6 6 This program is free software; you can redistribute it and/or modify 7 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2of the License, or8 the Free Software Foundation; either version of the License, or 9 9 (at your option) any later version. 10 10 … … 15 15 16 16 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/>. 19 18 */ 20 19 … … 193 192 if (sec_ctx_stack_ndx == MAX_SEC_CTX_DEPTH) { 194 193 DEBUG(0, ("Security context stack overflow!\n")); 195 smb_panic("Security context stack overflow! \n");194 smb_panic("Security context stack overflow!"); 196 195 } 197 196 … … 227 226 return True; 228 227 } 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 229 295 230 296 /**************************************************************************** … … 249 315 debug_unix_user_token(DBGC_CLASS, 5, uid, gid, ngroups, groups); 250 316 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); 256 319 257 320 ctx_p->ut.ngroups = ngroups; … … 283 346 } 284 347 285 become_id(uid, gid);286 287 348 ctx_p->ut.uid = uid; 288 349 ctx_p->ut.gid = gid; … … 322 383 if (sec_ctx_stack_ndx == 0) { 323 384 DEBUG(0, ("Security context stack underflow!\n")); 324 smb_panic("Security context stack underflow! \n");385 smb_panic("Security context stack underflow!"); 325 386 } 326 387 … … 344 405 current_user.uid = getuid(); 345 406 #else 346 gain_root();347 348 407 prev_ctx_p = &sec_ctx_stack[sec_ctx_stack_ndx]; 349 408 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 ); 355 414 356 415 /* Update current_user stuff */
Note:
See TracChangeset
for help on using the changeset viewer.
