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

29234 Commits

Author SHA1 Message Date
Andrew Bartlett
0769d67682 s4-ntvfs: Ensure we do not attempt to write EAs on streams 2012-08-20 21:57:46 +10:00
Michael Adam
4f4bb1f20d s4:torture:basic: add more delete test - variants of deltest16 and deltest17
There seems to be a difference if the initial delete_on_close flag
was set on a handle that created the file or if the handle if was
for a file that already existed.

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

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

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Aug 17 21:44:24 CEST 2012 on sn-devel-104
2012-08-17 21:44:24 +02:00
Andrew Bartlett
2e1ab13f6e s4-dsdb: Use tmp_ctx in kccsrv_check_deleted to avoid leaking memory onto part->dn
The confusing use of do_dn as a memory context while legitimate
created a bug when it was copied and modified to search on a DN from
long-term state.

By always using a temporary memory context it is clear what paramter
is the memory context.

This was found based on a log provided by Ricky Nance
<ricky.nance@weaubleau.k12.mo.us>.  Thanks Ricky!

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Aug 17 18:24:10 CEST 2012 on sn-devel-104
2012-08-17 18:24:09 +02:00
Andrew Bartlett
26bfe70def s4-kcc: Avoid use-after-free of dn and add tmp_ctx
By using a tmp_ctx we are clearer about allocating temporary memory.

Andrew Bartlett
2012-08-17 16:41:26 +02:00
Stefan Metzmacher
e2b07c0adc s4:libcli/smb2: reset trsnport->compound.related when a compound chain is finished
metze
2012-08-17 14:51:57 +02:00
Andrew Bartlett
a7b8e9f562 s4-dsdb: Ensure we always free tmp_ctx in schema refresh check
This was found based on a log provided by Ricky Nance
<ricky.nance@weaubleau.k12.mo.us>.  Thanks Ricky!

In that log, over 2.5 days this particular allocation was repeated:

1715099     talloc_new: ../source4/dsdb/samdb/ldb_modules/schema_load.c:120 contains      0 bytes in   1 blocks

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Aug 17 06:21:18 CEST 2012 on sn-devel-104
2012-08-17 06:21:17 +02:00
Volker Lendecke
5251d07e62 s4: Fix returns in py_check_dcerpc_type
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-08-17 00:57:19 +02:00
Stefan Metzmacher
8dbfa9305d s4:cldap_server: only return DS_SERVER_*TIMESERV if "ntp_signd" is used
metze
2012-08-16 23:13:07 +02:00
Stefan Metzmacher
4c5019d507 s4:cldap_server: set DS_SERVER_SELECT_SECRET_DOMAIN_6 if we're a RODC
metze
2012-08-16 23:13:07 +02:00
Volker Lendecke
f3b69da2ae s3-libsmb: Add a simple test for python bindings
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Aug 16 22:49:06 CEST 2012 on sn-devel-104
2012-08-16 22:49:06 +02:00
Andrew Bartlett
f9b9433b75 s4-selftest: Fix test name for samba.tests.dcerpc.bare 2012-08-15 16:28:03 +02:00
Stefan Metzmacher
4ee602c7f0 s4:dsdb/repl: fix the usage of 'GC/' prefixed principal names
The "serverReference" attribute is available on the "server" object
not on the "nTDSA" object.

This allows connections to RODCs, as they don't have a
E3514235-4B06-11D1-AB04-00C04FC2DCD2/${NTDSGUID}/${DNSDOMAIN}
principal.

Pair-Programmed-With: Björn Baumbach <bb@sernet.de>

metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Aug 14 18:57:41 CEST 2012 on sn-devel-104
2012-08-14 18:57:41 +02:00
Stefan Metzmacher
4e5e302a10 s4:samba-tool/drs: print the dns name of the server belonging to a connection
Pair-Programmed-With: Björn Baumbach <bb@sernet.de>

metze
2012-08-14 17:17:29 +02:00
Arvid Requate
a74ca56c48 s4:ntp_signd: fix SEGV if SID cannot be found
Signed-off-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Aug 14 17:16:54 CEST 2012 on sn-devel-104
2012-08-14 17:16:54 +02:00
Andrew Bartlett
108c8b758a s4-dsdb: Use samdb_dn_is_our_ntdsa()
This uses a GUID based comparison, and avoids re-fetching the
samdb_ntds_settings_dn each time.

Andrew Bartlett
2012-08-14 15:37:22 +02:00
Andrew Bartlett
d582e1bef6 s4-dsdb: Add samdb_dn_is_our_ntdsa()
This is like samdb_reference_dn_is_our_ntdsa but without the attribute de-reference.

Andrew Bartlett
2012-08-14 15:37:22 +02:00
Andrew Bartlett
773d0367a6 s4-dsdb: Use samdb_reference_dn_is_our_ntdsa() 2012-08-14 15:37:22 +02:00
Andrew Bartlett
7213199f6e s4-repl: Use samdb_reference_dn_is_our_ntdsa() 2012-08-14 15:37:22 +02:00
Andrew Bartlett
1e127b270c s4-dsdb: Add helper function samdb_reference_dn_is_our_ntdsa()
We often want to know if we own an FSMO role (for example).  This tries to be more
efficient by comparing the GUID, rather than the string DN, as this does not need
to be re-fetched each time.

Andrew Bartlett
2012-08-14 15:37:22 +02:00
Andrew Bartlett
3c8d8f206b s4-dsdb: Use ldb_dn_copy() rather than talloc_reference()
As the normal case (outside provision) uses a copy, this avoids a case
where a caller might modify a global variable accidentily.

As suggested by metze.

Andrew Bartlett
2012-08-14 15:37:22 +02:00
Andrew Bartlett
0668f98d11 s4-libnet: Prepare libnet_BecomeDC for samdb_reference_dn() returning an extended DN
Remote LDAP servers will not accept an extended DN with other components.

Andrew Bartlett
2012-08-14 15:37:22 +02:00
Andrew Bartlett
fd0394d85d s4-libnet: Improve debugging of libnet_BecomeDC LDAP errors 2012-08-14 15:37:22 +02:00
Stefan Metzmacher
c47d73f6c4 s4:dsdb/repl: ldb_errstring() takes a 'struct ldb_context' not 'int'
metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Aug 14 13:58:31 CEST 2012 on sn-devel-104
2012-08-14 13:58:31 +02:00
Stefan Metzmacher
0b926a27d8 s4:dsdb/repl: make sure instanceType_e is not changed by a reallocation
Pair-Programmed-With: Björn Baumbach <bb@sernet.de>

metze
2012-08-14 10:47:26 +02:00
Stefan Metzmacher
d81d6afd6f s4:dsdb/repl: avoid reallocation of msg->elements
The index into the elements needs to match between
msg->elements and md->ctr.ctr1.array, which means we should
pre-allocate them with the same size.

Pair-Programmed-With: Björn Baumbach <bb@sernet.de>

metze
2012-08-14 10:40:55 +02:00
Andrew Bartlett
9566786853 s4-dsdb: Add mem_ctx argument to samdb_ntds_settings_dn
As this value is calculated new each time, we need to give it a context to live on.

If the value is the forced value during provision, a reference is taken.

This was responsible for the memory leak in the replication process.  In the
example I was given, this DN appeared in memory 13596 times!

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Aug 14 10:05:14 CEST 2012 on sn-devel-104
2012-08-14 10:05:14 +02:00
Andrew Bartlett
0f2a87b547 s4-dsdb: Improve memory handling in dsdb_schema_from_ldb_results() by adding a tmp_ctx 2012-08-14 08:27:19 +02:00
Andrew Bartlett
1f7477349f s4-dsdb: Improve memory handling in kccsrv_add_connection() 2012-08-14 08:27:19 +02:00
Andrew Bartlett
77990c1831 s4-dsdb: Improve memory handling in kccsrv_find_connections() by adding a tmp_ctx 2012-08-14 08:27:19 +02:00
Andrew Bartlett
f74e7b5606 s4-dsdb: Add const 2012-08-14 08:27:19 +02:00
Matthias Dieter Wallnöfer
f11a1a4a07 s4:kdc/wdc-samba4.c - fix user logins on specific workstations
The decrement operation has been missing.

Problem found by Mohammad Ebrahim Abravi <lamp.mia@gmail.com>

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-08-14 08:37:49 +10:00
Wesley Young
a57c5eb848 s4-classicupgrade: Tests if sam policies exist before trying to import them.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-08-14 08:37:48 +10:00
Andrew Bartlett
4631723c98 s4-dsdb: Take more care in handling of global schema memory
This reworks dsdb_replicated_objects_commit() to have a proper local tmp_ctx and
to be more careful about what schema is set (only setting a global schema if
the original schema was global).

In particular, the new working_schema is not given a talloc reference
to the old schema.  This ensures that the old schema can go away when
no longer used.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Aug 11 10:31:57 CEST 2012 on sn-devel-104
2012-08-11 10:31:57 +02:00
Andrew Bartlett
329e374938 s4-dsdb: Remove support for per-partition sequence numbers
These sequence numbers were only used for telling if the schema was
changed, and are no longer directly related to the replication USN.

The per-partition replication USN can be obtained from the
@REPLCHANGED record on the per-partition database, and this is done
with an ldb_search().

Andrew Bartlett
2012-08-11 12:53:42 +10:00
Andrew Bartlett
2d21a9bf5e s4-dsdb: Use only the replication USN for schema reload.
This way we do not track both the partition seq number and the
replication USN for schema reload purposes.

We only need one indication of actual data change, and the replication
per-partition sequence number is no more expensive to obtain than the
ldb per-partition sequence number.

Andrew Bartlett
2012-08-11 12:53:42 +10:00
Volker Lendecke
d7515b6a88 torture: Reproducer for 64c0367
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-08-10 14:38:47 -07:00
Björn Jacke
13f8674a15 build: rename security → samba-security
there is a libsecurity on OSF1 which clasheѕ with our security lib. see bug #9023.

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

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Fri Aug 10 14:22:21 CEST 2012 on sn-devel-104
2012-08-10 14:22:20 +02:00
Andrew Bartlett
fdd07e87c6 s4-dsdb: Explain better what records are written during schema set
This is controlled by setting write_indices_and_attributes.

Andrew Bartlett
2012-08-10 10:18:28 +10:00
Michael Adam
f64c970e3e s4:torture:basic: check the return status of the last open in deltest16
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Aug  9 18:01:50 CEST 2012 on sn-devel-104
2012-08-09 18:01:50 +02:00
Michael Adam
2352227b66 s4:torture:basic: fix a message typo in the delete17 test 2012-08-09 16:23:46 +02:00
Michael Adam
6cc5a54bc0 s4:torture:basic: fix abundance of spaces in deltest6 2012-08-09 16:23:46 +02:00
Michael Adam
fac4a0d4a7 s4:torture:basic:delete: fix 4 vs 8 spc tab formatting in check_delete_on_close() 2012-08-09 16:23:45 +02:00
Andrew Bartlett
7e562cf3eb s4-events: Do not vasprintf() the tevent debug messages that will not be shown
This malloc() and free() actually shows up quite high on a call profile of
provision of the AD DC.

Andrew Bartlett
2012-08-09 20:14:22 +10:00
Andrew Bartlett
d799b25dd3 s4-dsdb: Remove strcasecmp() fallback in replmd_ldb_message_element_attid_sort
In all callers, we must already have a attributeID for each of the
values or else we would have already given an error, or could not have
obtained the message over DRS.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Aug  9 11:39:54 CEST 2012 on sn-devel-104
2012-08-09 11:39:54 +02:00
Andrew Bartlett
8dd09ef46d s4-dsdb: Do not reload partition metadata except on transaction start
This ensures that we do not add objects that should go into a partition, but we
simply return that an object is not present if the connection was created
before the partition was loaded.  It is rare to create a new partition.

Andrew Bartlett
2012-08-09 10:01:04 +02:00
Andrew Bartlett
a117fd6d11 s4-dsdb: Ensure we have indexing enabled during the provision
Because we set the schema before we connected the ldb to a file, the @INDEX records
were not added until next startup.  This cost 100% more time in running provision on
my laptop.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Aug  9 08:20:36 CEST 2012 on sn-devel-104
2012-08-09 08:20:36 +02:00
Andrew Bartlett
ef87b4e4f1 s4-pydsdb: Provide control of if we should write index attributes when reloading a schema
This allows us to carefully control the loading of the schema.

Andrew Bartlett
2012-08-09 06:39:20 +02:00
Andrew Bartlett
1a1f01ee7a s4-dsdb: Change talloc parent
This matches the rest of the function.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Aug  9 06:26:36 CEST 2012 on sn-devel-104
2012-08-09 06:26:36 +02:00
Andrew Bartlett
17275561a0 s4-dsdb: Remove ldb_sequence_type argument from partition_primary_sequence_number
We always want LDB_SEQ_HIGHEST_SEQ here.

Andrew Bartlett
2012-08-09 04:32:18 +02:00
Andrew Bartlett
6ec963eef7 s4-dsdb: simplify migration of old-style seqence numbers to metadata.tdb
This simple operation does not need to be encased in generic ldb extended operations.

Andrew Bartlett
2012-08-09 04:32:18 +02:00