nivanova/samba-autobuild/.git
5 years agos3-rpc_server: Pass the server event context to np_open().
Andreas Schneider [Wed, 23 Oct 2013 15:03:37 +0000 (17:03 +0200)]
s3-rpc_server: Pass the server event context to np_open().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos3-rpc_server: Add make_internal_rpc_pipe_socketpair().
Andreas Schneider [Wed, 25 Sep 2013 09:35:41 +0000 (11:35 +0200)]
s3-rpc_server: Add make_internal_rpc_pipe_socketpair().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos3-smbd: Do not declare change_to_root_user() twice.
Andreas Schneider [Wed, 23 Oct 2013 09:07:38 +0000 (11:07 +0200)]
s3-smbd: Do not declare change_to_root_user() twice.

This is already in include/proto.h for smbd_shim.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos3-smbd_shim: Add become_authenticated_pipe_user().
Andreas Schneider [Wed, 23 Oct 2013 09:02:39 +0000 (11:02 +0200)]
s3-smbd_shim: Add become_authenticated_pipe_user().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos3-rpc_server: Add named_pipe_client_init() function.
Andreas Schneider [Wed, 25 Sep 2013 09:34:56 +0000 (11:34 +0200)]
s3-rpc_server: Add named_pipe_client_init() function.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos3-rpc_server: Make named_pipe_packet_process a shared functiion.
Andreas Schneider [Wed, 25 Sep 2013 08:25:39 +0000 (10:25 +0200)]
s3-rpc_server: Make named_pipe_packet_process a shared functiion.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos3-rpc_server: Make make_server_pipes_struct a shared function.
Andreas Schneider [Wed, 25 Sep 2013 14:33:00 +0000 (16:33 +0200)]
s3-rpc_server: Make make_server_pipes_struct a shared function.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos3-waf: Create a target for RPC_SOCK_HELPER.
Andreas Schneider [Wed, 23 Oct 2013 08:36:57 +0000 (10:36 +0200)]
s3-waf: Create a target for RPC_SOCK_HELPER.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos3-waf: Seperate rpc_server and rpc_service.
Andreas Schneider [Wed, 23 Oct 2013 08:24:13 +0000 (10:24 +0200)]
s3-waf: Seperate rpc_server and rpc_service.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos3-waf: Reorder rpc_server wscript_build file.
Andreas Schneider [Wed, 23 Oct 2013 08:14:01 +0000 (10:14 +0200)]
s3-waf: Reorder rpc_server wscript_build file.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos3-rpc_server: Use new rpc named pipe functions.
Andreas Schneider [Tue, 24 Sep 2013 13:03:48 +0000 (15:03 +0200)]
s3-rpc_server: Use new rpc named pipe functions.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos3-rpc_server: Add make_internal_rpc_pipe().
Andreas Schneider [Tue, 24 Sep 2013 09:28:39 +0000 (11:28 +0200)]
s3-rpc_server: Add make_internal_rpc_pipe().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos3-rpc_server: Add make_external_rpc_pipe() function.
Andreas Schneider [Tue, 24 Sep 2013 09:28:29 +0000 (11:28 +0200)]
s3-rpc_server: Add make_external_rpc_pipe() function.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos3-rpc_server: Add npa_state_init() function.
Andreas Schneider [Tue, 24 Sep 2013 09:27:35 +0000 (11:27 +0200)]
s3-rpc_server: Add npa_state_init() function.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agolibcli: Add tstream_npa_socketpair() function.
Andreas Schneider [Thu, 19 Sep 2013 12:52:22 +0000 (14:52 +0200)]
libcli: Add tstream_npa_socketpair() function.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agorpc_server: Fix a memleak on error exit
Volker Lendecke [Sun, 27 Oct 2013 14:31:44 +0000 (15:31 +0100)]
rpc_server: Fix a memleak on error exit

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Oct 28 10:20:35 CET 2013 on sn-devel-104

5 years agorpc_server: Remove rpc_ep_register_state->mem_ctx
Volker Lendecke [Sun, 27 Oct 2013 14:29:43 +0000 (15:29 +0100)]
rpc_server: Remove rpc_ep_register_state->mem_ctx

We can use the state directly as a parent

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agorpc_server: Fix some uses of tevent_req_nomem
Volker Lendecke [Sun, 27 Oct 2013 14:27:45 +0000 (15:27 +0100)]
rpc_server: Fix some uses of tevent_req_nomem

tevent_req_nomem is to be used in a sequence of async actions where we
have one main request. This is a completely independent loop without one
central tevent_req. tevent_req_nomem is used as a simple way to signal
an out of memory condition to the main request representing the async
sequence. If we don't have such a tevent_req, we need to directly check
for NULL.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agorpc_server: fix a typo
Volker Lendecke [Sun, 27 Oct 2013 14:19:09 +0000 (15:19 +0100)]
rpc_server: fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoauth-kerberos: add the credentials.h so that enum credentials_obtained is defined
Matthieu Patou [Tue, 15 Oct 2013 22:06:57 +0000 (15:06 -0700)]
auth-kerberos: add the credentials.h so that enum credentials_obtained is defined

We had a warning about the enum being defined in the parameter list:
warning: ‘enum credentials_obtained’ declared inside parameter list

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Andrew Bartlet <abartlet@samba.org>
Autobuild-User(master): Matthieu Patou <mat@samba.org>
Autobuild-Date(master): Sun Oct 27 02:25:47 CET 2013 on sn-devel-104

5 years agolibrpc-idl: replace int32 by uint32 as the values are always > 0
Stefan Metzmacher [Mon, 21 Oct 2013 06:40:28 +0000 (08:40 +0200)]
librpc-idl: replace int32 by uint32 as the values are always > 0

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agolibrpc-idl: replace int32 by the enumeration as it's the type that we use in union...
Matthieu Patou [Mon, 21 Oct 2013 03:16:27 +0000 (20:16 -0700)]
librpc-idl: replace int32 by the enumeration as it's the type that we use in union's switch drsuapi_DsGetDCInfoCtrLevels

Signed-off-by: Matthieu Patou <mat@matws.net>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agotorture: add FSCTL_SRV_COPYCHUNK_WRITE access test
David Disseldorp [Sat, 19 Oct 2013 01:47:07 +0000 (03:47 +0200)]
torture: add FSCTL_SRV_COPYCHUNK_WRITE access test

Check that FSCTL_SRV_COPYCHUNK_WRITE succeeds when the copy-chunk target
is opened with SEC_RIGHTS_FILE_WRITE only.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Oct 25 22:48:59 CEST 2013 on sn-devel-104

5 years agosmb2_ioctl: add support for FSCTL_SRV_COPYCHUNK_WRITE
David Disseldorp [Sat, 19 Oct 2013 01:47:06 +0000 (03:47 +0200)]
smb2_ioctl: add support for FSCTL_SRV_COPYCHUNK_WRITE

FSCTL_SRV_COPYCHUNK can only be used when the client has the copy-chunk
target file open with FILE_WRITE_DATA and FILE_READ_DATA.
FSCTL_SRV_COPYCHUNK_WRITE requires only FILE_WRITE_DATA access on the
target, and is therefore suitable for cp --reflink, which opens the
target file O_WRONLY.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agoRevert "smbd: Move oplock/sharemode ops into one place"
Volker Lendecke [Thu, 24 Oct 2013 18:53:36 +0000 (20:53 +0200)]
Revert "smbd: Move oplock/sharemode ops into one place"

This reverts commit 7b70fa18734d9ceb020fe3e5d4cc0c26cd27a484.

This is a change in behaviour which needs much further investigation
and testing.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Oct 25 14:22:20 CEST 2013 on sn-devel-104

5 years agoRevert "smbd: Move oplock handling together"
Volker Lendecke [Thu, 24 Oct 2013 18:53:32 +0000 (20:53 +0200)]
Revert "smbd: Move oplock handling together"

This reverts commit e689b7d51e6ffd848ab10e160dca2c3a03fc750b.

This is a change in behaviour which needs much further investigation
and testing.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
5 years agowaf: parse LDFLAGS from python
Steven Siloti [Thu, 24 Oct 2013 03:46:05 +0000 (20:46 -0700)]
waf: parse LDFLAGS from python

The LDFLAGS returned by get_python_variables may contain additional library
search paths. These need to be parsed out and placed in LIBPATH to maintain
correct ordering of search paths in the final link flags.

Specifically, appending LDFLAGS directly to LINKFLAGS on my system was causing
/usr/lib to be the first search path specified. This lead to linking against
installed libraries rather than the versions from the current build.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Oct 25 02:48:35 CEST 2013 on sn-devel-104

5 years agobuild: fix ordering problems with lib-provided and internal RPATHs
Michael Adam [Wed, 16 Oct 2013 13:17:18 +0000 (15:17 +0200)]
build: fix ordering problems with lib-provided and internal RPATHs

When a library or system (like cups) provides an RPATH,
e.g. with -Wl,-R or -Wl,-rpath, this was added by waf
to the LINKFLAGS, wich was later prepended to our RPATH.
But if the path by chance contains an older version of
one of our internal libraries like talloc, this would lead
to linking the too old talloc into our binaries.

This has been observed on, e.g., FreeBSD, but it is a general
problem.

This patch fixes the problem by specially parsing the RPATH
linker options from the pkg-config(, cups-config, ....) output
and putting the paths into the RPATH_<lib> container, which
is then later correctly appended to our internal RPATH.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos4-dns: dlz_bind9: Create dns-HOSTNAME account disabled
Samuel Cabrero [Thu, 24 Oct 2013 15:37:06 +0000 (17:37 +0200)]
s4-dns: dlz_bind9: Create dns-HOSTNAME account disabled

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Oct 25 00:39:21 CEST 2013 on sn-devel-104

5 years agos4-openldap: Fixed a problem with provisioning with OpenLdap
Nadezhda Ivanova [Thu, 24 Oct 2013 20:30:05 +0000 (23:30 +0300)]
s4-openldap: Fixed a problem with provisioning with OpenLdap

Credentials are no longer used and there were too many arguments to the
constructor

Signed-off-by: Nadezhda Ivanova <nivanova@symas.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos4-dsacl: Fixed incorrect handling of privileges in sec_access_check_ds
Nadezhda Ivanova [Mon, 14 Oct 2013 23:06:38 +0000 (02:06 +0300)]
s4-dsacl: Fixed incorrect handling of privileges in sec_access_check_ds

Restore and backup privileges are not relevant to ldap
access checks, and the TakeOwnership privilege should
grant write_owner right

Signed-off-by: Nadezhda Ivanova <nivanova@symas.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agotorture: Add smb2.oplock.levelII501 test
Volker Lendecke [Tue, 22 Oct 2013 09:18:01 +0000 (09:18 +0000)]
torture: Add smb2.oplock.levelII501 test

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Thu Oct 24 16:15:50 CEST 2013 on sn-devel-104

5 years agosmbd: Move oplock handling together
Volker Lendecke [Thu, 26 Sep 2013 21:18:28 +0000 (14:18 -0700)]
smbd: Move oplock handling together

Later on we will have all the oplock/sharemode operations in one routine.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
5 years agosmbd: Move oplock/sharemode ops into one place
Volker Lendecke [Tue, 3 Sep 2013 14:02:09 +0000 (14:02 +0000)]
smbd: Move oplock/sharemode ops into one place

This makes the is_stat_open special case in grant_fsp_oplock_type
redundant because in open_file_ntcreate further up we have already set
oplock_request to NO_OPLOCK for stat opens.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
5 years agosmbd: Remove separate oplock_type parameter from set_file_oplock
Volker Lendecke [Tue, 3 Sep 2013 13:57:11 +0000 (13:57 +0000)]
smbd: Remove separate oplock_type parameter from set_file_oplock

This avoids the question where it could happen that something else but
fsp->oplock_type might be useful as an argument here.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
5 years agosmbd: Unify parameters to set_oplock_type
Volker Lendecke [Tue, 3 Sep 2013 13:27:49 +0000 (13:27 +0000)]
smbd: Unify parameters to set_oplock_type

Some lines above we set fsp->oplock_type = e->op_type. I don't see
how this might have changed. This change will unify both callers of
set_file_oplock. In the next step the second parameter to set_file_oplock
will be removed.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
5 years agosmbd: Make release_file_oplock static
Volker Lendecke [Fri, 13 Sep 2013 11:55:05 +0000 (13:55 +0200)]
smbd: Make release_file_oplock static

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
5 years agosmbd: Use remove_oplock() in close_normal_file
Volker Lendecke [Fri, 13 Sep 2013 11:49:20 +0000 (13:49 +0200)]
smbd: Use remove_oplock() in close_normal_file

remove_oplock is a wrapper around release_file_oplock. This streamlines
the exports of oplock.c a bit.

Reason for this patch: In a later patch I will add functionality to
remove_oplock that is required in close_normal_file as well.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
5 years agoFix comment showing how to print an ACL to allow debug.
Jeremy Allison [Wed, 23 Oct 2013 22:07:31 +0000 (15:07 -0700)]
Fix comment showing how to print an ACL to allow debug.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
5 years agoFix bug 10196 - RW Deny for a specific user is not overriding RW Allow for a group.
Jeremy Allison [Wed, 23 Oct 2013 22:06:40 +0000 (15:06 -0700)]
Fix bug 10196 - RW Deny for a specific user is not overriding RW Allow for a group.

Fix posix_acl tests to match the change in writing ACLs
with ID_TYPE_BOTH.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
5 years agoFix bug 10196 - RW Deny for a specific user is not overriding RW Allow for a group.
Jeremy Allison [Mon, 21 Oct 2013 23:59:11 +0000 (16:59 -0700)]
Fix bug 10196 - RW Deny for a specific user is not overriding RW Allow for a group.

When the ID returned is ID_TYPE_BOTH we must *always* add it as both
a user and a group, not just in the owning case. Otherwise DENY
entries are not correctly processed.

Confirmed by the reporter as fixing the problem.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10196

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
5 years agotorture: Extend the raw.oplock.level_ii_1 test
Volker Lendecke [Wed, 16 Oct 2013 19:34:15 +0000 (21:34 +0200)]
torture: Extend the raw.oplock.level_ii_1 test

smbd broke to none twice. Make sure this won't happen again :-)

This used to happen before the MSG_SMB_BREAK_RESPONSE merge. In
process_oplock_break_message we did not call remove_oplock, which would
have prevented this.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Oct 23 14:06:13 CEST 2013 on sn-devel-104

5 years agosmbd: Remove MSG_SMB_ASYNC_LEVEL2_BREAK
Volker Lendecke [Tue, 22 Oct 2013 11:37:45 +0000 (11:37 +0000)]
smbd: Remove MSG_SMB_ASYNC_LEVEL2_BREAK

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agosmbd: Use MSG_SMB_BREAK_REQUEST for async l2 breaks
Volker Lendecke [Tue, 22 Oct 2013 11:33:42 +0000 (11:33 +0000)]
smbd: Use MSG_SMB_BREAK_REQUEST for async l2 breaks

Now that we transmit the level we want to break to via the msg.op_type
we can unify MSG_SMB_BREAK_REQUEST and MSG_SMB_ASYNC_LEVEL2_BREAK and
thus simplify the code a bit.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agosmbd: Fix breaking level2 on OVERWRITE create_disposition
Volker Lendecke [Wed, 16 Oct 2013 19:21:56 +0000 (21:21 +0200)]
smbd: Fix breaking level2 on OVERWRITE create_disposition

This is shown by the new raw.oplock.level_ii_1 test

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agotorture: Add a test showing we have to break L2 at open time
Volker Lendecke [Tue, 15 Oct 2013 15:22:06 +0000 (15:22 +0000)]
torture: Add a test showing we have to break L2 at open time

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agosmbd: Fix raw.batch.exclusive[59]
Volker Lendecke [Thu, 26 Sep 2013 23:15:31 +0000 (16:15 -0700)]
smbd: Fix raw.batch.exclusive[59]

The level we have to break to depend on the breakers create_disposition:
If we overwrite, we have to break to none.

This patch overloads the "op_type" field in the break message we send
across to the smbd holding the oplock with the oplock level we want to
break to. Because it depends on the create_disposition in the breaking
open, only the breaker can make that decision. We might want to use
a different mechanism for this in the future, but for now using the
op_type field seems acceptable to me.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agosmbd: Remove unused "mid" from delay_for_oplock
Volker Lendecke [Thu, 26 Sep 2013 22:49:54 +0000 (15:49 -0700)]
smbd: Remove unused "mid" from delay_for_oplock

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agosmbd: Don't send op_mid in a BREAK message
Volker Lendecke [Thu, 26 Sep 2013 22:48:42 +0000 (15:48 -0700)]
smbd: Don't send op_mid in a BREAK message

The callee doesn't use this anyway

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agosmbd: Simplify send_break_message
Volker Lendecke [Thu, 26 Sep 2013 22:35:05 +0000 (15:35 -0700)]
smbd: Simplify send_break_message

We don't need an fsp here

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agosmbd: Remove unused "oplock_request" arg from send_break_message
Volker Lendecke [Thu, 26 Sep 2013 22:31:12 +0000 (15:31 -0700)]
smbd: Remove unused "oplock_request" arg from send_break_message

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agotorture: Add oplock break to l2/none tests
Volker Lendecke [Wed, 25 Sep 2013 23:02:20 +0000 (16:02 -0700)]
torture: Add oplock break to l2/none tests

The level we have to break to depends on the create disposition of the
second opener. If it's overwriting, break to none. If it's not, break
to level2.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agotorture: Check break level in raw.oplock.exclusive5
Volker Lendecke [Wed, 25 Sep 2013 22:33:42 +0000 (15:33 -0700)]
torture: Check break level in raw.oplock.exclusive5

This is what Windows does in this case, we don't survive that. We break
to LEVEL2 here. Fixes and more precise test to follow.

We don't survive this anymore. Re-enable later.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agosmbd: validate oplock types even for internal and stat opens
Volker Lendecke [Tue, 15 Oct 2013 12:41:11 +0000 (12:41 +0000)]
smbd: validate oplock types even for internal and stat opens

There's no reason why we should not do this. This has turned into a pure
internal consistency check that should apply fine every time.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agotorture: Add reproducer for bug 10216
Volker Lendecke [Fri, 18 Oct 2013 13:11:38 +0000 (13:11 +0000)]
torture: Add reproducer for bug 10216

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agosmbd: Fix bug 10216
Volker Lendecke [Fri, 18 Oct 2013 15:12:35 +0000 (15:12 +0000)]
smbd: Fix bug 10216

While refactoring find_oplock_types to validate_oplock_types I forgot
that stat opens will end up in locking.tdb. So even with a batch oplock
around we can have more than one entry. This means the consistency check
in validate_oplock_types was wrong and too strict.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agoldb: Fix CID 240798 Uninitialized pointer read
Volker Lendecke [Sun, 20 Oct 2013 15:29:29 +0000 (17:29 +0200)]
ldb: Fix CID 240798 Uninitialized pointer read

Not called right now, because nobody tries multiple sort attributes. But if
someone did, build_response would have looked at the uninitialized controls.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Oct 22 03:28:20 CEST 2013 on sn-devel-104

5 years agowinbind3: Fix CID 241468 Resource leak
Volker Lendecke [Sun, 20 Oct 2013 15:25:27 +0000 (17:25 +0200)]
winbind3: Fix CID 241468 Resource leak

We were leaking centry in this error case

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agontvfs: Fix CID 1107225 Resource leak
Volker Lendecke [Sun, 20 Oct 2013 15:16:11 +0000 (17:16 +0200)]
ntvfs: Fix CID 1107225 Resource leak

After the talloc_strdup, we don't need cwd anymore.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agontvfs: Fix Coverity ID 1107224 Resource leak
Volker Lendecke [Sun, 20 Oct 2013 15:11:16 +0000 (17:11 +0200)]
ntvfs: Fix Coverity ID 1107224 Resource leak

In this error path we were leaking "fd".

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agoidmap_autorid: fix traversal of ranges to correctly exclude mapping records.
Michael Adam [Fri, 18 Oct 2013 14:26:41 +0000 (16:26 +0200)]
idmap_autorid: fix traversal of ranges to correctly exclude mapping records.

When listing all ranges with "net idmap get ranges", the database records
of the form "S-1-5-10" --> "GID 100016" were treated here as rangee mapings,
resulting in an faulty printout like this: "RANGE 541346119: S-1-5-10".

This patch fixes this by adding a filter that checks the size of the
value datablob.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Oct 21 19:48:40 CEST 2013 on sn-devel-104

5 years agonsswitch: Fix short writes in winbind_write_sock
Volker Lendecke [Tue, 15 Oct 2013 08:23:10 +0000 (08:23 +0000)]
nsswitch: Fix short writes in winbind_write_sock

We set the socket to nonblocking and don't handle EAGAIN right. We do
a poll anyway, so wait for writability, which should fix this.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10195
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agos3-rpc_server: Refactor lsasd_create_sockets().
Andreas Schneider [Mon, 21 Oct 2013 06:26:47 +0000 (08:26 +0200)]
s3-rpc_server: Refactor lsasd_create_sockets().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Oct 21 12:49:44 CEST 2013 on sn-devel-104

5 years agolsasd: Fix CID 1107233 Double close
Volker Lendecke [Sun, 20 Oct 2013 15:37:08 +0000 (17:37 +0200)]
lsasd: Fix CID 1107233 Double close

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agowinbind3: Fix CID 1107229 Uninitialized pointer read
Volker Lendecke [Wed, 16 Oct 2013 19:02:42 +0000 (21:02 +0200)]
winbind3: Fix CID 1107229 Uninitialized pointer read

The first "goto done" would TALLOC_FREE the uninitialized "value"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Oct 19 03:43:04 CEST 2013 on sn-devel-104

5 years agoscript/mks3param_ctx_table.pl: fix tabs/whitespaces in generated output.
Stefan Metzmacher [Thu, 17 Oct 2013 07:28:57 +0000 (09:28 +0200)]
script/mks3param_ctx_table.pl: fix tabs/whitespaces in generated output.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Oct 18 16:20:01 CEST 2013 on sn-devel-104

5 years agoReserve an OID space for external projects
Simo Sorce [Thu, 17 Oct 2013 19:59:55 +0000 (15:59 -0400)]
Reserve an OID space for external projects

Some external, but somewhat related projects, benefit from being
able to use the Samba OID space instead of having to go through IANA.

Reserve 1.3.6.1.4.1.7165.655.x for external projects
And assign 1.3.6.1.4.1.7165.655.1.x to the GSS-NTLMSSP project.

Signed-off-by: Simo Sorce <idra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Simo Sorce <idra@samba.org>
Autobuild-Date(master): Fri Oct 18 05:47:29 CEST 2013 on sn-devel-104

5 years agos3:nmbd: do a very early cluster probe when starting nmbd.
Michael Adam [Thu, 17 Oct 2013 13:19:41 +0000 (15:19 +0200)]
s3:nmbd: do a very early cluster probe when starting nmbd.

Just as for smbd and winbindd

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Oct 18 01:17:14 CEST 2013 on sn-devel-104

5 years agos3:winbindd: use cluster_probe_ok()
Michael Adam [Thu, 17 Oct 2013 13:16:19 +0000 (15:16 +0200)]
s3:winbindd: use cluster_probe_ok()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agos3:smbd: use new function cluster_probe_ok()
Michael Adam [Thu, 17 Oct 2013 13:15:51 +0000 (15:15 +0200)]
s3:smbd: use new function cluster_probe_ok()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agos3: add cluster_probe_ok() in a new module util_cluster.
Michael Adam [Thu, 17 Oct 2013 13:10:11 +0000 (15:10 +0200)]
s3: add cluster_probe_ok() in a new module util_cluster.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agosmbd/winbindd: Do an early check if ctdbd is functional
Volker Lendecke [Thu, 31 Jan 2013 10:15:09 +0000 (11:15 +0100)]
smbd/winbindd: Do an early check if ctdbd is functional

This will avoid panic calls when smbd and winbind is started in cluster
mode before ctdb is functional. It still logs something sane at debug
level 0, but it does not panic and core anymore.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoctdbd_conn: Remove one call to cluster_fatal
Volker Lendecke [Thu, 31 Jan 2013 10:02:52 +0000 (11:02 +0100)]
ctdbd_conn: Remove one call to cluster_fatal

This is during startup of a ctdb connection, thus it is not as important
as in other cases to immediately exit to free up resources

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoctdbd_conn: Remove one call to cluster_fatal
Volker Lendecke [Thu, 31 Jan 2013 10:02:52 +0000 (11:02 +0100)]
ctdbd_conn: Remove one call to cluster_fatal

This is during startup of a ctdb connection, thus it is not as important
as in other cases to immediately exit to free up resources

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoctdbd_conn: Lift the cluster_fatal call in get_cluster_vnn
Volker Lendecke [Thu, 31 Jan 2013 09:54:48 +0000 (10:54 +0100)]
ctdbd_conn: Lift the cluster_fatal call in get_cluster_vnn

We have to report a proper error when ctdbd is not around

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:libsmb: call smbXcli_tcon_set_fs_attributes() directly
Stefan Metzmacher [Fri, 27 Sep 2013 04:06:32 +0000 (06:06 +0200)]
s3:libsmb: call smbXcli_tcon_set_fs_attributes() directly

We should try to set all attributes we got and not just
FILE_CASE_SENSITIVE_SEARCH.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Oct 17 19:02:03 CEST 2013 on sn-devel-104

5 years agos3:libsmb: remove unused cli_state->case_sensitive
Stefan Metzmacher [Fri, 27 Sep 2013 03:45:21 +0000 (05:45 +0200)]
s3:libsmb: remove unused cli_state->case_sensitive

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:libsmb: remove unused cli_state->dfsroot
Stefan Metzmacher [Wed, 18 Sep 2013 07:40:08 +0000 (09:40 +0200)]
s3:libsmb: remove unused cli_state->dfsroot

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:libsmb: add SMB2/3 support to cli_dfs_get_referral()
Stefan Metzmacher [Sun, 13 Oct 2013 14:54:18 +0000 (16:54 +0200)]
s3:libsmb: add SMB2/3 support to cli_dfs_get_referral()

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3/libsmb: make use of smbXcli_tcon_is_dfs_share()
Stefan Metzmacher [Fri, 27 Sep 2013 03:44:33 +0000 (05:44 +0200)]
s3/libsmb: make use of smbXcli_tcon_is_dfs_share()

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3/libsmb: Use smbXcli_conn_dfs_supported instead of test on CAP_DFS
Luk Claes [Fri, 17 May 2013 18:46:24 +0000 (20:46 +0200)]
s3/libsmb: Use smbXcli_conn_dfs_supported instead of test on CAP_DFS

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200

Signed-off-by: Luk Claes <luk@debian.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos3:libsmb: don't pass down FLAG_CASELESS_PATHNAMES and FLAGS2_DFS_PATHNAMES anymore
Stefan Metzmacher [Fri, 27 Sep 2013 03:34:12 +0000 (05:34 +0200)]
s3:libsmb: don't pass down FLAG_CASELESS_PATHNAMES and FLAGS2_DFS_PATHNAMES anymore

They're now handled at the smbXcli_conn and smbXcli_tcon layer.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:libsmb: call smbXcli_tcon_{get,set}_fs_attributes() from cli_set_case_sensitive()
Stefan Metzmacher [Fri, 27 Sep 2013 03:11:45 +0000 (05:11 +0200)]
s3:libsmb: call smbXcli_tcon_{get,set}_fs_attributes() from cli_set_case_sensitive()

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agolibcli/smb: add SMB2_HDR_FLAG_DFS for SMB2 Create operations on dfs shares
Stefan Metzmacher [Wed, 18 Sep 2013 01:50:42 +0000 (03:50 +0200)]
libcli/smb: add SMB2_HDR_FLAG_DFS for SMB2 Create operations on dfs shares

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agolibcli/smb: add FLAG_CASELESS_PATHNAMES based on FILE_CASE_SENSITIVE_SEARCH to smb1...
Stefan Metzmacher [Fri, 27 Sep 2013 03:31:07 +0000 (05:31 +0200)]
libcli/smb: add FLAG_CASELESS_PATHNAMES based on FILE_CASE_SENSITIVE_SEARCH to smb1 requests

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agolibcli/smb: move Filesystem Attributes defines to smb_constants.h
Stefan Metzmacher [Fri, 27 Sep 2013 03:30:03 +0000 (05:30 +0200)]
libcli/smb: move Filesystem Attributes defines to smb_constants.h

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agolibcli/smb: add FLAGS2_DFS_PATHNAMES for SMB1 operations against dfs shares
Stefan Metzmacher [Wed, 18 Sep 2013 01:31:33 +0000 (03:31 +0200)]
libcli/smb: add FLAGS2_DFS_PATHNAMES for SMB1 operations against dfs shares

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agolibcli/smb: add smbXcli_tcon_{set,get}_fs_attributes()
Stefan Metzmacher [Fri, 27 Sep 2013 03:02:09 +0000 (05:02 +0200)]
libcli/smb: add smbXcli_tcon_{set,get}_fs_attributes()

These are the attributes returned from the FileFsAttributeInformation
request.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agolibcli/smb: add smbXcli_tcon_is_dfs_share()
Stefan Metzmacher [Fri, 13 Sep 2013 09:07:32 +0000 (11:07 +0200)]
libcli/smb: add smbXcli_tcon_is_dfs_share()

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agolibcli/smb: Introduce smbXcli_conn_dfs_supported
Luk Claes [Fri, 17 May 2013 18:41:45 +0000 (20:41 +0200)]
libcli/smb: Introduce smbXcli_conn_dfs_supported

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200

Signed-off-by: Luk Claes <luk@debian.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:libsmb: make use of smb1cli_tcon_set_values()
Stefan Metzmacher [Fri, 13 Sep 2013 07:10:42 +0000 (09:10 +0200)]
s3:libsmb: make use of smb1cli_tcon_set_values()

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3/libsmb: Use smbXcli_conn_use_unicode instead of smb1 specific test
Luk Claes [Fri, 17 May 2013 18:13:50 +0000 (20:13 +0200)]
s3/libsmb: Use smbXcli_conn_use_unicode instead of smb1 specific test

Signed-off-by: Luk Claes <luk@debian.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoauth:credentials: avoid talloc_reference in cli_credentials_set_netlogon_creds()
Stefan Metzmacher [Fri, 20 Sep 2013 02:33:07 +0000 (04:33 +0200)]
auth:credentials: avoid talloc_reference in cli_credentials_set_netlogon_creds()

Typically cli_credentials_set_netlogon_creds() should be used directly
before the DCERPC bind. And cli_credentials_get_netlogon_creds()
should be only used by the gensec layer, which only needs a copy.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Oct 16 23:56:01 CEST 2013 on sn-devel-104

5 years agos4:librpc: let dcerpc_schannel_key_recv() return netlogon_creds_CredentialState
Stefan Metzmacher [Fri, 20 Sep 2013 02:16:00 +0000 (04:16 +0200)]
s4:librpc: let dcerpc_schannel_key_recv() return netlogon_creds_CredentialState

cli_credentials_set_netlogon_creds() should only be used directly before
a DCERPC bind in order to pass the session information to the
gensec layer.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos4:librpc: make dcerpc_schannel_key_send/recv static
Stefan Metzmacher [Fri, 20 Sep 2013 02:14:00 +0000 (04:14 +0200)]
s4:librpc: make dcerpc_schannel_key_send/recv static

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos3:libsmb: inline trust_pw_change_and_store_it() into trust_pw_find_change_and_store_it()
Stefan Metzmacher [Mon, 2 Sep 2013 18:19:28 +0000 (20:19 +0200)]
s3:libsmb: inline trust_pw_change_and_store_it() into trust_pw_find_change_and_store_it()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos3:libsmb: remove unused change_trust_account_password()
Stefan Metzmacher [Mon, 2 Sep 2013 18:18:39 +0000 (20:18 +0200)]
s3:libsmb: remove unused change_trust_account_password()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos3:auth_domain: remove dead code in check_trustdomain_security()
Stefan Metzmacher [Tue, 27 Aug 2013 10:09:51 +0000 (12:09 +0200)]
s3:auth_domain: remove dead code in check_trustdomain_security()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos3:include: fix messaging_send_buf() protype in messages.h
Stefan Metzmacher [Mon, 2 Sep 2013 17:29:05 +0000 (19:29 +0200)]
s3:include: fix messaging_send_buf() protype in messages.h

The function already used 'uint8_t' instead of 'uint8'.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos3:include: add forward declaration for struct messaging_context; in g_lock.h
Stefan Metzmacher [Mon, 2 Sep 2013 07:24:42 +0000 (09:24 +0200)]
s3:include: add forward declaration for struct messaging_context; in g_lock.h

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>