summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-07-10 10:57:30 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:09:59 -0500
commit41992489d2cb54b1a7158b49cc2c3a53cfd57b5a (patch)
treebd6cb1c8b90a63b7d3370727114d0675249ea7ba /source4
parentac857dcfed805ec0e45f06a86d8b2422c4cad1f5 (diff)
downloadsamba-41992489d2cb54b1a7158b49cc2c3a53cfd57b5a.tar.gz
samba-41992489d2cb54b1a7158b49cc2c3a53cfd57b5a.tar.bz2
samba-41992489d2cb54b1a7158b49cc2c3a53cfd57b5a.zip
r16913: better return the same values as vista beta2
metze (This used to be commit ae9c007324b04a81fd367e4e72f50275df137d46)
Diffstat (limited to 'source4')
-rw-r--r--source4/smb_server/smb2/tcon.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/source4/smb_server/smb2/tcon.c b/source4/smb_server/smb2/tcon.c
index 2ebfa883ef..cc0a911224 100644
--- a/source4/smb_server/smb2/tcon.c
+++ b/source4/smb_server/smb2/tcon.c
@@ -156,6 +156,7 @@ static NTSTATUS smb2srv_tcon_backend(struct smb2srv_request *req, union smb_tcon
NTSTATUS status;
enum ntvfs_type type;
uint16_t type_smb2;
+ uint32_t unknown2;
int snum;
const char *service = io->smb2.in.path;
@@ -183,12 +184,15 @@ static NTSTATUS smb2srv_tcon_backend(struct smb2srv_request *req, union smb_tcon
if (strcmp(lp_fstype(snum), "IPC") == 0) {
type = NTVFS_IPC;
type_smb2 = 0x0002;
+ unknown2 = 0x00000030;
} else if (lp_print_ok(snum)) {
type = NTVFS_PRINT;
type_smb2 = 0x0003;
+ unknown2 = 0x00000000;
} else {
type = NTVFS_DISK;
type_smb2 = 0x0001;
+ unknown2 = 0x00000800;
}
tcon = smbsrv_smb2_tcon_new(req->session, lp_servicename(snum));
@@ -254,7 +258,7 @@ static NTSTATUS smb2srv_tcon_backend(struct smb2srv_request *req, union smb_tcon
}
io->smb2.out.unknown1 = type_smb2; /* 1 - DISK, 2 - Print, 3 - IPC */
- io->smb2.out.unknown2 = 0x00000000;
+ io->smb2.out.unknown2 = unknown2;
io->smb2.out.unknown3 = 0x00000000;
io->smb2.out.access_mask= SEC_RIGHTS_FILE_ALL;
@@ -270,14 +274,24 @@ failed:
static void smb2srv_tcon_send(struct smb2srv_request *req, union smb_tcon *io)
{
- if (NT_STATUS_IS_ERR(req->status)) {
+ uint16_t unknown1;
+
+ if (!NT_STATUS_IS_OK(req->status)) {
smb2srv_send_error(req, req->status);
return;
}
+ if (io->smb2.out.unknown1 == 0x0002) {
+ /* if it's an IPC share vista returns 0x0005 */
+ unknown1 = 0x0005;
+ } else {
+ unknown1 = 0x0001;
+ }
+
SMB2SRV_CHECK(smb2srv_setup_reply(req, 0x10, False, 0));
SIVAL(req->out.hdr, SMB2_HDR_TID, io->smb2.out.tid);
+ SSVAL(req->out.hdr, SMB2_HDR_UNKNOWN1,unknown1);
SSVAL(req->out.body, 0x02, io->smb2.out.unknown1);
SIVAL(req->out.body, 0x04, io->smb2.out.unknown2);