ira/wip.git
14 years agos4: added the structure for repsTo
Andrew Tridgell [Tue, 8 Sep 2009 01:51:01 +0000 (11:51 +1000)]
s4: added the structure for repsTo

This structure is stored in NDR format in the repsTo attribute of each
partition. It is updated by the DSUpdateRefs DSRUAPI call

14 years agos4: fixed updaterefs options bitmap
Andrew Tridgell [Tue, 8 Sep 2009 01:50:14 +0000 (11:50 +1000)]
s4: fixed updaterefs options bitmap

14 years agos4: implemented server side of DSUpdateRefs call
Andrew Tridgell [Tue, 8 Sep 2009 01:49:28 +0000 (11:49 +1000)]
s4: implemented server side of DSUpdateRefs call

This call is made by DCs to tell us we should notify them of directory
changes

14 years agos4/ldb: fixed spelling
Andrew Tridgell [Tue, 8 Sep 2009 01:47:36 +0000 (11:47 +1000)]
s4/ldb: fixed spelling

14 years agos4: 'index' is a libc function
Andrew Tridgell [Tue, 8 Sep 2009 01:47:11 +0000 (11:47 +1000)]
s4: 'index' is a libc function

14 years agos4: fixed a unsigned printf warnings
Andrew Tridgell [Tue, 8 Sep 2009 01:46:49 +0000 (11:46 +1000)]
s4: fixed a unsigned printf warnings

14 years agos4: removed an unused variable
Andrew Tridgell [Tue, 8 Sep 2009 01:46:27 +0000 (11:46 +1000)]
s4: removed an unused variable

14 years agos4: fixed some shadowed variable warnings
Andrew Tridgell [Tue, 8 Sep 2009 01:46:08 +0000 (11:46 +1000)]
s4: fixed some shadowed variable warnings

14 years agoFill the meta data vector in the responce struct.
Anatoliy Atanasov [Thu, 3 Sep 2009 15:37:31 +0000 (18:37 +0300)]
Fill the meta data vector in the responce struct.

14 years agos4:selftest Fix 'make testenv-gdb' and 'make valgrindtest' etc
Andrew Bartlett [Tue, 8 Sep 2009 00:48:40 +0000 (10:48 +1000)]
s4:selftest Fix 'make testenv-gdb' and 'make valgrindtest' etc

The problem here was that tridge's changes to ensure that test results
were always propogated didn't merge well with the addition of extra
environment variables for the 'make valgrindtest' and similar
environments.  By splitting out the macro further, we keep the build
farm reporting accurate, but allow these other test modes to work.

Andrew Bartlett

14 years agos4:tests/iconv - Fix a warning
Matthias Dieter Wallnöfer [Mon, 7 Sep 2009 10:38:44 +0000 (12:38 +0200)]
s4:tests/iconv - Fix a warning

14 years agos4:pwsettings: Correct off by factor of 10 for ticks.
Andrew Kroeger [Mon, 7 Sep 2009 03:28:56 +0000 (22:28 -0500)]
s4:pwsettings: Correct off by factor of 10 for ticks.

The tick conversion math was off by a factor of 10 due to the incorrect usage of
the "e" notation.  The expression "XeY" means "X * (10^Y)", so the correct
expression is 1e7 to get the correct adjustment for ticks.

14 years agogitignore: Ignore additional auto-generated files.
Andrew Kroeger [Mon, 7 Sep 2009 03:25:53 +0000 (22:25 -0500)]
gitignore: Ignore additional auto-generated files.

14 years agos4: Let the "setpassword" script finally use the "samdb_set_password" routine
Matthias Dieter Wallnöfer [Wed, 19 Aug 2009 10:37:11 +0000 (12:37 +0200)]
s4: Let the "setpassword" script finally use the "samdb_set_password" routine

The "setpassword" script should use the "samdb_set_password" call to change
the NT user password. Windows Server tests show that "userPassword" is not the
right place to save the NT password and does not inherit the password complexity.

14 years agos4:dsdb: correctly implement _dsdb_syntax_OID_oid_ldb_to_drsuapi()
Stefan Metzmacher [Fri, 4 Sep 2009 12:31:28 +0000 (14:31 +0200)]
s4:dsdb: correctly implement _dsdb_syntax_OID_oid_ldb_to_drsuapi()

Here we just need to map the oid string in the ldb value to
the ATTRTYP id.

metze

14 years agolib/tdr: fix the build with --enable-automatic-dependencies
Stefan Metzmacher [Mon, 7 Sep 2009 12:21:11 +0000 (14:21 +0200)]
lib/tdr: fix the build with --enable-automatic-dependencies

metze

14 years agos4:LogonGetDomainInfo - add a basic check for the hostname
Matthias Dieter Wallnöfer [Mon, 7 Sep 2009 10:00:11 +0000 (12:00 +0200)]
s4:LogonGetDomainInfo - add a basic check for the hostname

This check is specified in Windows Server after release 2003.
The parameter "hostname" should match as prefix of the dns hostname given as
parameter in the "workstation" structure.

14 years agotdb: fix c++ build warning.
Günther Deschner [Mon, 7 Sep 2009 09:56:10 +0000 (11:56 +0200)]
tdb: fix c++ build warning.

Guenther

14 years agos4: Fix "Small memory leak after calling several times lp_update"
Inra [Mon, 7 Sep 2009 07:40:34 +0000 (09:40 +0200)]
s4: Fix "Small memory leak after calling several times lp_update"

Should fix bug #6660.

14 years agos4: Exceptions in "provision.py"
Michael Ströder [Mon, 7 Sep 2009 07:12:09 +0000 (09:12 +0200)]
s4: Exceptions in "provision.py"

This looks much nicer than "normal" string exceptions - and fits better in the OO
programming style.

14 years agos4:simple_ldap_map - "primaryGroupId"
Matthias Dieter Wallnöfer [Mon, 7 Sep 2009 07:00:46 +0000 (09:00 +0200)]
s4:simple_ldap_map - "primaryGroupId"

Previous patch was incomplete regarding the "primaryGroupId" attribute. Complete it.

14 years agos4:samldb - Fix typo
Matthias Dieter Wallnöfer [Sun, 6 Sep 2009 18:23:02 +0000 (20:23 +0200)]
s4:samldb - Fix typo

14 years agos4:Foreign security principals - Fix them up
Matthias Dieter Wallnöfer [Sun, 6 Sep 2009 17:57:50 +0000 (19:57 +0200)]
s4:Foreign security principals - Fix them up

I fixed them up to match with Windows Server 2003. I don't think that the
creation of them in the provision script is needed so I put them in the
"provision_users.ldif" file.

14 years agos4:subtree delete module - Cosmetic adaptions
Matthias Dieter Wallnöfer [Sun, 6 Sep 2009 15:27:51 +0000 (17:27 +0200)]
s4:subtree delete module - Cosmetic adaptions

14 years agos4:ldap.py - Adds a test for the primary group behaviour
Matthias Dieter Wallnöfer [Tue, 25 Aug 2009 23:49:00 +0000 (01:49 +0200)]
s4:ldap.py - Adds a test for the primary group behaviour

This passes the Windows Server behaviour. Also SAMBA 4 should match it.

Also some small enhancement.

14 years agos4:provision - Change the module order to match Windows Server
Matthias Dieter Wallnöfer [Thu, 20 Aug 2009 19:13:13 +0000 (21:13 +0200)]
s4:provision - Change the module order to match Windows Server

Tests show that Windows Server seems to do the access checks on the very last moment.

14 years agos4:sam - Implement also here the right primary group behaviour
Matthias Dieter Wallnöfer [Mon, 17 Aug 2009 21:39:41 +0000 (23:39 +0200)]
s4:sam - Implement also here the right primary group behaviour

We have not only to expand the additional groups but *also* the primary group to
gain all rights of a user account.

Also, remove an unneeded context (tmp_ctx) and "talloc_steal".

14 years agos4:samr - Fix up the SAMR server to support the primary group of a user in the right way
Matthias Dieter Wallnöfer [Mon, 17 Aug 2009 20:34:08 +0000 (22:34 +0200)]
s4:samr - Fix up the SAMR server to support the primary group of a user in the right way

When doing some tests with the NT User Manager for Domains on s4 I noticed that the
handling of the primary group for a user wasn't correct. So I fixed this.

Also some cosmetic changes (tab indent corrections).

14 years agos4:samldb - Major rework
Matthias Dieter Wallnöfer [Mon, 17 Aug 2009 19:29:47 +0000 (21:29 +0200)]
s4:samldb - Major rework

This fixes up the change of the primary group of a user when using the ADUC
console:
- When the "primaryGroupId" attribute changes, we have to delete the
  "member"/"memberOf" attribute reference of the new primary group and add one
  for the old primary group.
- Deny deletion of primary groups according to Windows Server (so we cannot
  have invalid "primaryGroupID" attributes in our AD).
- We cannot add a primary group directly before it isn't a secondary one of a
  user account.
- We cannot add a secondary reference ("member" attribute) when the group has
  been chosen as primary one.

This also removes the LDB templates which are basically overhead now.

This should also fix bug #6599.

14 years agos4:provision - Add a new delete function only for users and computers
Matthias Dieter Wallnöfer [Sun, 6 Sep 2009 19:08:08 +0000 (21:08 +0200)]
s4:provision - Add a new delete function only for users and computers

We need this new function to delete users and computers before other objects
on reprovisioning. Otherwise primary groups could be deleted before user/computer
accounts (which isn't allowed anymore by the reworked "samldb" module).

14 years agos4:provision - Change the "provision_users.ldif" file to support the "samldb" changes
Matthias Dieter Wallnöfer [Wed, 26 Aug 2009 01:51:45 +0000 (03:51 +0200)]
s4:provision - Change the "provision_users.ldif" file to support the "samldb" changes

The "provision_users.ldif" file needs some rework to pass against the changed
and improved "samldb" module (see next commit).

14 years agoFix bug 6673 - smbpasswd does not work with "unix password sync = yes".
Jeremy Allison [Mon, 7 Sep 2009 04:38:50 +0000 (21:38 -0700)]
Fix bug 6673 - smbpasswd does not work with "unix password sync = yes".
Revert change from 3.3 -> 3.4 with read_socket_with_timeout changed
from sys_read() to sys_recv(). read_socket_with_timeout() is called
with non-fd's (with a pty in chgpasswd.c and with a disk file in
lib/dbwrap_file.c via read_data()). recv works for the disk file,
but not the pty. Change the name of read_socket_with_timeout() to
read_fd_with_timeout() to make this clear (and add comments).
Jeremy.

14 years agos4:setup_dns.sh fixed the update of the GUID CNAME
Andrew Tridgell [Mon, 7 Sep 2009 04:08:03 +0000 (14:08 +1000)]
s4:setup_dns.sh fixed the update of the GUID CNAME

14 years agos4:nsupdate-gss allow forcing of the realm
Andrew Tridgell [Mon, 7 Sep 2009 04:07:39 +0000 (14:07 +1000)]
s4:nsupdate-gss allow forcing of the realm

this is needed for the _msdcs zone

14 years agos4:setup: Remove display_specifiers.ldif.
Andrew Kroeger [Wed, 2 Sep 2009 08:31:41 +0000 (03:31 -0500)]
s4:setup: Remove display_specifiers.ldif.

This file is no longer needed as the DisplaySpecifiers are now generated from
files provided by Microsoft.

14 years agos4:setup: Updated comment to reflect new DisplaySpecifiers location.
Andrew Kroeger [Wed, 2 Sep 2009 08:30:58 +0000 (03:30 -0500)]
s4:setup: Updated comment to reflect new DisplaySpecifiers location.

14 years agos4:setup: Use ms_display_specifiers script for provision.
Andrew Kroeger [Wed, 2 Sep 2009 08:25:22 +0000 (03:25 -0500)]
s4:setup: Use ms_display_specifiers script for provision.

Changed the provisioning to use the new script to parse the Microsoft-provided
DisplaySpecifiers LDIF file.

14 years agos4:setup: Added script to parse Microsoft DisplaySpecifiers document.
Andrew Kroeger [Wed, 2 Sep 2009 08:20:50 +0000 (03:20 -0500)]
s4:setup: Added script to parse Microsoft DisplaySpecifiers document.

Created this script based on the existing ms_schema.py script.

- Removed some unnecessary transformations that are only necessary for schema
  processing.
- Added capability to parse and properly output base64-encoded values.
- Removed unnecessary attributes based on what attributes were present (and also
  what were explicitly removed) from display_specifiers.ldif.

14 years agos4:setup: Change license headers to LDIF comments.
Andrew Kroeger [Mon, 7 Sep 2009 01:16:22 +0000 (11:16 +1000)]
s4:setup: Change license headers to LDIF comments.

The original license headers provided by Microsoft cannot be parsed as valid
LDIF.

Changed the license headers to be valid LDIF comments, and added a new header
section detailing the exact changes that were made to the original document.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
14 years agos4:setup Add DisplaySpecifiers from Microsoft.
Andrew Bartlett [Mon, 7 Sep 2009 00:48:09 +0000 (10:48 +1000)]
s4:setup Add DisplaySpecifiers from Microsoft.

Like the schema, these are provided under the licence at the head of
the file, which is not the GPL, but allows us to distribute them with
Samba.

Andrew Bartlett

14 years agos4: bring nsupdate-gss into the s4 tree
Andrew Tridgell [Mon, 7 Sep 2009 00:55:32 +0000 (10:55 +1000)]
s4: bring nsupdate-gss into the s4 tree

This is a perl script that does TSIG-GSS DNS updates against a AD
DC. The bind 9.5 nsupdate still doesn't seem to work with TSIG-GSS,
and we need a way to do DNS updates when we vampire a domain, so I
revived this ancient perl script and added a wrapper script that can
update DNS entries using our machine account credentials

14 years agos4: fixed the secrets.ldb construction in libnet
Andrew Tridgell [Mon, 7 Sep 2009 00:33:47 +0000 (10:33 +1000)]
s4: fixed the secrets.ldb construction in libnet

on a vampire join we were not putting the right attributes and
objectclass on the secrets.ldb record

14 years agos4: the secrets.ldb module needs the loadparm opaque setup
Andrew Tridgell [Mon, 7 Sep 2009 00:33:02 +0000 (10:33 +1000)]
s4: the secrets.ldb module needs the loadparm opaque setup

14 years agos3:winbind: Convert WINBINDD_SET_HWM to the new API
Volker Lendecke [Sun, 6 Sep 2009 13:18:58 +0000 (15:18 +0200)]
s3:winbind: Convert WINBINDD_SET_HWM to the new API

14 years agos3:winbind: Convert WINBINDD_REMOVE_MAPPING to the new API
Volker Lendecke [Sun, 6 Sep 2009 12:59:41 +0000 (14:59 +0200)]
s3:winbind: Convert WINBINDD_REMOVE_MAPPING to the new API

14 years agos3:winbind: Convert WINBINDD_SET_MAPPING to the new API
Volker Lendecke [Sun, 6 Sep 2009 12:47:06 +0000 (14:47 +0200)]
s3:winbind: Convert WINBINDD_SET_MAPPING to the new API

14 years agos3:winbind: Convert WINBINDD_CHECK_MACHACC to the new API
Volker Lendecke [Sun, 6 Sep 2009 07:32:34 +0000 (09:32 +0200)]
s3:winbind: Convert WINBINDD_CHECK_MACHACC to the new API

14 years agos3:smbd: Add the ntstatus to the smb_panic in share_mode_lock_destructor
Volker Lendecke [Sat, 5 Sep 2009 17:20:16 +0000 (19:20 +0200)]
s3:smbd: Add the ntstatus to the smb_panic in share_mode_lock_destructor

This might help finding why bug 6518 happens

14 years agos4:simple_ldap_map - Enhance it for supporting "primaryGroupID" in the right way
Matthias Dieter Wallnöfer [Tue, 25 Aug 2009 22:12:44 +0000 (00:12 +0200)]
s4:simple_ldap_map - Enhance it for supporting "primaryGroupID" in the right way

14 years agos4:torture - Fix uninitialized variable
Matthias Dieter Wallnöfer [Sun, 6 Sep 2009 10:10:16 +0000 (12:10 +0200)]
s4:torture - Fix uninitialized variable

14 years agos4:"linked attributes" modules - correct the comments
Matthias Dieter Wallnöfer [Wed, 26 Aug 2009 05:20:27 +0000 (07:20 +0200)]
s4:"linked attributes" modules - correct the comments

14 years agos4: Fix typo
Matthias Dieter Wallnöfer [Wed, 26 Aug 2009 03:17:40 +0000 (05:17 +0200)]
s4: Fix typo

14 years agos4:pwsettings - Introduce the LDB modify flags in the right way
Matthias Dieter Wallnöfer [Tue, 25 Aug 2009 23:33:21 +0000 (01:33 +0200)]
s4:pwsettings - Introduce the LDB modify flags in the right way

We can't emulate them through the LDB changetype flags since they haven't the
same constants! The previous behaviour led to huge problems.

14 years agos4:ldb_errors - add spaces
Matthias Dieter Wallnöfer [Tue, 25 Aug 2009 23:01:07 +0000 (01:01 +0200)]
s4:ldb_errors - add spaces

14 years agos4:dsdb/common/util.c - Copy parameters to prevent segfaults
Matthias Dieter Wallnöfer [Wed, 19 Aug 2009 09:58:42 +0000 (11:58 +0200)]
s4:dsdb/common/util.c - Copy parameters to prevent segfaults

The parameters "lmNewHash" and/or "ntNewHash" could be NULL and when we perform
write operations on them (look below in the code) we could get SIGSEGVs!

14 years agos4:dsdb/common/util - Indentation fixes
Matthias Dieter Wallnöfer [Wed, 19 Aug 2009 06:59:58 +0000 (08:59 +0200)]
s4:dsdb/common/util - Indentation fixes

14 years agoTell newbie devs about ./configure.developer
Rusty Russell [Sun, 6 Sep 2009 10:01:05 +0000 (12:01 +0200)]
Tell newbie devs about ./configure.developer

Enhances the outputs in autogen.sh for both s3 and s4.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
14 years agoCheck we read off the compelte event from inotify
Simo Sorce [Sat, 5 Sep 2009 14:18:12 +0000 (10:18 -0400)]
Check we read off the compelte event from inotify

The kernel may return a short read, so we must use read_data() to make sure we
read off the full buffer. If somethign bad happens we also need to kill the
inotify watch because the filedescriptor will return out of sync structures if
we read only part of the data.

14 years agoSave and report the correct errno value.
Simo Sorce [Sat, 5 Sep 2009 14:17:48 +0000 (10:17 -0400)]
Save and report the correct errno value.

14 years agos3:winbind: Use fstr_sprintf, it is simpler than talloc_asprintf->fstrcpy
Volker Lendecke [Sat, 5 Sep 2009 15:14:45 +0000 (17:14 +0200)]
s3:winbind: Use fstr_sprintf, it is simpler than talloc_asprintf->fstrcpy

14 years agos3:winbind: Remove pointless <cond> ? true : false;
Volker Lendecke [Sat, 5 Sep 2009 15:05:30 +0000 (17:05 +0200)]
s3:winbind: Remove pointless <cond> ? true : false;

14 years agos3:winbind: Make the pam_auth subfunctions static
Volker Lendecke [Sat, 5 Sep 2009 15:00:21 +0000 (17:00 +0200)]
s3:winbind: Make the pam_auth subfunctions static

14 years agos3:libsmb: Convert (state->received) to (state->received != 0)
Volker Lendecke [Thu, 3 Sep 2009 06:02:21 +0000 (08:02 +0200)]
s3:libsmb: Convert (state->received) to (state->received != 0)

This confused me for a second, this should not happen a second time :-)

14 years agoutil:tests: Correct time tests for negative UTC offsets.
Andrew Kroeger [Fri, 4 Sep 2009 21:45:01 +0000 (16:45 -0500)]
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.

14 years agoselftest: Account for 0-based months in date parsing and printing.
Andrew Kroeger [Fri, 4 Sep 2009 21:42:28 +0000 (16:42 -0500)]
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.

14 years agoAdd release script for tevent tevent-0.9.8
Simo Sorce [Fri, 4 Sep 2009 22:20:29 +0000 (18:20 -0400)]
Add release script for tevent

14 years agos4:configure: require tevent >= 0.9.8
Stefan Metzmacher [Fri, 4 Sep 2009 10:57:13 +0000 (12:57 +0200)]
s4:configure: require tevent >= 0.9.8

metze

14 years agotevent: change version to 0.9.8 after some critical bugs have been fixed
Stefan Metzmacher [Fri, 4 Sep 2009 10:56:39 +0000 (12:56 +0200)]
tevent: change version to 0.9.8 after some critical bugs have been fixed

metze

14 years agocifs.upcall: do a brute-force search for KRB5 credcache
Jeff Layton [Fri, 4 Sep 2009 10:29:44 +0000 (06:29 -0400)]
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>
14 years agos4:python fixed subunit tests of dcerpc
Andrew Tridgell [Fri, 4 Sep 2009 08:07:04 +0000 (18:07 +1000)]
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.

14 years agoldb: make ldb module programming less error prone
Andrew Tridgell [Fri, 4 Sep 2009 07:22:20 +0000 (17:22 +1000)]
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.

14 years agos3:winbind: Fix Coverity ID 933: FORWARD_NULL
Volker Lendecke [Fri, 4 Sep 2009 05:59:51 +0000 (07:59 +0200)]
s3:winbind: Fix Coverity ID 933: FORWARD_NULL

14 years agos3:smbd: Fix Coverity ID 937, REVERSE_INULL
Volker Lendecke [Fri, 4 Sep 2009 05:57:19 +0000 (07:57 +0200)]
s3:smbd: Fix Coverity ID 937, REVERSE_INULL

14 years agos3:winbind: Fix Coverity ID 940: Resource Leak
Volker Lendecke [Fri, 4 Sep 2009 05:52:28 +0000 (07:52 +0200)]
s3:winbind: Fix Coverity ID 940: Resource Leak

14 years agoldb: ensure we cancel a ldb transaction
Andrew Tridgell [Fri, 4 Sep 2009 03:59:44 +0000 (13:59 +1000)]
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

14 years agos4: fixed a missing NULL termination in a attribute list passed to ldb_search
Andrew Tridgell [Fri, 4 Sep 2009 03:58:17 +0000 (13:58 +1000)]
s4: fixed a missing NULL termination in a attribute list passed to ldb_search

14 years agoreport the location of the original talloc_free on double free talloc-2.0.0
Andrew Tridgell [Fri, 4 Sep 2009 03:56:46 +0000 (13:56 +1000)]
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.

14 years agowbinfo: fix various valgrind warnings and an invalid free.
Günther Deschner [Thu, 3 Sep 2009 22:02:13 +0000 (00:02 +0200)]
wbinfo: fix various valgrind warnings and an invalid free.

Kai, please check.

Guenther

14 years agos3-ntlm_auth: fix two segfaults in diagnostics mode.
Günther Deschner [Thu, 3 Sep 2009 21:49:50 +0000 (23:49 +0200)]
s3-ntlm_auth: fix two segfaults in diagnostics mode.

Guenther

14 years agoHopefully last part of the fix for bug 6651 - smbd SIGSEGV when breaking oplocks.
Jeremy Allison [Thu, 3 Sep 2009 14:40:48 +0000 (07:40 -0700)]
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.

14 years agoAnother part of the fix for bug 6651 - smbd SIGSEGV when breaking oplocks.
Jeremy Allison [Thu, 3 Sep 2009 14:38:21 +0000 (07:38 -0700)]
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.

14 years agoFirst attempt to implement dcesrv_drsuapi_DsGetNCChanges
Anatoliy Atanasov [Wed, 2 Sep 2009 14:39:28 +0000 (17:39 +0300)]
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.

14 years agoFix the dsdb_syntax_OID_ldb_to_drsuapi function
Anatoliy Atanasov [Wed, 2 Sep 2009 14:20:16 +0000 (17:20 +0300)]
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.

14 years agoIgnoring generated files:
Kamen Mazdrashki [Fri, 21 Aug 2009 11:39:09 +0000 (14:39 +0300)]
Ignoring generated files:

libcli/smb/smb_common_proto.h
source4/torture/ntp/proto.h

14 years agoanother large change to the linked_attribute module
Andrew Tridgell [Thu, 3 Sep 2009 08:36:02 +0000 (18:36 +1000)]
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.

14 years agohook on prepare_commit instead of transaction_end
Andrew Tridgell [Thu, 3 Sep 2009 08:33:17 +0000 (18:33 +1000)]
hook on prepare_commit instead of transaction_end

This allows for safe transaction end aborts

14 years agogreatly simplify the transaction processing in the partition module
Andrew Tridgell [Thu, 3 Sep 2009 08:32:42 +0000 (18:32 +1000)]
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!)

14 years agoshow more reasonable object counts during a vampire
Andrew Tridgell [Thu, 3 Sep 2009 08:31:45 +0000 (18:31 +1000)]
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!

14 years agoalways use prepare_commit in ldb transaction commits if possible
Andrew Tridgell [Thu, 3 Sep 2009 08:29:58 +0000 (18:29 +1000)]
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.

14 years agoadded dsdb_find_guid_by_dn()
Andrew Tridgell [Thu, 3 Sep 2009 08:27:29 +0000 (18:27 +1000)]
added dsdb_find_guid_by_dn()

This will be used by the linked_attribute module

14 years agoallow setting of the debug level in python from C
Andrew Tridgell [Thu, 3 Sep 2009 03:03:31 +0000 (13:03 +1000)]
allow setting of the debug level in python from C

14 years agochange repl_meta_data to process linked_attributes structures in end_transaction
Andrew Tridgell [Thu, 3 Sep 2009 02:55:57 +0000 (12:55 +1000)]
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.

14 years agofixed transaction handling in linked_attributes module
Andrew Tridgell [Thu, 3 Sep 2009 02:53:36 +0000 (12:53 +1000)]
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

14 years agoadd the the linked attributes elements to the repl structure
Andrew Tridgell [Thu, 3 Sep 2009 02:52:31 +0000 (12:52 +1000)]
add the the linked attributes elements to the repl structure

This exposes the linked_attributes to the repl_meta_data module

14 years agotell the server that we support linked attribute replication
Andrew Tridgell [Thu, 3 Sep 2009 02:51:42 +0000 (12:51 +1000)]
tell the server that we support linked attribute replication

14 years agoadded dsdb_find_dn_by_guid()
Andrew Tridgell [Thu, 3 Sep 2009 02:51:22 +0000 (12:51 +1000)]
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.

14 years agofix the ndr print routines for samba4
Andrew Tridgell [Thu, 3 Sep 2009 02:50:19 +0000 (12:50 +1000)]
fix the ndr print routines for samba4

This uses a hackish #if just for samba4. The proper fix is much more
complex.

14 years agosupport config files in the current directory
Andrew Tridgell [Wed, 2 Sep 2009 11:51:02 +0000 (21:51 +1000)]
support config files in the current directory

14 years agoFix for DSSYNC test against Windows 2003
Anatoliy Atanasov [Tue, 25 Aug 2009 15:39:06 +0000 (18:39 +0300)]
Fix for DSSYNC test against Windows 2003

14 years agos3:libsmb: Attempt to fix bug 6665
Volker Lendecke [Thu, 3 Sep 2009 07:18:10 +0000 (09:18 +0200)]
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.