1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-26 21:57:41 +03:00

55675 Commits

Author SHA1 Message Date
Andrew Kroeger
a32f4dd3cf util:tests: Correct time tests for negative UTC offsets.
All:

Please find attached a patch to fix the timestring and http_timestring
tests on hosts that have a negative UTC offset (west of the Prime Meridian).

Sincerely,
Andrew Kroeger

>From 8a8ca35edccf64aa98f2f3ae1469c4c27db8215e Mon Sep 17 00:00:00 2001
From: Andrew Kroeger <andrew@id10ts.net>
Date: Fri, 4 Sep 2009 01:31:50 -0500
Subject: [PATCH] util:tests: Correct time tests for negative UTC offsets.

The timestring and http_timestring tests were failing on hosts with negative
offsets from UTC.  Due to the timezone offset, the returned values were back in
the year 1969 (before the epoch) and did not match the test patterns.

The correction computes the offset from UTC, and if it is negative that offset
is added onto the value given to the timestring() and http_timestring() calls so
that the returned values fall on 01-Jan-1970 and match the test pattern.
2009-09-05 10:06:29 +10:00
Andrew Kroeger
5afa115f2a selftest: Account for 0-based months in date parsing and printing.
All:

Please find attached 2 patches to correct date/time parsing and output
in the Subunit processing.  The first patch corrects the logic to
account for months being 0-based.  The second corrects the time
formatting, as it is dealing with local, not "Z"ulu (UTC) time.

Sincerely,
Andrew Kroeger

>From 3cf81eea1309084a973359c7f6a2375d5d20a3f0 Mon Sep 17 00:00:00 2001
From: Andrew Kroeger <andrew@id10ts.net>
Date: Fri, 4 Sep 2009 01:24:00 -0500
Subject: [PATCH] selftest: Account for 0-based months in date parsing and printing.
2009-09-05 10:06:29 +10:00
Simo Sorce
ab6e82910a Add release script for tevent tevent-0.9.8 2009-09-04 18:20:29 -04:00
Stefan Metzmacher
5e59c17e5c s4:configure: require tevent >= 0.9.8
metze
2009-09-04 13:01:06 +02:00
Stefan Metzmacher
1bb68402a2 tevent: change version to 0.9.8 after some critical bugs have been fixed
metze
2009-09-04 13:01:06 +02:00
Jeff Layton
704b739ad8 cifs.upcall: do a brute-force search for KRB5 credcache
A few weeks ago, I added some code to cifs.upcall to take the pid sent
by the kernel and use that to get the value of the $KRB5CCNAME
environment var for the process. That works fine on the initial mount,
but could be problematic on reconnect.

There's no guarantee on a reconnect that the process that initiates the
upcall will have $KRB5CCNAME pointed at the correct credcache. Because
of this, the current scheme isn't going to be reliable enough and we
need to use something different.

This patch replaces that scheme with one very similar to the one used by
rpc.gssd in nfs-utils. It searches the credcache dir (currently
hardcoded to /tmp) for a valid credcache for the given uid. If it finds
one then it uses that as the credentials cache. If it finds more than
one, it uses the one with the latest TGT expiration.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
2009-09-04 06:29:44 -04:00
Andrew Tridgell
ffd48a79ee s4:python fixed subunit tests of dcerpc
The version of the unitest python module in Ubuntu Jaunty doesn't seem
to support this many level of subdirectories. Moving the tests up one
level solves the problem.
2009-09-04 18:07:04 +10:00
Andrew Tridgell
8995491f59 ldb: make ldb module programming less error prone
When a top level method in a module returns an error, it is supposed
to call ldb_module_done(). We ran across a case where this wasn't
done, and then found that in fact that are hundreds of similar cases
in our modules. It took Andrew and I a full day to work out that this
was the cause of a subtle segv in another part of the code.

To try to prevent this happening again, this patch changes
ldb_next_request() to catch the error by checking if a module
returning an error has called ldb_module_done(). If it hasn't then the
call is made on behalf of the module.
2009-09-04 17:29:21 +10:00
Volker Lendecke
5121499816 s3:winbind: Fix Coverity ID 933: FORWARD_NULL 2009-09-04 07:59:56 +02:00
Volker Lendecke
b4a4186556 s3:smbd: Fix Coverity ID 937, REVERSE_INULL 2009-09-04 07:57:26 +02:00
Volker Lendecke
360436b656 s3:winbind: Fix Coverity ID 940: Resource Leak 2009-09-04 07:53:56 +02:00
Andrew Tridgell
c298e660bd ldb: ensure we cancel a ldb transaction
When we fail a ldbadd or ldbedit we should cancel the transaction to
prevent ldb giving a warning about having a open transaction in the
ldb destructor
2009-09-04 14:40:51 +10:00
Andrew Tridgell
5842aa1ffd s4: fixed a missing NULL termination in a attribute list passed to ldb_search 2009-09-04 14:40:51 +10:00
Andrew Tridgell
27b19eb9f6 report the location of the original talloc_free on double free
When we get a double free abort from talloc it is often hard to work
out where the first free came from. This patch takes advantage of the
fact that _talloc_free() now takes a location the free was called from
to allow the double free abort code to print the location of the first
free that conflicts.
talloc-2.0.0
2009-09-04 14:40:51 +10:00
Günther Deschner
b35c627b92 wbinfo: fix various valgrind warnings and an invalid free.
Kai, please check.

Guenther
2009-09-04 00:04:49 +02:00
Günther Deschner
d9bdf2a02f s3-ntlm_auth: fix two segfaults in diagnostics mode.
Guenther
2009-09-04 00:04:40 +02:00
Jeremy Allison
bdc7bdb0d3 Hopefully last part of the fix for bug 6651 - smbd SIGSEGV when breaking oplocks.
This one is subtle. There is a race condition where a signal can be
queued for oplock break, and then the file can be closed by the client
before the signal can be processed. Currently if this occurs we panic
(we can't match an incoming signal fd with a fsp pointer). Simply log
the error (at debug level 10 right now, might be too much) and then
return without processing the break request. It looks like there is
another race condition with this fix, but here's why it won't happen.
If the signal was pending (caused by a kernel oplock break from a
local file open), and the client closed the file and then re-opened
another file which happened to use the same file descriptor as the
file just closed, then theoretically the oplock break requests could
be processed on the wrong fd. Here's why this should be very rare..
Processing a pending signal always take precedence over an incoming
network request, so as long as the client close request is non-chained
then the break signal should always be harmlessly processed *before*
the open can be called. If the open is chained onto the close, and
the fd on the new open is the same as the old closed fd, then it's
possible this race will occur. However, all that will happen is that
we'll lose the oplock on this file. A shame, but not a fatal event.
Jeremy.
2009-09-03 07:40:48 -07:00
Jeremy Allison
c97698e762 Another part of the fix for bug 6651 - smbd SIGSEGV when breaking oplocks.
SA_INFO_QUEUE_COUNT *MUST* be a power of 2, in order for the ring buffer
wrap to work correctly at the 32 bit boundary. Thanks to Petr
Vandrovec <petr@vandrovec.name> for this.
2009-09-03 07:38:21 -07:00
Anatoliy Atanasov
38995d7cbb First attempt to implement dcesrv_drsuapi_DsGetNCChanges
So far it returns the ctr6 responce without proper linked attributes
support and metadata. A couple of improvements are the filter in the search
uses '(uSNChanged>=N)', added extended dn search support, non-replicated attributes
are excluded from the result.
2009-09-03 19:10:49 +10:00
Anatoliy Atanasov
957a9285c2 Fix the dsdb_syntax_OID_ldb_to_drsuapi function
This replace the dsdb_syntax_FOOBAR_ldb_to_drsuapi function,
which was left as a TODO code. Implementation in both added functions
is completely identical and probably should differ in the future.
2009-09-03 19:10:42 +10:00
Kamen Mazdrashki
47dfe78142 Ignoring generated files:
libcli/smb/smb_common_proto.h
source4/torture/ntp/proto.h
2009-09-03 19:09:50 +10:00
Andrew Tridgell
d3d6713c59 another large change to the linked_attribute module
This one copes with deleted objects where linked attributes have been
set on the module. We hit this when we do the ldb wipe at the start of
a provision, which trigers linked attribute updates, but for objects
that have disappeared. We need to ensure that the linked attribute
updates only happen on the right object, and if the object gets
re-created (as happens with a provision) then it is not the right
object.

To cope with this we record the GUID of the object when the operation
that triggered the linked attribute update comes in, and then find the
DN by suing that GUID when we apply the change in the prepare commit
hook.
2009-09-03 18:36:10 +10:00
Andrew Tridgell
b72b8f6e7d hook on prepare_commit instead of transaction_end
This allows for safe transaction end aborts
2009-09-03 18:36:10 +10:00
Andrew Tridgell
47f52e7a33 greatly simplify the transaction processing in the partition module
Now that ldb is calling prepare commit separately, the job of the
partition module on transaction end is much simpler (and more robust!)
2009-09-03 18:36:09 +10:00
Andrew Tridgell
7dbe0797b1 show more reasonable object counts during a vampire
We now show the total number of objects we have processed, which gives
the user a better idea of how much has been done. A vampire on a large
domain can take an hour or more (which needs to be fixed btw, it is a
problem with the lack of scalability of the ltdb index code). Watching
the same msg for an hour makes you wonder if any progress is being
made!
2009-09-03 18:36:09 +10:00
Andrew Tridgell
bfccc4590d always use prepare_commit in ldb transaction commits if possible
The reason we need this is to make multi-tdb transactions safe, with
the partition module. The linked_attributes and repl_meta_data modules
now do extra processing when the transaction ends, and that processing
can fail. When it fails we need to cancel the transaction, which we
can only do if the hook is on the prepare commit instead of the end
transaction call. Otherwise the partition module cannot ensure that no
commit has been done on another partition.
2009-09-03 18:36:09 +10:00
Andrew Tridgell
c37f290043 added dsdb_find_guid_by_dn()
This will be used by the linked_attribute module
2009-09-03 18:36:09 +10:00
Andrew Tridgell
617bbd913d allow setting of the debug level in python from C 2009-09-03 18:36:09 +10:00
Andrew Tridgell
348824da75 change repl_meta_data to process linked_attributes structures in end_transaction
When running at functional level 2 or above, the repl_meta_data module
can receive linked attribute structures from the repl replication
task. These attributes can come through DRS before the associated
objects have been created. To cope with this, we need to process
linked attributes in the end_transaction hook.
2009-09-03 18:36:09 +10:00
Andrew Tridgell
aff1e623aa fixed transaction handling in linked_attributes module
We need to call down to the next transaction function when we finish
in linked_attributes.

This also changes linked_attributes to use the common
dsdb_find_dn_by_guid() function
2009-09-03 18:36:09 +10:00
Andrew Tridgell
e6257d94de add the the linked attributes elements to the repl structure
This exposes the linked_attributes to the repl_meta_data module
2009-09-03 18:36:08 +10:00
Andrew Tridgell
95fd3c8ee0 tell the server that we support linked attribute replication 2009-09-03 18:36:08 +10:00
Andrew Tridgell
5d23ad8c2d added dsdb_find_dn_by_guid()
This came from the linked_attributes module, but now the
repl_meta_data module needs the same functionality, so move it to a
common routine.
2009-09-03 18:36:08 +10:00
Andrew Tridgell
642a84c129 fix the ndr print routines for samba4
This uses a hackish #if just for samba4. The proper fix is much more
complex.
2009-09-03 18:36:08 +10:00
Andrew Tridgell
127bf61a40 support config files in the current directory 2009-09-03 18:36:08 +10:00
Anatoliy Atanasov
c033b2dd2d Fix for DSSYNC test against Windows 2003 2009-09-03 18:36:08 +10:00
Volker Lendecke
5c54e4c103 s3:libsmb: Attempt to fix bug 6665
Before the async libsmb rewrites, we sent tid==0 on negprot. With the rewrite,
we send 0xffff. This *should* not matter, but this is one difference in the
sniffs I see.
2009-09-03 09:23:57 +02:00
Günther Deschner
5268783e5c s3-net: allow to exit "net rpc sh" with "q" as well.
Guenther
2009-09-02 23:19:20 +02:00
Günther Deschner
a0b1968167 s3-netlogon: use WERRORs in NETLOGON_INFO structures.
Guenther
2009-09-02 15:29:44 +02:00
Matt Kraai
6657598168 Do not redefine strupr
Signed-off-by: Günther Deschner <gd@samba.org>
2009-09-02 13:02:39 +02:00
Günther Deschner
f092d689c5 s3-pdb_ldap: Fix bug #4296: Clean up group membership while deleting a user.
Note that this only is tried with editposix=yes.

Guenther
2009-09-02 12:40:47 +02:00
Günther Deschner
9bf74d0ed9 s4-smbtorture: test netr_ServerSetPassword2 against Samba3.
Guenther
2009-09-02 10:47:36 +02:00
Günther Deschner
2b8afd2257 s3-netlogon: implement _netr_ServerPasswordSet2.
Guenther
2009-09-02 10:47:36 +02:00
Günther Deschner
71e9dfc0cd s3-netlogon: rework _netr_ServerPasswordSet.
Guenther
2009-09-02 10:47:35 +02:00
Andrew Tridgell
bde679e6f8 show the full set of command line options for ldb tools
I always found it hard to remember some of the options. We might as
well use popt to give us the full list
2009-09-02 18:31:59 +10:00
Günther Deschner
931771138a s3-netlogon: implement _netr_LogonSamLogonWithFlags().
Guenther
2009-09-02 10:23:28 +02:00
Andrew Tridgell
9f031352c6 traverse the ac list in reverse order
items are added to the linked attribute list using DLIST_ADD(), which
means to commit them to the database in the same order they came from
the server we need to walk the list backwards when we traverse it
2009-09-02 18:19:56 +10:00
Andrew Tridgell
b5f63160d4 repl_meta_data should only be included when we are a DC 2009-09-02 18:19:56 +10:00
Andrew Tridgell
ca45847eda s4:dsdb rewrite the linked_atrributes code to commit in the end_transaction hook
linked attribute changes can come in any order. This means it is
possible for a forward link to come over the wire in DRS before the
target even exists. To make this work this patch changed the linked
attributes module to gather up all the changes it needs to make in a
linked list, then execute the changes in the end_transaction hook for
the module.

During that commit phase we also fix up all the DNs that we got by
searching for their GUID, as the objects may have moved after the
linked attribute was sent, but before the end of the transaction
2009-09-02 18:19:56 +10:00
Andrew Tridgell
199be936d8 move the repl_meta_data module up the ldb module stack
The repl_meta_data module needs to be above the linked_attributes
module, to allow linked_attributes to do its magic
2009-09-02 18:19:56 +10:00