summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2001-11-04 04:58:17 +0000
committerAndrew Bartlett <abartlet@samba.org>2001-11-04 04:58:17 +0000
commitc42bdbdacec8f9d4fe14ffba6e14778b691a6ff2 (patch)
treed60be496d06882dacb52b69647cc370378a28351
parent5f5661d21717ee7eea27d4776180dd88635ad8d4 (diff)
downloadsamba-c42bdbdacec8f9d4fe14ffba6e14778b691a6ff2.tar.gz
samba-c42bdbdacec8f9d4fe14ffba6e14778b691a6ff2.tar.bz2
samba-c42bdbdacec8f9d4fe14ffba6e14778b691a6ff2.zip
Fix segfault. sup_tok might not always be with us.
(This used to be commit 1f409a1f3fb0906f1ff985b96bb7a65f56253046)
-rw-r--r--source3/smbd/password.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source3/smbd/password.c b/source3/smbd/password.c
index 429d72b4e5..f0fec9b796 100644
--- a/source3/smbd/password.c
+++ b/source3/smbd/password.c
@@ -170,9 +170,11 @@ NT_USER_TOKEN *create_nt_token(uid_t uid, gid_t gid, int ngroups, gid_t *groups,
}
}
- /* Now add the additional SIDs from the supplimentary token. */
- for (i = 0; i < sup_tok->num_sids; i++)
- sid_copy( &psids[psid_ndx++], &sup_tok->user_sids[i] );
+ if (sup_tok) {
+ /* Now add the additional SIDs from the supplimentary token. */
+ for (i = 0; i < sup_tok->num_sids; i++)
+ sid_copy( &psids[psid_ndx++], &sup_tok->user_sids[i] );
+ }
/*
* Finally add the "standard" SIDs.