~ubuntu-branches/debian/experimental/samba4/experimental

« back to all changes in this revision

Viewing changes to source3/smbd/sec_ctx.c

  • Committer: Package Import Robot
  • Author(s): Jelmer Vernooij
  • Date: 2012-10-28 16:21:43 UTC
  • mfrom: (1.3.3)
  • Revision ID: package-import@ubuntu.com-20121028162143-zksa7dz2hu3fls89
Tags: 4.0.0~rc4+dfsg1-1
* New upstream release.
 + Bump minimum ldb version to 1.1.13.
* Switch to Git as VCS.
* Remove DM-Upload-Allowed field.
* Depend on heimdal-multidev rather than heimdal-dev.
 + Add 11_system_heimdal to support building with system heimdal.

Show diffs side-by-side

added added

removed removed

Lines of Context:
466
466
        current_user.vuid = UID_FIELD_INVALID;
467
467
        current_user.nt_user_token = NULL;
468
468
}
 
469
 
 
470
/*************************************************************
 
471
 Called when we're inside a become_root() temporary escalation
 
472
 of privileges and the nt_user_token is NULL. Return the last
 
473
 active token on the context stack. We know there is at least
 
474
 one valid non-NULL token on the stack so panic if we underflow.
 
475
*************************************************************/
 
476
 
 
477
const struct security_token *sec_ctx_active_token(void)
 
478
{
 
479
        int stack_index = sec_ctx_stack_ndx;
 
480
        struct sec_ctx *ctx_p = &sec_ctx_stack[stack_index];
 
481
 
 
482
        while (ctx_p->token == NULL) {
 
483
                stack_index--;
 
484
                if (stack_index < 0) {
 
485
                        DEBUG(0, ("Security context active token "
 
486
                                  "stack underflow!\n"));
 
487
                        smb_panic("Security context active token "
 
488
                                  "stack underflow!");
 
489
                }
 
490
                ctx_p = &sec_ctx_stack[stack_index];
 
491
        }
 
492
        return ctx_p->token;
 
493
}