1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
Commit Graph

47 Commits

Author SHA1 Message Date
Stefan Metzmacher
5a05e687ce s4:smb_server: fix large read_andx requests
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-03-20 09:32:26 -07:00
Günther Deschner
185b94eefa nbt: trim down header dependencies of nbt.idl.
Guenther
2011-11-03 18:35:08 +01:00
Stefan Metzmacher
5812a5218d s4:smb_server: s/SMBkeepalive/NBSSkeepalive
metze
2011-07-12 09:44:04 +02:00
Stefan Metzmacher
ae1c040b51 s4:smb_server/smb: SMBreadX can return STATUS_BUFFER_OVERFLOW
metze
2010-04-28 15:46:01 +02:00
Andrew Tridgell
80a37beb53 s4-pvfs: move the private ntcreatex flags to private_flags
Re-using two of the create_options bits was bound to eventually
cause problems, and indeed, Windows7 now uses one of those bits
when opening text files.

Fixes bug 7189
2010-03-05 16:12:05 +11:00
Matt Kraai
d8071e7ed7 Change uint_t to unsigned int in source4
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-02-02 07:18:18 +01:00
Andrew Tridgell
46b7938d7e s4-smbserver: removed bogus initialisation of two union arms
Thanks to Metze for spotting this.
2009-10-17 13:12:24 +11:00
Andrew Tridgell
d72b5a81ef s4-smb: fill in fnum as well for root_fid
This helps with the CIFS NTVFS backend, but doesn't solve all problems
2009-10-15 20:50:49 +11:00
Andrew Tridgell
3c028ff88b s4-smb: declare root_fid as a file handle
In order to implement root_fid in the s4 SMB server we need to declare
it as a handle type, just as for other fnum values in SMB. This
required some extensive (but simple) changes in many bits of code.
2009-10-15 20:03:00 +11:00
Andrew Tridgell
67b6f5784a on buffer overflow windows gives SMBSRV:ERRerror here 2009-08-05 20:24:00 +10:00
Andrew Tridgell
ff388611f4 fixed support for readx greater than 64k
This fixes bug 6547, where smbclient in S3 reads more than 64k at a
time with readx.
2009-08-04 16:01:11 +10:00
Sam Liddicott
4b21ad9db7 Have ntvfs_connect() accept union smb_tcon *tcon instead of char* sharename
This change brings ntvfs_connect into compliance with other ntvfs functions
which take an ntvfs module, an ntvfs request and an smb io union.

It now becomes the responsibility of ntvfs modules to examine
tcon->generic.level themselves and derive the share name and any other
options
directly; e.g.

	const char *sharename;

	switch (tcon->generic.level) {
	case RAW_TCON_TCON:
		sharename = tcon->tcon.in.service;
		break;
	case RAW_TCON_TCONX:
		sharename = tcon->tconx.in.path;
		break;
	case RAW_TCON_SMB2:
	default:
		return NT_STATUS_INVALID_LEVEL;
	}

	if (strncmp(sharename, "\\\\", 2) == 0) {
		char *p = strchr(sharename+2, '\\');
		if (p) {
			sharename = p + 1;
		}
	}

service.c smbsrv_tcon_backend() is called before ntvfs_connect and fills in
some of the tcon->..out values.
For the case of RAW_TCON_TCONX, it filles out tcon->tconx.out.tid and
tcon->tconx.out.options

For the case of RAW_TCON_TCON it fills out tcon->tcon.out.tid and
tcon->tcon.out.max_xmit

Thus the ntvfs_connect function for vfs modules may override these values
if desired, but are not required to.

ntvfs_connect functions are required to fill in the tcon->tconx.out.*_type
fields, for RAW_TCON_TCONX, perhaps something like:

	if (tcon->generic.level == RAW_TCON_TCONX) {
		tcon->tconx.out.fs_type = ntvfs->ctx->fs_type;
		tcon->tconx.out.dev_type = ntvfs->ctx->dev_type;
	}

Signed-off-by: Sam Liddicott <sam@liddicott.com>

(I fixed the ntvfs_connect() in the smb_server/smb2/
 and the RAW_TCON_SMB2 switch case in the modules)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-05-20 13:32:27 +02:00
Sam Liddicott
176302dc05 Add async support for reply_tcon* and ntvfs_connect
smbsrv_tcon_backend no longer creates the ntvfs_request wrapper,
so smbsrv_reply_tcon* can now do this and then invoke ntvfs_connect
in the typical manner using SMBSRV_SETUP_NTVFS_REQUEST and
SMBSRV_CALL_NTVFS_BACKEND

Previously smbsrv_tcon_backend has been responsible for instantiating
the ntvfs_module_context to service a tree-connect request, and
then create an ntvfs_request wrapper around the smbsrv_request
and pass this to ntvfs_connect for the newly created ntvfs.

These actions could not be invoked asynchronously.

This meant that any client requests made while instantiating the
ntvfs module, including any composite's used during authentication
(or related client connections for the case of proxy modules)
would block other ntvfs modules and requests in the current process as
they executed a nested event loop to await completion.

Signed-off-by: Sam Liddicott <sam@liddicott.com>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-04-23 16:57:18 +02:00
Andrew Tridgell
091c141aba make sure we initialise query_maximal_access
(This used to be commit 036f73d39a)
2008-07-24 14:20:02 +10:00
Andrew Tridgell
f85cfa9161 make sure we send a reply packet for bad create options
(This used to be commit f9b94f6299)
2008-05-28 11:47:39 +10:00
Andrew Tridgell
2ad2bdda89 stricter checks for valid inputs in SMB2 open and lock
(This used to be commit a7b5689a73)
2008-05-26 15:02:43 +10:00
Andrew Tridgell
e870cfec9f Convert SMB and SMB2 code to use a common buffer handling structure
This converts our SMB and SMB2 code to use a common structure "struct
request_bufinfo" for information on the buffer bounds of a packet,
alignment information and string handling. This allows us to use a
common backend for SMB and SMB2 code, while still using all the same
string and blob handling functions.

Up to now we had been passing a NULL req handle into these common
routines from the SMB2 side of the server, which meant that we failed
any operation which did a bounds checked string extraction (such as a
RenameInformation setinfo call, which is what Vista uses for renaming
files)

There is still some more work to be done on this - for example we can
now remove many of the SMB2 specific buffer handling functions that we
had, and use the SMB ones.
(This used to be commit ca6d9be6cb)
2008-02-14 10:12:33 +11:00
Jelmer Vernooij
0c56f8dac3 r25551: Convert to standard bool type.
(This used to be commit c9651e2c5c)
2007-10-10 15:07:54 -05:00
Andrew Tridgell
0479a2f1cb r23792: convert Samba4 to GPLv3
There are still a few tidyups of old FSF addresses to come (in both s3
and s4). More commits soon.
(This used to be commit fcf38a38ac)
2007-10-10 14:59:12 -05:00
Stefan Metzmacher
1575743c36 r17283: use the async calls of auth_check_password() and gensec_update()
in the smb server.

metze
(This used to be commit 216e02c69c)
2007-10-10 14:15:06 -05:00
Stefan Metzmacher
e6b29409a2 r16979: - ntcancel should compare TID,UID,MID and PID
- don't return ntcancel error, as we don't know how signing works
  for them

metze
(This used to be commit 20311e58d5)
2007-10-10 14:10:06 -05:00
Stefan Metzmacher
3b36a85798 r16950: remove the smb mid from the ntvfs layer and keep a list of pending
requests on the smbsrv_connection, to be able to match then on
ntcancel

metze
(This used to be commit 04f0d3d031)
2007-10-10 14:10:02 -05:00
Andrew Tridgell
03e7d37461 r15827: fixed a spelling error
(This used to be commit 801357af2e)
2007-10-10 14:08:29 -05:00
Stefan Metzmacher
9ef33f5f5c r15734: This is a major change to the NTVFS subsystem:
- to use a struct ntvfs_handle instead of a uint16_t fnum.
  (to make it independend from the frontend protocol)
- the allocation of handles now is provided by the frontend
  (smbsrv_*) via callbacks and not by each backend module
- this also makes sure that file handles are only passed
  to the ntvfs subsystem when the tcon and session matches,
  so modules can rely on this and need to check this.
- this allows multiple modules in the ntvfs module chain
  to allocate file handles. This can be used for virtual
  files like "\\$Extend\\$Quota:$Q:$INDEX_ALLOCATION"...
- also this will make SMB2 with 128 bit file handles possible

metze
(This used to be commit 287fc1c22d)
2007-10-10 14:08:10 -05:00
Stefan Metzmacher
7f0e17e903 r15718: - split the SMBflush with the 0xFFFF wildcard fnum into a different level
metze
(This used to be commit 95bf41b4d4)
2007-10-10 14:08:09 -05:00
Stefan Metzmacher
d72632ba08 r14644: fix SMBecho, used by w2k clients, failing this,
causes an SMBulogoffX and SMBtdis

jelmer: I think this should go into TP2

metze
(This used to be commit 94d775c74d)
2007-10-10 13:59:04 -05:00
Stefan Metzmacher
61fa658ebc r14541: separate smbsrv_request and ntvfs_request,
with this it's now possible to write a
ntvfs_test programm like the vfstest in samba3

also smb2 support will be possible later

metze
(This used to be commit 7253153691)
2007-10-10 13:58:41 -05:00
Andrew Bartlett
bae6672ea9 r14502: Supply both needed arguments for the backend logoff processing.
This should fix the segfaults on the build farm.

Metze: please check

Andrew Bartlett
(This used to be commit fb927a7117)
2007-10-10 13:57:35 -05:00
Stefan Metzmacher
d3087451c4 r14487: split smbsrv_request into two parts, one will be moved to ntvfs_request
but I don't to get the commit to large, to I'll do this tomorrow...

metze
(This used to be commit 10e627032d)
2007-10-10 13:57:32 -05:00
Stefan Metzmacher
3948fcac49 r14485: mark smb commands as need session and need tcon explicit,
so we only need to check in one global place and can't forget
in other places...

metze
(This used to be commit 742be8e075)
2007-10-10 13:57:31 -05:00
Jelmer Vernooij
8528016978 r14464: Don't include ndr_BASENAME.h files unless strictly required, instead
try to include just the BASENAME.h files (containing only structs)
(This used to be commit 3dd477ca51)
2007-10-10 13:57:27 -05:00
Stefan Metzmacher
a1b295ed48 r14256: - rename smb_file -> smb_handle
- move it into the in/out substructs again
- allow file.path only on smb_fileinfo/smb_setfileinfo

metze
(This used to be commit be6d5298a2)
2007-10-10 13:57:06 -05:00
Andrew Tridgell
7f0c7702f6 r14208: removed use of req->flags2 inside the ntvfs layer. This should help
metze on his quest to unify the ntvfs strucures for the smb and smb2
servers. The only place we needed flags2 inside ntvfs was for the
FLAGS2_READ_PERMIT_EXECUTE bit, which only affects readx, so I added a
readx.in.read_for_execute flag instead.
(This used to be commit b78abbbce6)
2007-10-10 13:57:03 -05:00
Stefan Metzmacher
307e43bb56 r14173: change smb interface structures to always use
a union smb_file, to abtract
- const char *path fot qpathinfo and setpathinfo
- uint16_t fnum for SMB
- smb2_handle handle for SMB2

the idea is to later add a struct ntvfs_handle *ntvfs
so that the ntvfs subsystem don't need to know the difference between SMB and SMB2

metze
(This used to be commit 2ef3f59709)
2007-10-10 13:56:57 -05:00
Stefan Metzmacher
86497db611 r14157: - pass a struct ntvfs_request to the ntvfs layer
(for now we just do #define ntvfs_request smbsrv_request,
   but it's the first step...)
- rename ntvfs_openfile() -> ntvfs_open()
- fix the talloc hierachie in some places in the ntvfs_map_*() code

metze
(This used to be commit ed9ed1f48f)
2007-10-10 13:56:55 -05:00
Andrew Tridgell
db45433f31 r14016: use type safe talloc when constructing operation structures in smb server
(This used to be commit 78dd6b3e0c)
2007-10-10 13:52:37 -05:00
Stefan Metzmacher
edd5b847bc r13877: remove smbsrv_send_dos_error() and use smbsrv_send_error(..,NT_STATUS_DOS())
metze
(This used to be commit 60d7920527)
2007-10-10 13:52:19 -05:00
Stefan Metzmacher
8d91f3dec0 r13872: fix typo
metze
(This used to be commit f28fb440d5)
2007-10-10 13:52:19 -05:00
Stefan Metzmacher
a0e66eac7d r13870: prefix more functions with smbsrv_
metze
(This used to be commit e6275db7b9)
2007-10-10 13:52:19 -05:00
Stefan Metzmacher
0533fed85a r13868: remove useless talloc_free() wrapper
metze
(This used to be commit bd3162e6a7)
2007-10-10 13:52:19 -05:00
Stefan Metzmacher
354a61fc91 r13866: prefix more functions with smbsrv_
metze
(This used to be commit bb083f17c9)
2007-10-10 13:52:18 -05:00
Stefan Metzmacher
b58f6e543d r13865: prefix functions with smbsrv_
metze
(This used to be commit 2af9663275)
2007-10-10 13:52:18 -05:00
Stefan Metzmacher
5991787ce6 r13862: rename chain_reply -> smbsrv_chain_reply
metze
(This used to be commit 497b219c7d)
2007-10-10 13:52:18 -05:00
Jelmer Vernooij
d4de4c2d21 r12608: Remove some unused #include lines.
(This used to be commit 70e7449318)
2007-10-10 13:49:03 -05:00
Jelmer Vernooij
0a3c167f6b r12528: Add seperate proto headers for ntvfs, tdr, smb_server and nbt_server.
(This used to be commit 87f665a1d5)
2007-10-10 13:47:51 -05:00
Stefan Metzmacher
273f340376 r12102: for SMB2 we need to allocate tcons per session
metze
(This used to be commit 4d527ac005)
2007-10-10 13:47:09 -05:00
Stefan Metzmacher
6d34ab056f r11786: move all SMB protocol specific stuff to smb_server/smb/
metze
(This used to be commit 5fea278cb6)
2007-10-10 13:46:27 -05:00