1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-09 08:58:35 +03:00

101761 Commits

Author SHA1 Message Date
Andrew Bartlett
d9b2796fae dbcheck: Fix incorrect/duplicate attrid in replPropertMetaData
If custom schema is used in a replicated DC environment, these are created as soon as
an attribute is modified on more than one DC.  We have to remove these.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11443
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit 5fb98a3534a806331307a425d9469164e27d7ee7)
2016-03-15 20:29:37 +01:00
Andrew Bartlett
6a893042c5 selftest: Update release-4-1-0rc3 with more test records
CN=ops_run_anything2,OU=SUDOers,DC=release-4-1-0rc3,DC=samba,DC=corp

This will be modified during the dbcheck to show that new
versions of Samba will reset the attid correctly

CN=ops_run_anything3,OU=SUDOers,DC=release-4-1-0rc3,DC=samba,DC=corp

This will not be modified, and shows how a 4.1 DC without
replication would record custom schema objects.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit ac83f729bc80d02f042a337d9a06dfc4ef0632ac)
2016-03-15 20:29:37 +01:00
Andrew Bartlett
934623f3fa rpc_server/drsuapi: Block replication of incorrect/duplicate attrid in replPropertMetaData
If custom schema is used in a replicated DC environment, these are created as soon as
an attribute is modified on more than one DC.  We have to prevent replication
as otherwise we will corrupt the client replica state.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11443
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit 7397aa47fddca43b3b4931a961e6d8e742fdf181)
2016-03-15 20:29:35 +01:00
Andrew Bartlett
21bf6af223 repl_meta_data: Correctly use msDS-IntId for custom schema, not the prefixMap value
We must, when dealing with custom schema, respect the msDC-IntId value recorded
in the schema.  If we do not, then we will create multiple replPropertyMetaData
records for the one attribute.  This may cause confusion during replication.

This fixes the issue by always calling dsdb_attribute_get_attid() to obtain
the correct local (32 bit integer) attribute ID

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11443
(cherry picked from commit ecf0dd49e07e2c7fad5adf0a82abbc3e301a4e5a)
2016-03-15 20:29:35 +01:00
Andrew Bartlett
d3bffda2f2 pidl: Use a tmp_ctx helper variable
This is so we free the ndr_push_struct_blob() return value after
we make it into a string

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit 90bf114f6370ee837d97e36eb25f38f8234dcd39)
2016-03-15 20:29:35 +01:00
Andrew Bartlett
7391fc8956 pidl: Use the $mem_ctx helper variable
This is already set to pytalloc_get_mem_ctx(py_obj)

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit dffa2dbfabca14f07af12663fc93c8dc3bc837cf)
2016-03-15 20:29:35 +01:00
Andrew Bartlett
22905ceaf5 pidl: Fix our python reference handling
The new talloc.BaseObject allow us to hold a talloc context per
python object (there may be many referring to the same C object)
and the talloc context that the actual object pointer is under.

Another advantage is that talloc.BaseObject(), has less of
an ABI surface.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit 9e07f3a13b41be1f019887581b2a2bd049039a3d)
2016-03-15 20:29:35 +01:00
Andrew Bartlett
1e035b5a05 pyrpc: Clarify failure mode after pytalloc_reference_ex() improvements
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit 627fdf0468e9f575ea1a5de1fd57a87a239a4b96)
2016-03-15 20:29:34 +01:00
Andrew Bartlett
4398286c7c talloc: Bump version number
The removal of the macros and replacement with proper functions
is a API, but not ABI break.  Only code that incorrectly
used the structure either in function signatures or
to access the members directly will need to be modified
before being built against this version of talloc.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit d7bbcbc510c6ecfcd9db47c15203bbdd13d1c06e)
2016-03-15 20:29:34 +01:00
Andrew Bartlett
ab1bcc3818 pytalloc: Add new BaseObject
This new object not only avoids the ABI issues of talloc.Object
it stores one more pointer, being the start of the array, and
so can be used to fix the PIDL bindings/talloc refcount issue.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit 80f2b36efb6380defb646f7612f23c431acf8e1a)
2016-03-15 20:29:34 +01:00
Stefan Metzmacher
61ba9bca89 pytalloc: add a _pytalloc_get_type() helper function and generate PyExc_TypeError on mismatch
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit 528dce1b5326e00446f5fe233b8af52bcb1990a9)
2016-03-15 20:29:34 +01:00
Andrew Bartlett
e2cd642bdc talloc: add _pytalloc_get_ptr/_pytalloc_get_mem_ctx helper functions
This allows us to check which type is involved, and dereference
that type correctly

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit 42eae4dec6209aa5cae0d48f17f33c1ab67b6f03)
2016-03-15 20:29:34 +01:00
Andrew Bartlett
5a229104c4 talloc: Improve testsuite by avoiding path issues
We now rely on waf to tell us where the helper binary is.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit cd8d9300213dcdeb5bdfbbb7a71ae4b82e042470)
2016-03-15 20:29:34 +01:00
Andrew Bartlett
058b78c2a2 pyrpc: Add warning about abuse of py_return_ndr_struct()
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit 623bf4230c3458a266de7759d0ead07d986d6951)
2016-03-15 20:29:34 +01:00
Andrew Bartlett
aac2ecc9b9 pydsdb: Fix returning of ldb.MessageElement.
This object is not based on pytalloc_Object and so this causes
a segfault (later a failure) when the struct definitions diverge.
We must also not reuse the incoming ldb_message_element as a talloc
context and overwrite the values, instead we should create a new
object and return that.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit b96b1e88f760c92c7d9bb7e732f72d7e73a68907)
2016-03-15 20:29:34 +01:00
Andrew Bartlett
6e83a84566 pyldb: Add warning about pyldb_MessageElement_AsMessageElement()
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit 02de793e013c1905cccc0c760bb64f45d37e3051)
2016-03-15 20:29:34 +01:00
Stefan Metzmacher
b9d924a676 selftest: specify a maximum runtime for 'make testenv' of 1 year
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 90cb84c9052bbe7c23fa6e58a3041f0c05249821)
2016-03-15 20:29:34 +01:00
Aurelien Aptel
fbb57a5fc6 s3/passdb/py_passdb.c: free frame before returning
these talloc frames are freed *after* the return instruction and are
never executed. this fixes potential memory leaks.

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Tue Mar  1 12:08:40 CET 2016 on sn-devel-144

(cherry picked from commit f2675909d34b1847a889e65023b9f0ed36e6bd52)
2016-03-15 20:29:34 +01:00
Garming Sam
a411046a9e build: mark explicit dependencies on pytalloc-util
All subsystems that include pytalloc.h need to link against
pytalloc-util.

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

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-03-15 20:29:34 +01:00
Günther Deschner
1b08ea3fa7 libsmb/pysmb: add pytalloc-util dependency to fix the build.
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Tue Feb  2 15:49:14 CET 2016 on sn-devel-144

(cherry picked from commit 943e69ca8fd4491004eafbf29ed2ca748b0b7480)
2016-03-15 20:29:34 +01:00
Stefan Metzmacher
9ab767f660 selftest: mark samba4.winbind.struct.domain_info.ad_member as flapping
See https://lists.samba.org/archive/samba-technical/2016-March/112861.html

  found 517 lines matching '^UNEXPECTED' in 641 files matching 'samba.stdout$'
   175 UNEXPECTED(failure): samba4.winbind.struct.domain_info(ad_member:local)
    19 UNEXPECTED(failure): samba4.winbind.struct.domain_info(s3member:local)
    12 UNEXPECTED(failure): samba4.rpc.backupkey with seal.backupkey.server_wrap_encrypt_decrypt_wrong_key(ad_dc_ntvfs)
    12 UNEXPECTED(failure): samba4.drs.delete_object.python(promoted_dc).delete_object.DrsDeleteObjectTestCase.test_ReplicateDeletedObject1(promoted_dc)
    12 UNEXPECTED(failure): samba4.rpc.backupkey with seal.backupkey.server_wrap_decrypt_wrong_r2(ad_dc_ntvfs)
    11 UNEXPECTED(failure): samba4.ldap.notification.python(ad_dc_ntvfs).__main__.LDAPNotificationTest.test_max_search(ad_dc_ntvfs)

We'll see if we also need to add
samba4.winbind.struct.domain_info.s3member
before we're able to identify and fix the problem.

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): Sat Mar 12 02:14:39 CET 2016 on sn-devel-144

(cherry picked from commit 2ef0eed07e494546ba6720a17f00b40d9bafa8ef)
2016-03-15 20:29:34 +01:00
Uri Simchoni
36b0b0ec87 build: fix disk-free quota support on Solaris 10
Samba has no code to support quota on Solaris 10 (and possibly other
os's such as AIX) using the new quota interface. The new interface
serves both disk size/free space reporting (clamping the underlying
file system numbers with quota), and direct manipulation of the user's
quota.

However, there's legacy code that supports only disk size/free space on
Solaris 10. In the waf build, this code is not compiled because there is
no test for it.

This patch adds a test to see whether the legacy code can be used.

Issue reported and fix tested by Andrew Morgan <morgan@orst.edu>.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun Mar 13 01:37:58 CET 2016 on sn-devel-144

(cherry picked from commit 0a9acd445d246c7758e994b0c69cc90bdbbef2fe)
2016-03-15 20:29:34 +01:00
Andrew Bartlett
29b44e5bee smbd: Only check dev/inode in open_directory, not the full stat()
This is needed because the smb2.create.mkdir-dup test creates a race,
and against an AD DC this can cause a flapping test if the lstat() and
stat() calls are made either side of the chown() due to creation of a
file by administrator.

Fix based on original patches by myself, by Douglas Bagnall
<douglas.bagnall@catalyst.net.nz>.  and Jeremy Allison <jra@samba.org>

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

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): Sat Mar 12 09:43:21 CET 2016 on sn-devel-144

(cherry picked from commit 5fc6d2dabdf2aeef74fdefaa67eae0348bbf7a44)
2016-03-15 20:29:33 +01:00
Stefan Metzmacher
a44025b9a4 s3:winbindd: don't unclude two '\0' at the end of the domain list
This avoids a scary "trustdom_list_done: Got invalid trustdom response" message.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
(cherry picked from commit bb387c5b90e19b5a2f7d65fb8db816e9da51d090)
2016-03-15 20:29:33 +01:00
Günther Deschner
a83a26f878 s3:libnet:libnet_join: update msDS-SupportedEncryptionTypes (if required) with machine creds.
Guenther

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

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

Signed-off-by: Guenther Deschner <gd@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Mar 14 19:38:48 CET 2016 on sn-devel-144

(cherry picked from commit 06aefe4b956ae8748e20ae4c730aa344e81808b6)
2016-03-15 20:29:33 +01:00
Günther Deschner
a35ce5d57b s3:libnet:libnet_join: fill in output enctypes and only modify when necessary.
Guenther

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

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 5d498d1b4d9b83f179fb7b2841a19ad984eec5f8)
2016-03-15 20:29:33 +01:00
Günther Deschner
60c5909859 s3:libnet:libnet_join: define list of desired encryption types only once.
Guenther

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

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit e0da059b39f9dd5ccb74f32f965e1ced384c77eb)
2016-03-15 20:29:33 +01:00
Günther Deschner
acc8dd2ab2 s3:librpc:idl:libnet_join: add encryption types to libnet_JoinCtx.
Guenther

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

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 4a49f6fac9d6c77d1eedf914308e67eb6e2baa8d)
2016-03-15 20:29:33 +01:00
Günther Deschner
e2b8b2cf5a s3:libnet:libnet_join: always try to create machineaccount via LDAP first.
Guenther

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

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit df8f79cc9d44ad7b2caa6b86b7ebde7bb1fd4c8c)
2016-03-15 20:29:33 +01:00
Günther Deschner
35ecc4da2b s3:libads:ldap: fix ads_check_ou_dn to deal with account_ou not being initialized
Guenther

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

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit c61b111e6fa3e138d4d9cf5038b69644248e834a)
2016-03-15 20:29:33 +01:00
Günther Deschner
c6f7bbdc83 s3:libads:ndr: add ADS_AUTH_USER_CREDS to ndr_print_ads_auth_flags()
Guenther

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

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit e8f6acdeece990dc8953d494113dee856d80da45)
2016-03-15 20:29:33 +01:00
Günther Deschner
0dc8e3120b s3:libads:ldap: print LDAP error message with log level 10.
Guenther

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

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 34030b025b9e4cd5e7321d6e242f6c03da2a60c0)
2016-03-15 20:29:33 +01:00
Günther Deschner
f74d7f54c0 s3:libnet:libnet_join: prepare to allow connecting with machine creds.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11755

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 71d5634ab58f0ca21db633990231bd01a22c956c)
2016-03-15 20:29:33 +01:00
Günther Deschner
35ec8ac4b8 Partly revert "s3:libads: setup the msDS-SupportedEncryptionTypes attribute on ldap_add"
This partly reverts commit 0c74d62524db376b6a3fac00c688be0cdffcaa80.

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

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 6686f67d2a91146c8bb2fb2a8104fcaa5710b855)
2016-03-15 20:29:33 +01:00
Ira Cooper
0268dc297a vfs_glusterfs: Fix use after free in AIO callback.
The wrapper->state pointer is not getting NULLed during free
allowing us to do a use after free.

Thanks to Red Hat for discovering this issue.

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

Signed-off-by: Ira Copper <ira@samba.org>
Reviewed-by: Poornima G <pgurusid@redhat.com>
Tested-by: Christopher Blum <cblum@redhat.com>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(v4-4-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-4-test): Mon Mar 14 13:19:27 CET 2016 on sn-devel-144
2016-03-14 13:19:27 +01:00
Justin Maggard
4e48421a69 s3:smbd: add negprot remote arch detection for OSX
Remote arch detection for OSX clients has been broken for some time, since
both Samba and OSX started supporting SMB2.  Fix it by adding modern OSX
client detection support to the negprot remote arch detection routine.

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

Signed-off-by: Justin Maggard <jmaggard10@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <rb@sernet.de>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Mar  3 09:03:53 CET 2016 on sn-devel-144

(cherry picked from commit d7ca174744001fabdc32e1c334dad347bb985756)
2016-03-14 10:02:15 +01:00
Justin Maggard
9d588a90d3 s3:smbd: rework negprot remote arch detection
Negprot remote arch detection is very cryptic.  Rework it so it's easier
to understand, and therefore more extensible, following the protocol table
in inline comments.  This also allows us to remove some hacks.

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

Signed-off-by: Justin Maggard <jmaggard10@gmail.com>
Reviewed-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit b69b96fc14128f50a906b4f5b34934efbc94afbc)
2016-03-14 10:02:15 +01:00
Amitay Isaacs
28e5e957a4 ctdb-common: For AF_PACKET socket types, protocol is in network order
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11770

From man page of packet(7):

                                             protocol is the  IEEE  802.3
   protocol  number  in  network  byte  order.  See the <linux/if_ether.h>
   include file for a list of allowed protocols.  When protocol is set  to
   htons(ETH_P_ALL),  then all protocols are received.

Protocol argument was changed from network order to host order wrongly
in commit 9f8395cb7d49b63a82f75bf504f5f83920102b29.

Specifying "protocol" field to socket(AF_PACKET, ...) call only affects
the packets that are recevied.  So use protocol = 0 when sending raw
packets.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Fri Mar  4 12:58:50 CET 2016 on sn-devel-144

(cherry picked from commit f5b6a5b13406c245ab9cc8c1699483af9eb21f88)
2016-03-14 10:02:15 +01:00
Uri Simchoni
5b424635af libnet: make Kerberos domain join site-aware
When joining a domain using Kerberos authentication, create a
configuration file for the Kerberos libs to prefer on-site
domain controllers, without relying on the winbindd Kerberos
locator, which many not be operational at this stage.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Mar  8 01:30:35 CET 2016 on sn-devel-144

(cherry picked from commit 0dbab0e33e9efc46f72b6a8b0dc894ea251df9aa)
2016-03-14 10:02:15 +01:00
Uri Simchoni
16e970fbc4 dsgetdcname: fix flag check
Fix the check for zero requseted flags.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 6d717402e42131298ba670ee47686379854ec56d)
2016-03-14 10:02:15 +01:00
Uri Simchoni
da0f03b9f8 dsgetdcname: return an IP address on rediscovery
When dsgetdcname return its result based on discovery
process (instead of retrieving cached value), always
return the found server's IP address in dc_address field,
rather than its netbios name.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit ef84f4c018424b1fcc232a4780dc2c0435701d86)
2016-03-14 10:02:15 +01:00
Andrew Bartlett
38091dd1be dsdb/repl: Ensure we use the LOCAL attid value, not the remote one
The key here is that while this never was an issue for builtin schema,
nor for objects with an msDS-IntID used outside the schema partition,
additional attributes added and used in the schema partition were
incorrectly using the wrong attributeID value in the replPropertyMetaData.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sun Mar 13 23:29:14 CET 2016 on sn-devel-144

(cherry picked from commit 6ecfc4cb254f9b2524ec5619ed8cee9db5d959b2)
2016-03-14 10:02:15 +01:00
Michael Adam
2a80859025 smbd:smb2: move op variable into scope of use in smb2_create_send
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 272d06d40b7338de7db8954192f42c7340753920)

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11779
2016-03-14 10:02:15 +01:00
Michael Adam
8743f5b9a6 smbd:smb2: implement create replay
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 2fd54b533292e54de8c289fb093748fb171c15a7)

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11779
2016-03-14 10:02:14 +01:00
Michael Adam
a894f156ee smbXsrv.idl: add create_action to smbXsrv_open
Needed for create replay.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 03a3aa981500c5ba9d82c27f36e107672b071203)

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11779
2016-03-14 10:02:14 +01:00
Michael Adam
9bce93ba7a smbXsrv:open: add smb2srv_open_lookup_replay_cache()
A function to find an open from the replay cache,
based on the create_guid handed in.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 5b90c986eda8201660434a9a1d64e5a0a625379e)

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11779
2016-03-14 10:02:14 +01:00
Michael Adam
609faee1ee smb2:create: create replay cache when request has a create_guid
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 08e34830b7f4d631a24e94aad1502949eb2cd675)

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11779
2016-03-14 10:02:14 +01:00
Michael Adam
579fb6648e smbXsrv:open: maintain a replay cache
This caches a map create_guid -> file_id, so that
a replayed create can find the already created
open again.

This is automatically deleted once the first use
of the file handle is happening (triggered by
the lookup for the file-id).

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 4370bda3c0f35c1cc9b45a004bb829b1d69a4e38)

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11779
2016-03-14 10:02:14 +01:00
Michael Adam
42a81bf162 librpc:smbXsrv.idl: add flags to smbXsrv_open
These flags reflect the need for and state of the replay cache.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 1eb5f1e42276999f0f4fc73cac03a188fb6d83e9)

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11779
2016-03-14 10:02:14 +01:00
Michael Adam
19d66b4713 smbd:smb2: allow the REPLAY_OPERATION flag for SMB3+ requests
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 6251d926e0cdd37ed312f7dc78ce2735e979c25f)

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11779
2016-03-14 10:02:14 +01:00