1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-13 13:18:06 +03:00
Commit Graph

53773 Commits

Author SHA1 Message Date
Jeremy Allison
5dd82fb675 Revert the last two commits (fix for #6386). The actual problem
was a bug in ldb in 3.2 which could return a freed pointer on
ret != LDAP_SUCCESS. The main thing we must ensure is that we
never talloc_steal until we know LDAP_SUCCESS was returned.
Jeremy.
2009-05-21 18:37:36 -07:00
Jeremy Allison
87504b27d8 Ensure all possible uses of indirection through res are checked after
an ldb_search.
Jeremy.
2009-05-21 18:00:54 -07:00
Jeremy Allison
d4d06a4ef9 Attempt to fix bug #6386 - Samba Panic triggered by Sophos Control Centre.
Don't indirect a potentially null pointer.
Jeremy.
2009-05-21 17:27:25 -07:00
Jim McDonough
a91bcbccf8 Detect tight loop in tdb_find() 2009-05-21 16:29:48 -04:00
Tim Prouty
96ede10cfb s3 torture: Fix warning 2009-05-21 12:17:53 -07:00
Tim Prouty
cfc68fc9d9 s3 onefs: Fix invalid argument from the unix_convert smb_filename struct patch 2009-05-21 12:17:33 -07:00
Stefan Metzmacher
c3f6eff4f5 s3:smbd: we want to get the next command offset and not set it...
This should also fix the build on some hosts.

metze
2009-05-21 16:21:57 +02:00
Günther Deschner
cbcee123b2 s3-build: fix the build of ntlm_auth. Bo Yang, please check.
Guenther
2009-05-21 12:50:20 +02:00
Günther Deschner
686e60581b s4-selftest: adding RPC-SAMR-USERS-PRIVILEGES to knownfail list.
Samba4 cannot pass this test currently as in Samba4 (unlike Samba3)
the LSA and SAMR account are stored in the same db.
Once you delete a SAMR user the LSA privilege account is deleted
at the same time (which is wrong).

Guenther
2009-05-21 12:19:56 +02:00
Bo Yang
d7480a91b4 s3: ignore EPIPE error when winbind finally writes to wb client because client might have already closed the socket
Signed-off-by: Bo Yang <boyang@samba.org>
2009-05-22 03:22:52 +08:00
Bo Yang
cbe3dabb9d s3: Fix onlinestatus msg to return status of all domain instead of omitting trusted domains
Signed-off-by: Bo Yang <boyang@samba.org>
2009-05-22 02:12:59 +08:00
Bo Yang
8c7a579bdc s3: set winbindd request flags in ntlm_auth to make it contact trusted domain when krb5 auth is enabled
Signed-off-by: Bo Yang <boyang@samba.org>
2009-05-22 02:03:32 +08:00
Bo Yang
e65aa34078 s3: Fix request flags in wbinfo when perform krb5 authentication
Signed-off-by: Bo Yang <boyang@samba.org>
2009-05-22 01:39:03 +08:00
Jeremy Allison
000da55dd9 Make cli_posix_open() and cli_posix_mkdir() async.
Jeremy.
2009-05-20 18:31:36 -07:00
Tim Prouty
c1a21d085d s3: Change unix_convert (and its callers) to use struct smb_filename
This is the first of a series of patches that change path based
operations to operate on a struct smb_filename instead of a char *.
This same concept already exists in source4.

My goals for this series of patches are to eventually:

1) Solve the stream vs. posix filename that contains a colon ambiguity
   that currently exists.
2) Make unix_convert the only function that parses the stream name.
3) Clean up the unix_convert API.
4) Change all path based vfs operation to take a struct smb_filename.
5) Make is_ntfs_stream_name() a constant operation that can simply
   check the state of struct smb_filename rather than re-parse the
   filename.
6) Eliminate the need for split_ntfs_stream_name() to exist.

My strategy is to start from the inside at unix_convert() and work my
way out through the vfs layer, call by call.  This first patch does
just that, by changing unix_convert and all of its callers to operate
on struct smb_filename.  Since this is such a large change, I plan on
pushing the patches in phases, where each phase keeps full
compatibility and passes make test.

The API of unix_convert has been simplified from:

NTSTATUS unix_convert(TALLOC_CTX *ctx,
		      connection_struct *conn,
		      const char *orig_path,
		      bool allow_wcard_last_component,
		      char **pp_conv_path,
		      char **pp_saved_last_component,
		      SMB_STRUCT_STAT *pst)
to:

NTSTATUS unix_convert(TALLOC_CTX *ctx,
		      connection_struct *conn,
		      const char *orig_path,
		      struct smb_filename *smb_fname,
		      uint32_t ucf_flags)

Currently the smb_filename struct looks like:

struct smb_filename {
       char *base_name;
       char *stream_name;
       char *original_lcomp;
       SMB_STRUCT_STAT st;
};

One key point here is the decision to break up the base_name and
stream_name.  I have introduced a helper function called
get_full_smb_filename() that takes an smb_filename struct and
allocates the full_name.  I changed the callers of unix_convert() to
subsequently call get_full_smb_filename() for the time being, but I
plan to eventually eliminate get_full_smb_filename().
2009-05-20 17:40:15 -07:00
Stefan Metzmacher
5d3d51e9ad s3:smbd: check the incoming session id for SMB2 requests
metze
2009-05-20 20:53:39 +02:00
Stefan Metzmacher
1ecdc8588d s3:smbd: implement SMB2 Session Setup with raw NTLMSSP
metze
2009-05-20 20:53:34 +02:00
Stefan Metzmacher
dafc1e0c8d s3:smbd: for now indicate raw NTLMSSP in the SMB2 Negotiate response
metze
2009-05-20 20:53:32 +02:00
Stefan Metzmacher
f9da4fb71a s3:smbd: move the callback functions of smbd_smb2_request_reply() closer itself
metze
2009-05-20 20:53:32 +02:00
Stefan Metzmacher
eac1235519 s3:smbd: add smbd_smb2_request_done_ex()
Some times we have to return a non-error response
with status != NT_STATUS_OK.

metze
2009-05-20 20:53:31 +02:00
Stefan Metzmacher
c4b41c5649 s3:smbd: fix initialized memory in SMB2 responses
MESSAGE_ID and SESSION_ID are both 64bit.

metze
2009-05-20 20:53:31 +02:00
Jeremy Allison
d649a46078 Add a security model to LSA. Similar to the SAMR code - using
the MS-LSA docs.
Jeremy.
2009-05-20 11:52:11 -07:00
Stefan Metzmacher
04ceabf56f s4:libcli/smb2: fix session setup with raw NTLMSSP
metze
2009-05-20 19:58:37 +02:00
Stefan Metzmacher
540b713075 s4:libcli/smb2: use raw ntlmssp if the server didn't provide a sec blob
metze
2009-05-20 19:58:37 +02:00
Stefan Metzmacher
5b55e47b71 s4:libcli/smb2: fill in transport->negotiate.secblob with the correct data
metze
2009-05-20 19:58:36 +02:00
Volker Lendecke
f024ca961e Use SMB_VFS_NEXT_CLOSE. This VFS stuff is really opaque to me...
Thanks Michael to provide some transparency :-)
2009-05-20 15:44:27 +02:00
Stefan Metzmacher
4abd5f34d9 s3:smbd: add support for SMB2 Keepalive (SMB2 Echo)
metze
2009-05-20 15:43:00 +02:00
Stefan Metzmacher
d7d73b08e9 s3:smbd: allow SMB 2.002 dialect in SMB1 negprot
We create a dummy SMB2 Negotiate inbuf and pass the
connection to the SMB2 engine.

metze
2009-05-20 15:43:00 +02:00
Stefan Metzmacher
3ef6a5ae9e s3:smbd: add support for SMB2 Negotiate
This is not complete, but a start that makes the
samba4 smb2 client happy.

metze
2009-05-20 15:42:59 +02:00
Stefan Metzmacher
c14dd15c6a s3:smbd: make negprot_spnego() non static
metze
2009-05-20 15:42:58 +02:00
Stefan Metzmacher
688945a994 s3:smbd: add infrastructure for SMB2 support
This is disabled by default and activated by
"max protocol = SMB2".

metze
2009-05-20 15:42:24 +02:00
Stefan Metzmacher
d23a1935e8 s3:param: add PROTOCOL_SMB2
metze
2009-05-20 15:42:19 +02:00
Stefan Metzmacher
d59f84d738 SMB2-LOCK: let the test pass against samba4
metze
2009-05-20 15:26:54 +02:00
Volker Lendecke
54973d0422 Fix bug disclosed by lock8 torture test
We have to drop the gpfs level share modes, regardless of whether we put
the file into the pending close queue.
2009-05-20 15:15:57 +02:00
Volker Lendecke
3fbc871f70 Demonstrate a bug we have when dealing with real os-level share modes
Another one of those where you stare at logfiles for hours, and when you found
it, it's absolutely obvious what is happening...
2009-05-20 14:58:37 +02:00
Günther Deschner
9a13af9a99 s4: try to fix privileges implementation in order to pass the RPC-SAMR-USERS-PRIVILEGES test.
Guenther
2009-05-20 13:35:05 +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
Günther Deschner
e11f9b46c6 s3-selftest: add add and delete group scripts using nss_wrapper.
Guenther
2009-05-20 12:37:44 +02:00
Günther Deschner
3bd360c73d nsswrapper: implement group_del() in nss_wrapper.pl.
Guenther
2009-05-20 12:37:37 +02:00
Günther Deschner
b3cc01fd68 nsswrapper: implement group_add() in nss_wrapper.pl.
Guenther
2009-05-20 12:37:31 +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
ac7f4fa380 s4:libcli/raw: initialy read the first 4 bytes only
metze
2009-05-20 10:16:42 +02:00
Volker Lendecke
e3b5e286d0 Do not do a merged build without shared libs
Jelmer, you might want to take a look at Andrew B's problem with

--enable-developer --disable-shared --disable-shared-libs
2009-05-20 08:59:27 +02:00
Volker Lendecke
8811aa1376 Only build the krb5 locator when building shared libs 2009-05-20 08:41:57 +02:00
Volker Lendecke
ac65ae9b1d Set errno=ENOMEM if tevent_add_fd fails
tevent_add_fd does not properly set that. At least in epoll and select this is
the only error condition.

Metze, please check!
2009-05-19 23:51:22 +02:00
Jeremy Allison
f8da7f5d74 Added mapping table for account object in lsa.
Jeremy.
2009-05-19 14:47:25 -07:00
Volker Lendecke
f9d00fb58e Simplify the logic of tsocket_bsd_pending
Remove two indentation levels by returning early on error.

Metze, please check!
2009-05-19 23:35:16 +02:00
Jelmer Vernooij
cf9636ea99 tevent/python: Makefile was still trying to build some non AC_SUBST python targets
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
2009-05-19 23:33:00 +02:00
Volker Lendecke
ae386415b6 Make local-wbclient flexible in # of connections and ops 2009-05-19 23:09:26 +02:00
Volker Lendecke
15424162ca Fix wb_trans_done after conversion to unix calling conventions 2009-05-19 23:09:26 +02:00