summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-03-23 21:50:44 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:18:52 -0500
commitb93126ea12f057497fd5d97e79e5ebac1bcfe1ef (patch)
tree4e8b01930f73a2eeb4526e6874707c9dfd55f8f0 /source3/smbd
parenteb465894322c78688480827b55e084210a6228a6 (diff)
downloadsamba-b93126ea12f057497fd5d97e79e5ebac1bcfe1ef.tar.gz
samba-b93126ea12f057497fd5d97e79e5ebac1bcfe1ef.tar.bz2
samba-b93126ea12f057497fd5d97e79e5ebac1bcfe1ef.zip
r21953: One format fix, clarify a condition that the IBM
checker was worried about. Jeremy. (This used to be commit 70eec7b8ae6a4992b43df853dffc21dd91498390)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/service.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index c96bcea4e2..79c618e7b3 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -915,10 +915,28 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
*/
{
+ BOOL can_write = False;
NT_USER_TOKEN *token = conn->nt_user_token ?
- conn->nt_user_token : vuser->nt_user_token;
+ conn->nt_user_token :
+ (vuser ? vuser->nt_user_token : NULL);
+
+ /*
+ * I don't believe this can happen. But the
+ * logic above is convoluted enough to confuse
+ * automated checkers, so be sure. JRA.
+ */
+
+ if (token == NULL) {
+ DEBUG(0,("make_connection: connection to %s "
+ "denied due to missing "
+ "NT token.\n",
+ lp_servicename(snum)));
+ conn_free(conn);
+ *status = NT_STATUS_ACCESS_DENIED;
+ return NULL;
+ }
- BOOL can_write = share_access_check(token,
+ can_write = share_access_check(token,
lp_servicename(snum),
FILE_WRITE_DATA);