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

687 Commits

Author SHA1 Message Date
Stefan Metzmacher
078482ad0e s4:auth: change auth_check_password_send/recv to tevent_req
metze
2009-12-24 17:38:34 +01:00
Stefan Metzmacher
577857d351 s4:gensec: change gensec_update_send/recv to tevent_req
metze
2009-12-24 17:38:34 +01:00
Stefan Metzmacher
4e2da423de s4:smb_server: fix mixing socket_address and tsocket_address
metze
2009-12-24 17:38:33 +01:00
Andrew Bartlett
0809696dbf s4:auth Change 'get_challenge' API to be more like Samba3
It is just easier to fill in the known to be 8 byte challenge than
stuff about with allocated pointers.

Andrew Bartlett
2009-12-22 17:29:15 +11:00
Andrew Tridgell
33cbe9c631 s4-server: use GUID_to_ndr_blob() in cldap and smb servers 2009-12-10 17:51:28 +11:00
Andrew Tridgell
f01ea8bf58 s4-smb2: use new GUID function in smb2 negprot 2009-12-10 17:51:27 +11:00
Stefan Metzmacher
b62964d6fe s4:smb_server/smb2: don't reset highest_smb2_seqnum on SMB2 Cancel
metze
2009-11-27 08:19:46 +01:00
Andrew Tridgell
7c158bdb1d s4-smb2: sequence numbers are not checked in SMB2_OP_CANCEL 2009-11-27 16:05:06 +11:00
Steven Danneman
7f14388721 s4/libcli: rename previously reserved field in SMB2 LOCK struct
The lock.in.reserved field has been renamed lock_sequence in the
SMB 2.1 dialect.  See MS-SMB 2.2.26.
2009-11-25 12:55:48 -08:00
Andrew Tridgell
54bd30f706 s4-samdb: reduce the number of samdb opens at startup
Using common parameters means that the ldb_wrap code can return a
reference rather than a new database
2009-10-25 17:19:03 +11: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
dab799e569 s4-smbserver: fixed root_fid in nttrans create 2009-10-15 20:03:01 +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
7c807de6b8 s4-smbd: minimise includes in smbd/ and smb_server 2009-09-19 14:11:54 -07:00
Andrew Tridgell
e9a589feac s4-server: kill main daemon if a task fails to initialise
When one of our core tasks fails to initialise it can now ask for the
server as a whole to die, rather than limping along in a degraded
state.
2009-09-18 18:05:55 -07:00
Andrew Tridgell
3854b5e614 changed BCC handling for SMBwriteX to handle broken MacOSX client
see bug #6610

The MacOSX SMB client sets the BCC value in SMBwriteX calls to zero
instead of the correct size. Checking against WindowsXP, I've found
that Windows uses the maximum of the computed buffer size and the
given BCC value. I've changed Samba4 to do the same to allow MacOSX to
work.

I've limited this change to non-chained packets to ensure we don't get
the possibility of exploits based on overlapping chained requests
2009-08-05 20:24:01 +10: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
Andrew Tridgell
0534ae012b use the new talloc_reparent in two places 2009-07-01 15:15:37 +10:00
Stefan Metzmacher
8d95883908 s4:smb2srv: don't allow the related flag on the first request in a compounded chain
metze
2009-06-09 19:33:46 +02:00
Stefan Metzmacher
959503ed1a s4:smb2srv: correctly fail remaining compounded requests after a failure
metze
2009-06-09 16:49:32 +02:00
Stefan Metzmacher
f55091586d s4:smb2srv: remove old TODO comment, we already check the seqnum
metze
2009-06-09 16:49:31 +02:00
Stefan Metzmacher
7633995fa0 s4:smb2srv: fix handling of multiple compounded requests
metze
2009-06-09 16:49:31 +02:00
Stefan Metzmacher
7b27b5f674 s4:smb2srv: remove the chained file handle on close
metze
2009-06-09 16:49:31 +02:00
Stefan Metzmacher
fadffbae88 s4:smb2srv: We only support SMB 2.002.
We need to loop over all given dialects and check
if we can find SMB2_DIALECT_REVISION_202.

metze
2009-05-26 09:50:45 +02: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
8cd9c72d75 s4:smb_server: initialy read the first 4 bytes only
Stop packet_recv getting greedy and reading the whole socket
and then dispatching te extra packets in a timer loop

Signed-off-by: Sam Liddicott <sam@liddicott.com>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-05-20 10:16:43 +02:00
Stefan Metzmacher
d51bb8e4e6 s4:smb_server: return after we have processed an invalid smb2 request
metze
2009-05-11 15:59:46 +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
Jelmer Vernooij
94069bd274 s4: Use same function signature for convert_* as s3. 2009-03-01 19:55:46 +01:00
Jelmer Vernooij
9ffb6d2d9e Add allow_badcharcnv argument to all conversion function, for
consistency with Samba 3.
2009-03-01 06:33:40 +01:00
Andrew Bartlett
71632a1697 Remove auth/ntlm as a dependency of GENSEC by means of function pointers.
When starting GENSEC on the server, the auth subsystem context must be
passed in, which now includes function pointers to the key elements.

This should (when the other dependencies are fixed up) allow GENSEC to
exist as a client or server library without bundling in too much of
our server code.

Andrew Bartlett
2009-02-13 10:24:16 +11:00
Stefan Metzmacher
d9c30894a1 s4:service_stream: s/private/private_data
metze
2009-02-02 13:09:00 +01:00
Stefan Metzmacher
5bf95a71dd s4:smb_server: s/private/private_data
metze
2009-02-02 13:08:36 +01:00
Stefan Metzmacher
5f13710ced s4:irpc: avoid c++ reserved word 'private'
metze
2009-02-01 00:17:20 +01:00
Simo Sorce
380874ef86 Fix the mess with ldb includes.
Separate again the public from the private headers.

Add a new header specific for modules.
Also add service function for modules as now ldb_context and ldb_module are
opaque structures for them.
2009-01-30 01:02:03 -05:00
Stefan Metzmacher
183c379fe5 s4:lib/tevent: rename structs
list=""
list="$list event_context:tevent_context"
list="$list fd_event:tevent_fd"
list="$list timed_event:tevent_timer"

for s in $list; do
	o=`echo $s | cut -d ':' -f1`
	n=`echo $s | cut -d ':' -f2`
	r=`git grep "struct $o" |cut -d ':' -f1 |sort -u`
	files=`echo "$r" | grep -v source3 | grep -v nsswitch | grep -v packaging4`
	for f in $files; do
		cat $f | sed -e "s/struct $o/struct $n/g" > $f.tmp
		mv $f.tmp $f
	done
done

metze
2008-12-29 20:46:40 +01:00
Jelmer Vernooij
b86b2ce662 Fix two remaining missing symbols in smbtorture4. 2008-12-22 23:00:10 +01:00
Jelmer Vernooij
c023828962 Fix missing symbols issues when building with shared libraries. 2008-12-22 21:03:09 +01:00
Jelmer Vernooij
928fd47c3d s4: Fix subsystem for various services in samba daemon. 2008-12-22 19:04:55 +01:00
Stefan Metzmacher
081f8883ba s4: fix LIBEVENTS dependencies and use more forward declarations
We should only include events.h where we really need it
and prefer forward declarations of 'struct event_context'

metze
2008-12-17 11:04:45 +01:00
Sam Liddicott
7d8f3cdbfc Let ntvfs request transport close via ntvfs_request state
[I can't swear that this covers all the smb2 cases, there are some reply
functions that I can't trace properly]

Add NTVFS_ASYNC_STATE_CLOSE bit to ntvfs_request->async_states->state
so that the ntvfs layer can signify that the client transport should
be closed, most useful for proxy servies, and most likely due to a
forwarding transport having been closed.

Signed-off-by: Sam Liddicott <sam@liddicott.com>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2008-12-05 12:52:13 +01:00
Jelmer Vernooij
b45caa44e1 Fix the build. 2008-11-02 23:58:49 +01:00
Jelmer Vernooij
b034c519f5 Add gensec_settings structure. This wraps loadparm_context for now, but
should in the future only contain some settings required for gensec.
2008-11-02 02:05:48 +01:00
Jelmer Vernooij
23302413b3 Remove unused include param/param.h. 2008-10-24 16:37:56 +02:00
Jelmer Vernooij
37d885c51a Remove iconv_convenience argument from convert_string{,talloc}() but
make them wrappers around convert_string{,talloc}_convenience().
2008-10-24 14:26:46 +02:00
Jelmer Vernooij
922a29992e Remove iconv_convenience parameter from simple string push/pull
functions.
2008-10-24 03:40:09 +02:00
Tim Prouty
e11277e28d Fixed a variable undeclared compilation error
Explicitly declaring environ eliminates a compilation error on some
systems.
2008-10-13 17:53:58 -07:00
Jelmer Vernooij
9565999755 Fix include paths to new location of libutil. 2008-10-11 21:31:42 +02:00