summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/password.c8
-rw-r--r--source3/smbd/sec_ctx.c14
-rw-r--r--source3/smbd/service.c2
3 files changed, 22 insertions, 2 deletions
diff --git a/source3/smbd/password.c b/source3/smbd/password.c
index c2bcac339e..69ba042155 100644
--- a/source3/smbd/password.c
+++ b/source3/smbd/password.c
@@ -176,6 +176,7 @@ NT_USER_TOKEN *create_nt_token(uid_t uid, gid_t gid, int ngroups, gid_t *groups,
DOM_SID *psids;
int i, psid_ndx = 0;
size_t num_sids = 0;
+ fstring sid_str;
if ((token = (NT_USER_TOKEN *)malloc( sizeof(NT_USER_TOKEN) ) ) == NULL)
return NULL;
@@ -229,6 +230,13 @@ NT_USER_TOKEN *create_nt_token(uid_t uid, gid_t gid, int ngroups, gid_t *groups,
token->num_sids = psid_ndx;
+ /* Dump list of sids in token */
+
+ for (i = 0; i < token->num_sids; i++) {
+ DEBUG(5, ("user token sid %s\n",
+ sid_to_string(sid_str, &token->user_sids[i])));
+ }
+
return token;
}
diff --git a/source3/smbd/sec_ctx.c b/source3/smbd/sec_ctx.c
index eaaae9ace7..f3cc9e04e0 100644
--- a/source3/smbd/sec_ctx.c
+++ b/source3/smbd/sec_ctx.c
@@ -305,11 +305,23 @@ BOOL push_sec_ctx(void)
void set_sec_ctx(uid_t uid, gid_t gid, int ngroups, gid_t *groups, NT_USER_TOKEN *token)
{
struct sec_ctx *ctx_p = &sec_ctx_stack[sec_ctx_stack_ndx];
-
+
/* Set the security context */
DEBUG(3, ("setting sec ctx (%d, %d) - sec_ctx_stack_ndx = %d\n", uid, gid, sec_ctx_stack_ndx));
+ if (ngroups) {
+ int i;
+
+ DEBUG(3, ("%d user groups: \n", ngroups));
+ for (i = 0; i < ngroups; i++) {
+ DEBUGADD(3, ("%d ", groups[i]));
+ }
+
+ DEBUG(3, ("\n"));
+ }
+
+
gain_root();
#ifdef HAVE_SETGROUPS
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index 0713c0e49d..4670d601d7 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -468,7 +468,7 @@ connection_struct *make_connection(char *service,char *user,char *password, int
return NULL;
}
- conn->nt_user_token = create_nt_token(conn->uid, conn->gid,
+ conn->nt_user_token = create_nt_token(conn->uid, conn->gid,
conn->ngroups, conn->groups,
guest);