summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-05-19 21:27:43 -0700
committerJeremy Allison <jra@samba.org>2010-05-19 21:27:43 -0700
commitfad5d33bf880bcc137f7cb47e72cd0e07d92eec3 (patch)
treef672a789caf858e2fabaa8845b8f8e4e9c85ca4e /source3/smbd
parentb7067ee5f786dd2a06172014bbd7cd78d9129b47 (diff)
downloadsamba-fad5d33bf880bcc137f7cb47e72cd0e07d92eec3.tar.gz
samba-fad5d33bf880bcc137f7cb47e72cd0e07d92eec3.tar.bz2
samba-fad5d33bf880bcc137f7cb47e72cd0e07d92eec3.zip
Fix connecting to [homes] share over SMB2.
Jeremy.
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/smb2_tcon.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/source3/smbd/smb2_tcon.c b/source3/smbd/smb2_tcon.c
index 084ded95a4..f3e3037bdb 100644
--- a/source3/smbd/smb2_tcon.c
+++ b/source3/smbd/smb2_tcon.c
@@ -152,6 +152,7 @@ static NTSTATUS smbd_smb2_tree_connect(struct smbd_smb2_request *req,
int snum = -1;
struct smbd_smb2_tcon *tcon;
connection_struct *compat_conn = NULL;
+ user_struct *compat_vuser = req->session->compat_vuser;
int id;
NTSTATUS status;
@@ -169,15 +170,31 @@ static NTSTATUS smbd_smb2_tree_connect(struct smbd_smb2_request *req,
strlower_m(service);
- snum = find_service(service);
+ /* TODO: do more things... */
+ if (strequal(service,HOMES_NAME)) {
+ if (compat_vuser->homes_snum == -1) {
+ DEBUG(2, ("[homes] share not available for "
+ "user %s because it was not found "
+ "or created at session setup "
+ "time\n",
+ compat_vuser->server_info->unix_name));
+ return NT_STATUS_BAD_NETWORK_NAME;
+ }
+ snum = compat_vuser->homes_snum;
+ } else if ((compat_vuser->homes_snum != -1)
+ && strequal(service,
+ lp_servicename(compat_vuser->homes_snum))) {
+ snum = compat_vuser->homes_snum;
+ } else {
+ snum = find_service(service);
+ }
+
if (snum < 0) {
DEBUG(3,("smbd_smb2_tree_connect: couldn't find service %s\n",
service));
return NT_STATUS_BAD_NETWORK_NAME;
}
- /* TODO: do more things... */
-
/* create a new tcon as child of the session */
tcon = talloc_zero(req->session, struct smbd_smb2_tcon);
if (tcon == NULL) {