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

31069 Commits

Author SHA1 Message Date
Ralph Boehme
4a0ae592f5 s4:torture: add wrapper functions
Add wrapper functions that connect two trees with sharenames taken
from passed option.

Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-08-18 17:42:50 +02:00
Ralph Boehme
e935c62657 s4:torture: add boilerplate code for testing specific VFS modules
Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-08-18 17:42:50 +02:00
Ralph Boehme
ed81d09ade s4:torture:smb2: add utility function torture_smb2_con_sopt()
Add a utility function that takes an option name as parameter and then
uses the value of the option 'torture:NAME' as share name in a tree
connect.

Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-08-18 17:42:50 +02:00
Michael Adam
335171ef07 s4:torture: use torture_assert instead of torture_comment and return in defer_open test
The fix missed one instance, as autobuild has just told me...

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Aug 18 17:42:00 CEST 2014 on sn-devel-104
2014-08-18 17:42:00 +02:00
Andrew Bartlett
3dfca72dba dsdb: Also redact the clearTextPassword input-only attribute
We go to a great deal of effort to avoid administrators posting their
passwords in Samba logs, and one of the ways we do that is to remove
them from internal ldif dumps Samba produces while operating as an AD
DC.

clearTextPassword is not a real attribute, but it functions as one for
an input path.

Change-Id: Iaacf3354fc9bfff18d6774f49b17a9ba962347d5
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Aug 16 01:05:07 CEST 2014 on sn-devel-104
2014-08-16 01:05:07 +02:00
Jelmer Vernooij
6243b24ed5 librpc: Remove obsolete idl-deps script.
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Aug 15 05:47:51 CEST 2014 on sn-devel-104
2014-08-15 05:47:51 +02:00
Ira Cooper
38de110b02 third_party/popt: Initial support for popt.
ctdb, ldb, and samba are supported builds for third_party popt.

Signed-off-by: Ira Cooper <ira@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-09 18:26:17 +02:00
Andreas Schneider
0e45b40511 s4-auth: Initialize the tokens by default.
Found with valgrind.

Signed-off-by: Andreas Schneider <asn@samba.org>
Pair-Programmed-With: Guenther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Aug  8 19:01:56 CEST 2014 on sn-devel-104
2014-08-08 19:01:56 +02:00
Günther Deschner
cef0ee28ec s4-dsdb/cracknames: free realm from smb_krb5_principal_get_realm().
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-08-08 16:37:36 +02:00
Andreas Schneider
3913961546 wscript: Only build gensec_krb5 with heimdal.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-08-08 16:37:35 +02:00
Günther Deschner
9c5470be1e lib/krb5_wrap: provide krb5_warnx() replacement.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Aug  8 08:30:50 CEST 2014 on sn-devel-104
2014-08-08 08:30:50 +02:00
Günther Deschner
0e255497d2 lib/krb5_wrap: add smb_krb5_principal_get_type().
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-08-08 06:02:35 +02:00
Günther Deschner
763cae60c3 lib/krb5_wrap: add smb_krb5_principal_set_realm().
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-08-08 06:02:35 +02:00
Günther Deschner
d487bce3ab s4-gensec_krb5: fix memleak in gensec_krb5_session_info().
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-08-08 06:02:35 +02:00
Günther Deschner
9fed7ed00e lib/krb5_wrap: add krb5_copy_data_contents.
This reuses krb5_data_copy() if available, choosed not to call it
krb5_data_copy as that is easily mixed up with krb5_copy_data (which allocs the
krb5_data pointer). Thanks Simo for proposing the better name.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-08-08 06:02:35 +02:00
Günther Deschner
57b6517441 s4-heimdal: fix krb5_get_init_creds_opt_set_process_last_req().
Most probably just a copy/paste error.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-08-08 06:02:35 +02:00
Günther Deschner
759c9b03e4 s4-auth/kerberos: add a note how to implement krb5_get_init_creds_opt_set_win2k() with MIT.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-08-08 06:02:35 +02:00
Günther Deschner
7f61950398 s4-kerberos: remove duplicate macros.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-08-08 06:02:34 +02:00
Günther Deschner
feabae7417 s4-dsdb/samdb: use smb_krb5_principal_get_comp_string in ldb ACL module.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-08-08 06:02:34 +02:00
Günther Deschner
5c663685eb lib/krb5_wrap: move krb5_princ_size replacement code to lib/krb5_wrap/krb5_samba.c.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-08-08 06:02:34 +02:00
Günther Deschner
3d56bcc1de s4-torture: use smb_krb5_get_allowed_weak_crypto() in remote PAC test.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Andreas Schneider <asn@samba.org>
2014-08-08 06:02:34 +02:00
Günther Deschner
561c74666a lib/krb5_wrap: add smb_krb5_get_allowed_weak_crypto().
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Andreas Schneider <asn@samba.org>
2014-08-08 06:02:34 +02:00
Günther Deschner
22c6766693 samba: use smb_krb5_create_key_from_string() in some places.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Andreas Schneider <asn@samba.org>
2014-08-08 06:02:34 +02:00
Günther Deschner
3f7b80f691 s4-dsdb/samdb: use smb_krb5_make_principal for compatibility reasons with MIT.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-08-08 06:02:34 +02:00
Michael Adam
a6e098fb22 s4:torture: use torture_assert instead of torture_comment and return in defer_open test
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-07 22:12:12 +02:00
Michael Adam
3f422177ce s4:torture: consistently log "pid %u: ..." in the defer_open test
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-07 22:12:12 +02:00
Michael Adam
5c6a1da82c s4:torture: remove an unused variable and bogus check from the defer_open test
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-07 22:12:12 +02:00
Volker Lendecke
f77c3a65db libcli: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-07-31 18:49:46 +02:00
Volker Lendecke
83eac53c03 smbd4: Remove process_model_thread
This code has not seen any use or development for a while. While probably
being a good source of inspiration, it will inevitably bit-rot. To really
get to a multi-threaded process model, many of the Samba libraries have
to be made thread-safe.

Why this patch? Right now I am trying to clean up our debug system,
and process_thread.c is the only reference to the _suspicious_ functions
in debug.c. The alternative would be to factor those out of debug, but
as this code is unused for so long, the alternative approach is to just
remove it.

If someone wants to restart development on a threaded process model,
the code is still around in the git history and can be resurrected easily.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-07-31 13:58:10 +02:00
Amitay Isaacs
4b4e30b780 s4-rpc: dnsserver: Allow . to be specified for @ record
Windows allow both . and @ to be specified with modifying @ record.

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-07-29 17:11:08 +02:00
Volker Lendecke
d697c9fdcb messaging4: Simplify imessaging_path
Use server_id_str_buf

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 Jul 29 00:30:55 CEST 2014 on sn-devel-104
2014-07-29 00:30:55 +02:00
Volker Lendecke
f5efddb9ae lib: directory_create_or_exist() does not use "uid" parameter
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-07-28 22:04:13 +02:00
Volker Lendecke
f7fb9e24b3 messaging4: Simplify ping_message with server_id_str_buf()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-07-24 21:41:10 +02:00
Anubhav Rakshit
017db6d0f8 torture: Add FSCTL_QUERY_NETWORK_INTERFACE_INFO torture test case to source4/torture/smb2/ioctl.c
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Anubhav Rakshit <anubhav.rakshit@gmail.com>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-07-24 19:07:06 +02:00
Volker Lendecke
dbc1ad2965 torture4: Use sizeof(char-array) instead of constant
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-07-24 19:07:06 +02:00
Stefan Metzmacher
1250d62f69 s4:torture/smb2: add smb2.session.bind1
This is a very simple multi-channel test

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-07-24 19:07:06 +02:00
Stefan Metzmacher
720189f246 s4:libcli/smb2: add smb2_session_channel()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-07-24 19:07:06 +02:00
Stefan Metzmacher
78e46d7349 s4:libcli/smb2: remove unused 'primary' argument of smb2_session_init()
This also gets rid of a talloc_reference() usage.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-07-24 19:07:05 +02:00
Volker Lendecke
a017280ca5 messaging4: Fix a just-introduced error memleak
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Jul 22 15:31:38 CEST 2014 on sn-devel-104
2014-07-22 15:31:38 +02:00
Volker Lendecke
1dd64341d8 messaging4: Change irpc_servers_by_name to NTSTATUS
For me, counted arrays are easier to deal with than NULL-terminated
ones. Here we also had a "server_id_is_disconnection" convention, which
was not really obvious.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Jul 21 20:28:53 CEST 2014 on sn-devel-104
2014-07-21 20:28:53 +02:00
Volker Lendecke
53d1bbd20d messaging4: Fix a memleak in an error path
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-07-21 18:00:10 +02:00
Volker Lendecke
fe79d759da messaging4: Remove unnecessary locking
We don't do any modifying operations on the database, so locking is not
needed here

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-07-21 18:00:10 +02:00
Volker Lendecke
e64359ceb7 messaging4: Remove an unused NTSTATUS var
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-07-21 18:00:10 +02:00
Volker Lendecke
5db77591f5 messaging4: Move str_list_add
If this fails, we'd have to revert the tdb_append. str_list_remove is
simpler :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-07-21 18:00:10 +02:00
Volker Lendecke
1603d2df59 messaging4: Add NULL check to irpc_add_name
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-07-21 18:00:10 +02:00
Volker Lendecke
658b7ec4ee messaging4: Use tdb_append in irpc_add_name
This makes the custom locking code unnecessary here

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-07-21 18:00:10 +02:00
Stefan Metzmacher
d90f3323ee s4:torture/rpc: add rpc.netlogon.ServerReqChallengeGlobal
This demonstrates that the challenge table should be global.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sat Jul 19 12:51:39 CEST 2014 on sn-devel-104
2014-07-19 12:51:39 +02:00
Stefan Metzmacher
321ebc99b5 s4:rpc_server/netlogon: keep a global challenge table
Some clients call netr_ServerReqChallenge() and netr_ServerAuthenticate3()
on different connections. This works against Windows DCs as they
have a global challenge table.

A VMware provisioning task for Windows VMs seemy to rely on this behavior.

As a fallback we're storing the challenge in a global memcache with a fixed
size. This should allow these strange clients to work against a
Samba AD DC.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-07-19 10:25:05 +02:00
Stefan Metzmacher
04e9d020c9 s4:dsdb/samldb: don't allow 'userParameters' to be modified over LDAP for now
For now it's safer to reject setting 'userParameters' via LDAP,
as we'll not provide the same behavior as a Windows Server.

If someone requires that feature please report this in the following
bug reports!

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

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

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Jul  9 11:07:51 CEST 2014 on sn-devel-104
2014-07-09 11:07:51 +02:00
Andrew Bartlett
d7b4d10aba dsdb: Always store and return the userParameters as a array of LE 16-bit values
This is not allowed to be odd length, as otherwise we can not send it over the SAMR transport correctly.

Allocating one byte less memory than required causes malloc() heap corruption
and then a crash or lockup of the SAMR server.

Andrew Bartlett

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10130
Change-Id: I5c0c531c1d660141e07f884a4789ebe11c1716f6
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2014-07-09 08:42:08 +02:00
Andrew Bartlett
1592eaa5c7 dsdb: Set syntax of userParameters to binary string, not unicode string
This means we continue to store the values as given on SAMR, assuming
that the SAMR buffer is little endian.  The syntax for this specific
object is forced to be a binary blob, so that it is not converted on
DRSUAPI.

This commit does not fix existing databases, nor pdb_samba_dsdb (used
by classicupgrade).

Andrew Bartlett

Bug: https://bugzilla.samba.org/show_bug.cgi?id=8077
Change-Id: I10bb6aaecc381194e3c0ce6b9163f961acbdcee1
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2014-07-09 08:42:07 +02:00
Stefan Metzmacher
d64bc6c9af s4:dsdb/repl_meta_data: make sure objectGUID can't be deleted
Bug: https://bugzilla.samba.org/show_bug.cgi?id=9763

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-07-09 08:42:07 +02:00
Stefan Metzmacher
9e6349f81e s4:dsdb/extended_dn_in: don't force DSDB_SEARCH_SHOW_RECYCLED
We should take the controls the caller provided when we search
for existing objects.

A search with a basedn of '<GUID=....>' should result in LDB_ERR_NO_SUCH_OBJECT
is the object has isDeleted=TRUE.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-07-09 08:42:07 +02:00
Stefan Metzmacher
fa177273b8 s4:dsdb/kcc: use SHOW_RECYCLED instead of SHOW_DELETED in when deleting tombstone/deleted objects
SHOW_RECYCLED implies SHOW_DELETED.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-07-09 08:42:07 +02:00
Stefan Metzmacher
26fa0b97d0 s4:dsdb/schema_load: make error message more verbose
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-07-09 08:42:07 +02:00
Samuel Cabrero
caa42ed385 s4-auth-krb: Fix talloc access after free in smb_krb5_update_keytab
Change-Id: Iaa168d520f124e0c43c7edd649318f0b8ee25020
Signed-off-by: Samuel Cabrero <scabrero@zentyal.com>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Kamen Mazdrashki <kamenim@samba.org>
Autobuild-Date(master): Tue Jul  8 16:51:09 CEST 2014 on sn-devel-104
2014-07-08 16:51:09 +02:00
Jeremy Allison
c324b9f03f s4: torture: Add a new lock test to show that the Samba SMB1 multi-lock implementation is (currently) correct.
Needed as there was a proposal to re-architect
our multi-lock to dispense with lock order precedence,
which isn't how Windows does it (unfortunately,
as the new code would have been cleaner :-).
Tested against the Win2k12 SMB1 implementation.

This test is designed to show that
lock precedence on the server is based
on the order received, not on the ability
to grant. For example:

A blocked lock request containing 2 locks
will be satified before a subsequent blocked
lock request over one of the same regions,
even if that region is then unlocked. E.g.

(a) lock 100->109, 120->129 (granted)
(b) lock 100->109, 120-129 (blocks)
(c) lock 100->109          (blocks)
(d) unlock 100->109

lock (c) will not be granted as lock (b)
will take precedence.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jul  8 10:16:59 CEST 2014 on sn-devel-104
2014-07-08 10:16:59 +02:00
Volker Lendecke
21d09dc7b8 torture4: Add trivial epoch test
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Jul  7 18:36:37 CEST 2014 on sn-devel-104
2014-07-07 18:36:37 +02:00
Volker Lendecke
8b9f96e83b torture4: Add smb2.lease.nobreakself
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-07-07 16:08:12 +02:00
Volker Lendecke
b597d47241 torture4: Add a test to break a handle twice
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-07-07 16:08:12 +02:00
Volker Lendecke
296739d655 torture4: Make sure we copy the parent_lease_key
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-07-07 16:08:12 +02:00
Samuel Cabrero
ee32bc2cfb Order switch statements
Signed-off-by: Samuel Cabrero <scabrero@zentyal.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Jul  7 07:47:44 CEST 2014 on sn-devel-104
2014-07-07 07:47:44 +02:00
Samuel Cabrero
d747372d28 idl:drsuapi: Manage all possible lengths of drsuapi_DsBindInfo
Signed-off-by: Samuel Cabrero <scabrero@zentyal.com>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
2014-07-07 05:22:33 +02:00
Andrew Bartlett
0b77cd969c s4-auth: Do not override the NT_STATUS_NOT_IMPLEMENTED error for winbindd
This changes the auth code in winbindd to use this as a flag, and to
therefore contact the RW DC.

Change-Id: If4164d27b57b453b398642fdf7d46d03cd0e65f2
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
2014-07-04 02:52:35 +02:00
Garming Sam
5d069a04fc selftest: Make the wbinfo userinfo tests work properly with the qualified name
This eliminates a knownfail.

Change-Id: I7331a4e62ef8c1f2a9999a78865023ae19beeaca
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
2014-07-04 02:52:35 +02:00
Andrew Bartlett
a0105b84b8 secrets: Ensure we store the secureChannelType when written to secrets.ldb
This will allow winbindd to know when we are an RODC
without needing to dig into sam.ldb.

Change-Id: Ibdfa37fe6269305ccc5db42479f4a8db5eea53f3
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
2014-07-04 02:52:35 +02:00
Volker Lendecke
0c97b7eb53 torture4: Make raw.lock.multilock fail after 20 seconds
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): Fri Jul  4 00:04:10 CEST 2014 on sn-devel-104
2014-07-04 00:04:10 +02:00
Volker Lendecke
4205463ef1 torture4: Adapt comment to code
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-07-03 21:41:12 +02:00
Jeremy Allison
64346a134d s4: smbtorture: Add multi-lock test. Regression test for bug #10684.
Bug #10684 - SMB1 blocking locks can fail notification on unlock, causing client timeout.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2014-07-03 21:41:12 +02:00
Volker Lendecke
4709373cdf torture: Add a check to verify MS-SMB2 3.3.5.14.2
If we have more than one lock and there is any blocking lock, we need
to fail with NT_STATUS_INVALID_PARAMETER. At a quick glance I did not
find this tested, so add it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-07-02 00:11:23 +02:00
Volker Lendecke
8fa0cde05f torture4: Add a little test that truncate actually works :-)
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): Wed Jun 25 13:37:24 CEST 2014 on sn-devel-104
2014-06-25 13:37:24 +02:00
Jeremy Allison
c4f7c02137 s4: torture: Add regression test case for #10671 - Samba file corruption as a result of failed lock check.
Adds a new test to raw.open.

Opens a file with SHARE_NONE, writes 1 byte at offset 1023,
attempts a second open with r/w access+truncate disposition,
then checks that open fails with SHARING_VIOLATION, and
the file is not truncated (is still size 1024). Correctly
detects the bug and fixed smbd for me.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-06-25 11:22:12 +02:00
Andrew Bartlett
f45f2d0116 torture: Remove confusing reference to (1 sec == 0.25)
The write should never update the time, so the fraction of the write
time delay we use is not important.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jun 24 01:44:06 CEST 2014 on sn-devel-104
2014-06-24 01:44:06 +02:00
Andrew Bartlett
f3f2b52f9f torture: tidy up whitespace for clarity
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-23 23:30:14 +02:00
Andrew Bartlett
00a83effc1 selftest: Run base.delaywrite against plugin_s4_dc only, and with kerberos for faster connections
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-23 23:30:14 +02:00
Andrew Bartlett
0e224698f7 torture-base.delaywrite: assert the for a delayed write, that it just takes longer than our configured delay
This removes the hardcoded TIMEDELAY_SECS that was then made variable
by the confusing "secs" variable

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-23 23:30:14 +02:00
Andrew Bartlett
f407f58fd3 torture: Only error if the write time was updated is less than the expected delay
The previous test was far, far too tight, it was in seconds 1/4 of the
fraction of the normal delay we had configured Samba to use so (1/4) *
(500 000 / 2000 000) = 1/16 (sec).  This margin appears to just be too
tight for our loaded test server.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-23 23:30:14 +02:00
Andrew Bartlett
24a73bb526 torture: Store writetimeupdatedelay in a double to allow easier comparison
In particular, this avoids a comparison with
double diff = timeval_elapsed() being promoted to an integer.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-23 23:30:14 +02:00
Andrew Bartlett
dbe07a49c7 torture: convert raw.mux to use torture_comment() macros instead of printf()
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-23 23:30:13 +02:00
Andrew Bartlett
794eb404e7 torture: convert raw.mux to use torture_assert() macros
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-23 23:30:13 +02:00
Andrew Bartlett
567e0a88db torture: convert CHECK_STATUS into torture_assert_ntstatus_equal in raw.mux tests
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-23 23:30:13 +02:00
Andrew Bartlett
456c6164e9 selftest: Only run samba4.rpc.samr.passwords.{lockout,badpwdcount} once
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-23 23:30:13 +02:00
Andrew Bartlett
0e003b3cc3 torture: Use torture_assert() macros in rpc.samr test
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-23 23:30:13 +02:00
David Disseldorp
f52158d740 torture: add FSRVP share snapshot ACL test
The new test_fsrvp_share_sd test sets a unique ACL on the base share,
and then confirms that snapshot shares carry the same ACL.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Sat Jun 21 15:10:12 CEST 2014 on sn-devel-104
2014-06-21 15:10:12 +02:00
David Disseldorp
b8b4d88846 torture: add FSRVP message sequence timeout test
Sleep at various points in the FSRVP snapshot creation state machine,
and confirm that the state timeout is reflected in subsequent server
responses.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-06-21 12:42:10 +02:00
David Disseldorp
3d65bfe0fa torture: add timeout sleeps to fsrvp create helper
Attempt to trip message sequence timeouts at various points in the FSRVP
shadow-copy creation state machine.

The default timeout-injection sleep durations correspond to those
documented in MS-FSRVP (+500ms). They can also be manually set using the
"fss: sequence timeout" parameter.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-06-21 12:42:10 +02:00
David Disseldorp
c9cac858d2 torture: validate FSCTL_SRV_ENUMERATE_SNAPSHOTS response
Check the NumberOfSnapShotsReturned and SnapShotArraySize fields in the
FSCTL_SRV_ENUMERATE_SNAPSHOTS response match expected values.

This is a regression test for bso#10549.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-06-21 12:42:10 +02:00
Jeremy Allison
937d35bd18 s4: torture : Add test case to show that a bad impersonation level causes an error on a regular file open.
An invalid impersonation level is only allowed for durable handle reopen.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jun 18 09:42:43 CEST 2014 on sn-devel-104
2014-06-18 09:42:42 +02:00
Andrew Bartlett
37e7b5a1b0 torture: convert torture_comment() -> torture_result() so we can knownfail flapping base.delaywrite tests
This only changes instances directly before a return false, ret =
false or goto fail statement.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Jun 12 10:39:38 CEST 2014 on sn-devel-104
2014-06-12 10:39:38 +02:00
Andrew Bartlett
89134fa05e torture: convert torture_comment() -> torture_result() so we can knownfail flapping base.* tests
This only changes instances directly before a return false, ret =
false or goto fail statement.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-06-12 08:11:42 +02:00
Volker Lendecke
1dda098401 libsmb: Put the "smb2_lease" struct into idl
This will make it easier in the future to NDR_PRINT a lease and
a lease key

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun 12 03:34:41 CEST 2014 on sn-devel-104
2014-06-12 03:34:41 +02:00
Andrew Bartlett
f4ab082d2b librpc/idl: Merge wbint.idl with winbind.idl so we can forward IRPC requests to internal winbind calls
Change-Id: Iba3913d5a1c7f851b93f37e9beb6dbb20fbf7e55
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-06-11 10:18:26 +02:00
Andrew Bartlett
597d2a7a29 auth: Provide a way to use the auth stack for winbindd authentication
This adds in flags that allow winbindd to request authentication
without directly calling into the auth_sam module.

That in turn will allow winbindd to call auth_samba4 and so permit
winbindd operation in the AD DC.

Andrew Bartlett

Change-Id: I27d11075eb8e1a54f034ee2fdcb05360b4203567
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-06-11 10:18:26 +02:00
Andrew Bartlett
791c38282d dsdb: Do not refresh the schema using the wrong event context
What we now do is have the refresh function and module be on a
seperate object to the schema, only referring to the data and
not excuting on the original ldb and event loop.

That is, we never use another ldb context when calling the
refresh function, by binding the refresh handler to the
ldb and not the schema.

Andrew Bartlett

Change-Id: I5c323dda743cf5858badd01147fda6227599bc16
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-06-11 10:18:26 +02:00
Andrew Bartlett
8327321225 dsdb: Do not store a struct ldb_dn in struct schema_data
The issue is that the DN contains a pointer to the ldb it belongs to,
and if this is not kept around long enough, we might reference memory
after it is de-allocated.

Andrew Bartlett

Change-Id: I040a6c37a3164b3309f370e32e598dd56b1a1bbb
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-06-11 10:18:26 +02:00
Volker Lendecke
7c2b5e77b0 Use GUID_equal in a few places
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-10 19:19:13 +02:00
Jeremy Allison
463311422c s3/s4: smbd, rpc, ldap, cldap, kdc services.
Allow us to start if we bind to *either* :: or 0.0.0.0.

Allows us to cope with systems configured as only IPv4
or only IPv6.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-By: Amitay Isaacs <amitay@gmail.com>
Reviewed-By: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Jun  7 01:01:44 CEST 2014 on sn-devel-104
2014-06-07 01:01:43 +02:00
Volker Lendecke
7f36828fcc librpc: Fix a "ignoring asprintf return" warning
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>

Autobuild-User(master): Kamen Mazdrashki <kamenim@samba.org>
Autobuild-Date(master): Thu Jun  5 22:28:16 CEST 2014 on sn-devel-104
2014-06-05 22:28:16 +02:00
Andrew Bartlett
a23c62add4 s4-messaging: Make header guard less generic
Change-Id: I659bbb317e69aee6632db8bce3c4bdb5f9ad3d8d
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-06-04 03:22:26 +02:00
Andrew Bartlett
57228317fc winbind: Fix template homedir to match source3
Fix provided by Andy Igoshin <ai@vsu.ru>

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10324

Andrew Bartlett

Change-Id: Ie94d207fed91e9dfd85ee3c3339c376b25ac5fa4
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-06-04 03:22:26 +02:00
Andrew Bartlett
822b492728 dsdb: Do not give an error is metadata.tdb does not yet exist
Change-Id: I88ee188c776364fd66da388ce01fc9288aa2ded0
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-06-04 03:22:26 +02:00
Andrew Bartlett
d62e0f8a25 selftest: Add knownfail entries for wbinfo --user-info tests only on the failing environments
This is better than skipping on every environment in the test

Andrew Bartlett

Change-Id: Ib4b114059d8f8bb05a9bdc2eca0f71310fc5a3bc
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-06-04 03:22:26 +02:00
Andrew Bartlett
5f29774071 selftest: move all winbind test rules to one place
We now run wbinfo_simple additionally against plugin_s4_dc and dc

This also extends many of the tests to run against more environments,
hence the additional knownfail entries.

For winbind.wbclient, the fl2003dc environment has been selected not
to run with password history so as to allow the winindd.wbinfo test to
complete (once switched to running winbindd).

Andrew Bartlett

Change-Id: I475fd9937e515796b5e47c042a8bfa85f76441ca
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-06-04 03:22:26 +02:00
Andrew Bartlett
6add082461 selftest: Make test_wbinfo.sh work with s3-winbindd
Change-Id: I41ed850b6424eac3fb8b6603d5b87c66bb77dd51
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-06-04 03:22:26 +02:00
Andrew Bartlett
a1c7aa0b34 selftest: Run samba4.blackbox.wbinfo against plugin_s4_dc
Change-Id: I5580de814d5fe000d352f3c78743837d26f9422d
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-06-04 03:22:26 +02:00
Andrew Bartlett
2b558f2096 selftest: Set winbind separator = /
This avoids a pile of shell-script escape pain, and fixes some tests.

Andrew Bartlett

Change-Id: Ie1d0e32ab484a5b0ddbc4073831fe6de27e38e92
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-06-04 03:22:25 +02:00
Volker Lendecke
839a45a471 imessaging: Fix a comment
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-31 01:59:17 +02:00
Samuel Cabrero
90f9db9c06 Fix several talloc stack frames not freed
Signed-off-by: Samuel Cabrero <scabrero@zentyal.com>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Kamen Mazdrashki <kamenim@samba.org>
Autobuild-Date(master): Fri May 30 15:29:29 CEST 2014 on sn-devel-104
2014-05-30 15:29:29 +02:00
David Disseldorp
d9776c65e3 torture/attr: use security_ace_equal instead of sec_ace_equal
Both offer the same functionality, sec_ace_equal() will be removed.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-29 01:08:25 +02:00
Arvid Requate
5e892fb674 s4-dns: dlz_bind9: improve log message consistency
Change-Id: I0a12c048fd4e667b9aa0777f99c8f8306fc090ea
Signed-off-by: Arvid Requate <requate@univention.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon May 26 05:55:46 CEST 2014 on sn-devel-104
2014-05-26 05:55:46 +02:00
Arvid Requate
f15d10df29 s4-dns: dlz_bind9: Fix ipv6 updates
b9_record_match needs to consider all allowed representations of IPv6
addresses (RFC 2373), otherwise DNS subtractrdataset operations fail
due to differences in zero padding between bind9 frontend and ndr_pull
of a dnsp_DnssrvRpcRecord structure.

Change-Id: Ic0a1b16008458993dc644646d7f4ae3d3a3c5fed
Signed-off-by: Arvid Requate <requate@univention.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>
Reviewed-by: Guenter Kukkukk <kukks@samba.org>
2014-05-26 03:31:28 +02:00
Stefan Metzmacher
13b36be68f s4:librpc/rpc: allow a shortcut in dcerpc_pipe_connect_ncacn_np_smb[2]_send()
If the caller provided smbXcli * pointers of an existing connection,
we can use it.

This will be used later in order to allow multiple dcerpc connections
over the same smb connection.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-26 03:31:28 +02:00
Stefan Metzmacher
a13eebac7d s4:librpc/rpc: split out continue_smb_open()
The smb and smb2 code pathes are the same.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-26 03:31:28 +02:00
Stefan Metzmacher
35192e8316 s4:librpc/rpc: remove pipe_np_smb2_state and use pipe_np_smb_state
There's no need for two almost identical structures.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-26 03:31:28 +02:00
Stefan Metzmacher
7ea04759d7 s4:librpc/rpc: remember some smbXcli_* pointers within struct dcerpc_pipe_connect
This will simplify further improvements.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-26 03:31:28 +02:00
Stefan Metzmacher
ae406ac668 s4:librpc/rpc: use DCERPC_REQUEST_TIMEOUT for smb opens
There's no need to make the connect timeout dynamic.
We implicitly used SMB_REQUEST_TIMEOUT which is also 60 seconds before.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-26 03:31:28 +02:00
Stefan Metzmacher
d1b5016572 s4:librpc/rpc: remove some unused functions and structures from dcerpc_sock.c
Now we just dcerpc_sock.c doesn't need to maintain 'struct sock_private'
in p->transport.private_data anymore, we're just using a raw tstream_context
as p->transport.stream.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-26 03:31:28 +02:00
Stefan Metzmacher
e4f7b90295 s4:librpc/rpc: avoid using dcerpc_socket_peer_addr()
We use information stored in the dcerpc_binding in order
to open a secondary connection.

The goals are:
- dcerpc_secondary_connection_* should just use the dcerpc_binding
  information for the first connection and just call dcerpc_pipe_connect_*
- Get rid of dcerpc_pipe->transport.* and just use a tstream_context.
  All other details should be maintained only by the higher levels.
- Hide dcerpc_pipe and dcecli_connection behind dcerpc_binding_handle.
- Have just one entry point to create a new connection. For source4/librpc
  this will be dcerpc_pipe_connect_*. For source3/rpc_client we need
  a similar function.
- We'll have a new dcerpc_connection layer, with also just one
  entry point to create a new connection.
- Replace dcerpc_pipe and dcecli_connection with the new dcerpc_connection layer.
- Replace rpc_pipe_client with the new dcerpc_connection layer.
- When the client side is unified we can change the server
  as it needs to act as a client in order to register the endpoint mappings.
- Then the core of the server will be changed to use the new dcerpc_connection
  layer.

As dcerpc_socket_peer_addr() uses p->transport.private_data
as 'struct sock_private', we should avoid it.
We can then remove dcerpc_unix_socket_path() and 'struct sock_private'.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-26 03:31:28 +02:00
Stefan Metzmacher
3aebaf4c13 s4:librpc/rpc: set "localaddress" and reset "host" for ncacn_ip_tcp
We should remember local and remote ip address in dcerpc_pipe->binding.

Note: that we still have the "target_hostname" unmodified, if present.

This way dcerpc_pipe->binding can be used to create a secondary connection
that is a additional connection for the existing association group.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-26 03:31:27 +02:00
Stefan Metzmacher
374c5c4109 s4:librpc/rpc: return the local/remote ip from dcerpc_pipe_open_tcp_recv()
It's important that the caller can remember the ips,
so that a secondary connection can use the same addresses
in order to get association group binding to work.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-26 03:31:27 +02:00
Stefan Metzmacher
4c11fa68d4 s4:librpc/rpc: optionally return the local address from dcerpc_pipe_open_socket_recv()
The caller should be able to remember the local address that was used
for the connection.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-26 03:31:27 +02:00
Stefan Metzmacher
dfee057447 s4:librpc/rpc: avoid using dcerpc_unix_socket_path()
We use information stored in the dcerpc_binding in order
to open a secondary connection.

The goals are:
- dcerpc_secondary_connection_* should just use the dcerpc_binding
  information for the first connection and just call dcerpc_pipe_connect_*
- Get rid of dcerpc_pipe->transport.* and just use a tstream_context.
  All other details should be maintained only by the higher levels.
- Hide dcerpc_pipe and dcecli_connection behind dcerpc_binding_handle.
- Have just one entry point to create a new connection. For source4/librpc
  this will be dcerpc_pipe_connect_*. For source3/rpc_client we need
  a similar function.
- We'll have a new dcerpc_connection layer, with also just one
  entry point to create a new connection.
- Replace dcerpc_pipe and dcecli_connection with the new dcerpc_connection layer.
- Replace rpc_pipe_client with the new dcerpc_connection layer.
- When the client side is unified we can change the server
  as it needs to act as a client in order to register the endpoint mappings.
- Then the core of the server will be changed to use the new dcerpc_connection
  layer.

As dcerpc_unix_socket_path() uses p->transport.private_data
as 'struct sock_private', we should avoid it.
We can then remove dcerpc_unix_socket_path() and 'struct sock_private'.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-26 03:31:27 +02:00
David Disseldorp
04cddfc739 torture/smb2/dir: check create time match find
This adds a check to ensure that the create time returned in the SMB2
create response matches the value found in the find response.

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 May 23 22:42:24 CEST 2014 on sn-devel-104
2014-05-23 22:42:24 +02:00
David Disseldorp
b328bb07ff s4-torture: add print_test_purge
This change adds a regression test for print job purging via
SetPrinter(SPOOLSS_PRINTER_CONTROL_PURGE).

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): Thu May 22 01:55:39 CEST 2014 on sn-devel-104
2014-05-22 01:55:39 +02:00
Kai Blin
392ec4d241 bug #10609: CVE-2014-0239 Don't reply to replies
Due to insufficient input checking, the DNS server will reply to a packet that
has the "reply" bit set. Over UDP, this allows to send a packet with a spoofed
sender address and have two servers DOS each other with circular replies.

This patch fixes bug #10609 and adds a test to make sure we don't regress.
CVE-2014-2039 has been assigned to this issue.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10609

Signed-off-by: Kai Blin <kai@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Kai Blin <kai@samba.org>
Autobuild-Date(master): Tue May 20 04:15:44 CEST 2014 on sn-devel-104
2014-05-20 04:15:44 +02:00
Günther Deschner
93093fa08d s4-torture: fix some build warnings in rpc samr test.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri May 16 23:48:35 CEST 2014 on sn-devel-104
2014-05-16 23:48:35 +02:00
Günther Deschner
efff779c72 s4-torture: fix test_openprinter_wrap fake test result.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-05-16 21:24:26 +02:00
Andrew Bartlett
c664859a12 selftest: Test auth_wbc, the auth4 winbind and winbind_wbclient modules using pdbtest
This ensures these authentication modules continue to operate correctly, and that the results are consistent.

Andrew Bartlett

Change-Id: I7f63cd93e55c6f73ceeafb14f1dc265291791803
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri May 16 12:50:44 CEST 2014 on sn-devel-104
2014-05-16 12:50:44 +02:00
Andrew Bartlett
6c37cd6544 auth: Allow auth_samba4 to be forced to run a specific auth module
This will allow new tests to be written to validate winbindd authentication results

Andrew Bartlett

Change-Id: I008eba1de349b17ee4eb9f11be08338557dffecc
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-05-16 10:23:26 +02:00
Andrew Bartlett
c1507bc101 s4:imessaging: Remove event context from irpc and imessaging structures
The only part of this code with a stored event context is now the
binding_handle created by irpc_binding_handle() when in the client
dcerpc_binding_handle_set_sync_ev() is called,
otherwise a new nested event context is created for sync calls.

Note that the FD event associated with the socket still implies
the long term event context passed to imessaging_[client]_init().

Andrew Bartlett

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

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue May 13 02:33:24 CEST 2014 on sn-devel-104
2014-05-13 02:33:24 +02:00
Andrew Bartlett
84139801cf s4:imessaging: Remove dcerpc_binding_handle_set_sync_ev() call from irpc_binding_handle()
The callers do this explicitly now if required.

Change-Id: I0e6f562aac4e3c0a75149c5850eb9f96269a3caf
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-05-13 00:08:12 +02:00
Andrew Bartlett
a20c7e6adb s4:irpc/tests: explicitly use dcerpc_binding_handle_set_sync_ev()
This indicates that we're using nested event loops...

Andrew Bartlett

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Change-Id: I17d530a1f338cfdbd2e4e755b6f01a44a3e7ba7a
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2014-05-13 00:08:12 +02:00
Andrew Bartlett
6cbf3ecd66 s4:pyrpc: explicitly use dcerpc_binding_handle_set_sync_ev() for irpc
This indicates that we may use nested event loops...

Andrew Bartlett

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Change-Id: Id014dcc68699c86cb99015a91a6979e30795f727
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2014-05-13 00:08:12 +02:00
Andrew Bartlett
ed48c70b90 s4:service_task: explicitly use dcerpc_binding_handle_set_sync_ev() for irpc
This indicates that we're using nested event loops...

Andrew Bartlett

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Change-Id: I7e147850566301a5ef2354b8615a044d121968b5
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2014-05-13 00:08:12 +02:00
Andrew Bartlett
608d91e300 s4:rpc_server/netlogon: explicitly use dcerpc_binding_handle_set_sync_ev() for irpc
This indicates that we're using nested event loops...

Andrew Bartlett

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Change-Id: I4dcc7bf3c624612980e53b6119a60989fc2ea3b6
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2014-05-13 00:08:12 +02:00
Andrew Bartlett
a2f3c351fa s4:auth_winbind: explicitly use dcerpc_binding_handle_set_sync_ev() for irpc
This indicates that we're using nested event loops...

Andrew Bartlett

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Change-Id: I08f21876d42197f76fe3ae10b4f464626d70bf5a
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2014-05-13 00:08:12 +02:00
Andrew Bartlett
7a347327a0 s4:irpc/tests: make use explicit use of the top level event context
Andrew Bartlett

Change-Id: Ia193f97f62a1cb928aa814679578f90bde212013
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-05-13 00:08:12 +02:00
Andrew Bartlett
0927b0b01a s4:nbt_server/wins: make use explicit use of the top level event context
Andrew Bartlett

Change-Id: I4b8e5c16bd03a038da6527cfb4c91fc874626b18
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-05-13 00:08:12 +02:00
Andrew Bartlett
401f555c28 dsdb: Do not permit nested event loops when in a transaction, use a nested event context
It is never safe to execute arbitary code inside a transaction - we
need to get in and get out, not run other events for the rest of the
server.

This patch avoids that by creating a private event loop during
transactions, so no unexpected operations fire, and returning the
original one when we finish it.

If an event fires during an LDB transaction, an unrelated operation
can occur during the transaction, and if the transaction were to be
cancelled, there would be a silent rollback (despite the client having
been indicated success).

Additionally, other processes could be called via IRPC that need to
operate on the database but are locked out due to the ongoing
transaction.

Andrew Bartlett

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10582
Change-Id: I22322fc006e61d7291da17cdf6431416ebb7b30f
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue May  6 13:36:20 CEST 2014 on sn-devel-104
2014-05-06 13:36:20 +02:00
Andrew Bartlett
543c5bf941 dsdb: Rename private_data to rootdse_private_data in rootdse
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10582

Change-Id: I349a2be67333ada86c19cd6d2ed283cd5bbeb2aa
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-05-06 11:14:06 +02:00
Jose A. Rivera
2c9683db4b Fix an empty if statement.
Primarily following the	precedent set by other uses of composite_is_ok(), but
also making sure nothing tries to use c after this point if it is in fact not
ok.

Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-05 20:19:13 +02:00
Michael Adam
1cfc02d786 s4:samr: allow builtin groups for samr_OpenGroup.
This fixes nsswitch getgrgid for builtins.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-03 07:57:13 +02:00
Andrew Bartlett
7c2bf8d2bc selftest: Add tests for dbcheck detection and removal of partial objects
To avoid listing all the provision snapshots, we use a broader blacklist for waf dist
and a whitelist for dbcheck-oldrelease.sh

Andrew Bartlett

Change-Id: Iab0ff4be0b4287dc128a49302836a6f0f7b39678
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-05-03 07:57:13 +02:00
Andrew Bartlett
b19d80d0a9 dsdb: Make it harder to corrupt the database by requiring DBCHECK or RELAX for final object deletion
This kind of deletion can cause us to then replicate back a partial
object.  We allow dbcheck to directly remove totally corrupt objects
(missing an objectclass) by specifying both DBCHECK and RELAX, and the
tombstone sweep after 180 days is done with the RELAX control.

Andrew Bartlett

Change-Id: Ic21f68e507ba9b65e035ca568430e35e2d001c7d
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-05-03 07:57:12 +02:00
Stefan Metzmacher
5b22222421 s4:repl_meta_data: fix array assignment in replmd_process_linked_attribute()
Change-Id: I10357236108f68ab749ba0e1f07558302c573887
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-02 01:19:19 +02:00
Andrew Bartlett
77b04f1df6 winbind: Allow winbindd to be run from inside "samba"
Change-Id: I6b90a9b62ba5821e0feedb23cd20642078ba0ca6
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Apr 29 05:28:39 CEST 2014 on sn-devel-104
2014-04-29 05:28:39 +02:00
Andrew Bartlett
086c06e361 kerberos: Remove un-used event context argument from smb_krb5_init_context()
The event context here was only specified in the server or admin-tool
context, which does not do network communication, so this only caused
a talloc_reference() and never any useful result.

The actual network communication code sets an event context directly
before making the network call.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Apr 28 02:24:57 CEST 2014 on sn-devel-104
2014-04-28 02:24:57 +02:00
Andrew Bartlett
7a26989d4c dsdb: Specify no event context to smb_krb5_init_context() in dsdb
These routines parse principals and generate keys only, no network
communication is done.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-28 00:09:21 +02:00
Alexander Bokovoy
720f7639e4 ad-dc: use exit_daemon() to communicate status of startup to systemd
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10517

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Apr 23 04:44:46 CEST 2014 on sn-devel-104
2014-04-23 04:44:46 +02:00
Alexander Bokovoy
aa8c8a7b5b add systemd integration
Add --with-systemd / --without-systemd options to check whether
libsystemd-daemon library is available and use it to report service
startup status to systemd for smbd/winbindd/nmbd and AD DC.

The problem it solves is correct reporting of the Samba services
at the point when they are ready to serve clients, important for
high availability software integration.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10517

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-04-23 02:29:08 +02:00