nivanova/samba-autobuild/.git
5 years agoselftest: Test creation of the dns-SERVER account during selftest
Andrew Bartlett [Tue, 25 Dec 2012 23:03:47 +0000 (10:03 +1100)]
selftest: Test creation of the dns-SERVER account during selftest

We do this by having the samba-tool domain dcpromo for promoted_vampire_dc also create a
dns-SERVER account.

Andrew Bartlett

Reviewed-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
5 years agoscripting/samba_upgradedns: Tighten up exception and attribute list handling
Andrew Bartlett [Sun, 23 Dec 2012 22:12:04 +0000 (09:12 +1100)]
scripting/samba_upgradedns: Tighten up exception and attribute list handling

This avoids asking for attributes that will not be used, and looks only for the
expected exceptions, rather than all exceptions.

Andrew Bartlett

Reviewed-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
5 years agoscripting/join.py: Handle creating the dns-NAME account during a DC join
Andrew Bartlett [Sun, 23 Dec 2012 21:56:50 +0000 (08:56 +1100)]
scripting/join.py: Handle creating the dns-NAME account during a DC join

This will ensure that the DLZ plugin works out of the box when joining a second Samba DC to the
domain.

Andrew Bartlett

Reviewed-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
5 years agoOptimization. Don't do the retry logic if sitename_fetch() returned NULL, we already...
Jeremy Allison [Tue, 3 Sep 2013 21:07:43 +0000 (14:07 -0700)]
Optimization. Don't do the retry logic if sitename_fetch() returned NULL, we already did a NULL query.

Bug 5917 - Samba does not work on site with Read Only Domain Controller

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Sep  4 01:19:05 CEST 2013 on sn-devel-104

5 years agoMove the retry logic when site_name is passed in a NULL or "" to the wrapper function.
Jeremy Allison [Tue, 3 Sep 2013 19:20:52 +0000 (12:20 -0700)]
Move the retry logic when site_name is passed in a NULL or "" to the wrapper function.

Bug 5917 - Samba does not work on site with Read Only Domain Controller

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Richard Sharpe <rsharpe@samba.org>
5 years agoMove the manipulation of site_name into the caller function dsgetdcname().
Jeremy Allison [Tue, 3 Sep 2013 19:08:46 +0000 (12:08 -0700)]
Move the manipulation of site_name into the caller function dsgetdcname().

Leave dsgetdcname_internal() only using const char *site_name.

Bug 5917 - Samba does not work on site with Read Only Domain Controller

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Richard Sharpe <rsharpe@samba.org>
5 years agoRefactor dsgetdcname to be called via a wrapper function.
Jeremy Allison [Tue, 3 Sep 2013 19:04:37 +0000 (12:04 -0700)]
Refactor dsgetdcname to be called via a wrapper function.

Bug 5917 - Samba does not work on site with Read Only Domain Controller

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Richard Sharpe <rsharpe@samba.org>
5 years agodsgetdcname_cache_fetch() doesn't use the site_name parameter so don't pass it.
Jeremy Allison [Tue, 3 Sep 2013 19:13:45 +0000 (12:13 -0700)]
dsgetdcname_cache_fetch() doesn't use the site_name parameter so don't pass it.

Bug 5917 - Samba does not work on site with Read Only Domain Controller

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Richard Sharpe <rsharpe@samba.org>
5 years agotorture3: Trigger a nasty cleanup bug in smbd
Volker Lendecke [Sun, 1 Sep 2013 16:54:59 +0000 (18:54 +0200)]
torture3: Trigger a nasty cleanup bug in smbd

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Sep  3 19:13:14 CEST 2013 on sn-devel-104

5 years agosmbd: Fix flawed share_mode_stale_pid API
Volker Lendecke [Fri, 30 Aug 2013 12:49:43 +0000 (12:49 +0000)]
smbd: Fix flawed share_mode_stale_pid API

The comment for this routine said:

> Modifies d->num_share_modes, watch out in routines iterating over
> that array.

Well, it turns out that *every* caller of this API got it wrong. So I
think it's better to change the routine.

This leaves the array untouched while iterating but filters out the
deleted ones while saving them back to disk.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agosmbd: Rename parameter "i" to "idx"
Volker Lendecke [Fri, 30 Aug 2013 12:27:36 +0000 (12:27 +0000)]
smbd: Rename parameter "i" to "idx"

We'll need "i" in a later checkin ... :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agosmbd: Don't store in-memory only flags in locking.tdb
Volker Lendecke [Sun, 1 Sep 2013 09:07:19 +0000 (11:07 +0200)]
smbd: Don't store in-memory only flags in locking.tdb

Hey, pidl knows the [skip] attribute ... :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agosmbd: Simplify find_oplock_types
Volker Lendecke [Thu, 22 Aug 2013 08:49:07 +0000 (08:49 +0000)]
smbd: Simplify find_oplock_types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agodocs: fix a typo on the description of "acl check permissions"
Michael Adam [Mon, 2 Sep 2013 14:53:48 +0000 (16:53 +0200)]
docs: fix a typo on the description of "acl check permissions"

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Sep  2 23:03:01 CEST 2013 on sn-devel-104

5 years agopython/provision: remove unused linklocal=False argument from interface_ips_v6()
Stefan Metzmacher [Fri, 30 Aug 2013 13:18:44 +0000 (15:18 +0200)]
python/provision: remove unused linklocal=False argument from interface_ips_v6()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Bjoern Jacke <bj@sernet.de>
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Fri Aug 30 17:33:58 CEST 2013 on sn-devel-104

5 years agos4:samba_upgradedns: don't pass linklocal=False to interface_ips_v6()
Stefan Metzmacher [Fri, 30 Aug 2013 13:17:59 +0000 (15:17 +0200)]
s4:samba_upgradedns: don't pass linklocal=False to interface_ips_v6()

This is the default...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Bjoern Jacke <bj@sernet.de>
5 years agopython/pyglue: filter out loopback and linklocal addresses unless all_interfaces...
Stefan Metzmacher [Fri, 30 Aug 2013 12:59:01 +0000 (14:59 +0200)]
python/pyglue: filter out loopback and linklocal addresses unless all_interfaces is given

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Bjoern Jacke <bj@sernet.de>
5 years agovfs_glusterfs: Fix excessive debug output from vfs_gluster_open().
Christopher R. Hertel [Thu, 29 Aug 2013 21:58:16 +0000 (16:58 -0500)]
vfs_glusterfs: Fix excessive debug output from vfs_gluster_open().

The vfs_gluster_open() function generates a debug message (at level 0)
for every failed attempt to open a pathname.  This includes cases in
which attempts are made to open a directory as a file (those attempts
are retried calling vfs_gluster_opendir()).  The result is that the log
file fills with messages about failed attempts to open directories, just
because they are directories.

This latest version, of the patch completely removes logging from the
vfs_gluster_open() function.  The error code returned is handled in
upper layers, and the open function in the default VFS module does not
log any errors.

Signed-off-by: Christopher R. Hertel <crh@redhat.com>
Reviewed-by: susant palai <spalai@redhat.com>
Reviewed-by: raghavendra talur <rtalur@redhat.com>
Reviewed-by: Jose A. Rivera <jarrpa@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Aug 30 02:43:48 CEST 2013 on sn-devel-104

5 years agos3:winbind: fail ads_cached_connection_connect() if realm == NULL
Michael Adam [Thu, 29 Aug 2013 14:38:08 +0000 (16:38 +0200)]
s3:winbind: fail ads_cached_connection_connect() if realm == NULL

This prevents segfaults when e.g. a previous SMB_STRDUP failed..

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Thu Aug 29 18:54:28 CEST 2013 on sn-devel-104

5 years agos3-winbindd: remove unneded include of secrets.h from idmap_ad.c
Günther Deschner [Wed, 28 Aug 2013 12:53:08 +0000 (14:53 +0200)]
s3-winbindd: remove unneded include of secrets.h from idmap_ad.c

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3-winbindd: use get_trust_pw_clear() wrapper for AD connection code.
Günther Deschner [Wed, 28 Aug 2013 12:53:08 +0000 (14:53 +0200)]
s3-winbindd: use get_trust_pw_clear() wrapper for AD connection code.

This avoids calling secrets functions directly.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3-winbindd: make sure also the idmap code can deal with trusted domains.
Günther Deschner [Fri, 23 Aug 2013 12:56:17 +0000 (14:56 +0200)]
s3-winbindd: make sure also the idmap code can deal with trusted domains.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3-winbindd: use find_domain_from_name() instead of find_domain_from_name_no_init().
Günther Deschner [Wed, 28 Aug 2013 13:00:06 +0000 (15:00 +0200)]
s3-winbindd: use find_domain_from_name() instead of find_domain_from_name_no_init().

Otherwise there is a good chance the domain has not been connected and we don't
know the realm name yet.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3-winbindd: Fix winbind on DC crash with trusted AD domains.
Günther Deschner [Thu, 22 Aug 2013 14:36:27 +0000 (16:36 +0200)]
s3-winbindd: Fix winbind on DC crash with trusted AD domains.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3-winbindd: Fix memory leak in ads_cached_connection().
Günther Deschner [Fri, 23 Aug 2013 10:33:53 +0000 (12:33 +0200)]
s3-winbindd: Fix memory leak in ads_cached_connection().

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3-winbindd: remove pointless variable assigment, see the strdup below.
Günther Deschner [Thu, 22 Aug 2013 13:39:08 +0000 (15:39 +0200)]
s3-winbindd: remove pointless variable assigment, see the strdup below.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoprovision: Rewrite named.txt to be more useful
Andrew Bartlett [Wed, 28 Aug 2013 01:35:47 +0000 (13:35 +1200)]
provision: Rewrite named.txt to be more useful

We already chown the dns.keytab file, so remove the suggestion to do that,
and instead explain why we can not use chroot (an often-requested feature).

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Björn Jacke <bj@sernet.de>
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Thu Aug 29 13:53:25 CEST 2013 on sn-devel-104

5 years agodocs: Add man samba-regedit.8.
Karolin Seeger [Thu, 22 Aug 2013 10:55:53 +0000 (12:55 +0200)]
docs: Add man samba-regedit.8.

Fix bug #10001 - Man page for samba-regedit tool missing.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Signed-off-by: Björn Jacke <bj@sernet.de>
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Thu Aug 29 03:15:51 CEST 2013 on sn-devel-104

5 years agotorture: Add buffercheck tests
Volker Lendecke [Tue, 27 Aug 2013 09:41:13 +0000 (09:41 +0000)]
torture: Add buffercheck tests

Make sure we get the smb2 infolevel fixed portions right

I could not find correct #defines for the infolevels

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10106
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): Thu Aug 29 01:27:11 CEST 2013 on sn-devel-104

5 years agosmbd: Correctly return INFO_LENGTH_MISMATCH for smb1
Volker Lendecke [Tue, 27 Aug 2013 09:40:19 +0000 (09:40 +0000)]
smbd: Correctly return INFO_LENGTH_MISMATCH for smb1

This is required if the client offered less buffer than the fixed portion
of the info level data requires

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10106
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: Fix error return for STREAM_INFO
Volker Lendecke [Tue, 27 Aug 2013 09:39:17 +0000 (09:39 +0000)]
smbd: Fix error return for STREAM_INFO

The stream_info marshalling follows its own rules. This needs unifying
eventually...

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10106
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: Revert a93f9c3
Volker Lendecke [Tue, 27 Aug 2013 09:38:29 +0000 (09:38 +0000)]
smbd: Revert a93f9c3

This was too broad and has been replaced by finer-grained error checks

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10106
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: Correctly return BUFFER_OVERFLOW in smb2_getinfo
Volker Lendecke [Tue, 27 Aug 2013 09:37:34 +0000 (09:37 +0000)]
smbd: Correctly return BUFFER_OVERFLOW in smb2_getinfo

Also, don't overflow the client buffer

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10106
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: Correctly return INFO_LENGTH_MISMATCH in smb2_getinfo
Volker Lendecke [Tue, 27 Aug 2013 09:36:03 +0000 (09:36 +0000)]
smbd: Correctly return INFO_LENGTH_MISMATCH in smb2_getinfo

We have to return this error if the client offered less than the fixed
portion of the infolevel data requires

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10106
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: qfsinfo has fixed/variable buffers
Volker Lendecke [Tue, 27 Aug 2013 09:06:27 +0000 (09:06 +0000)]
smbd: qfsinfo has fixed/variable buffers

The error message will have to change depending whether the buffer is
too small for the fixed or variable buffers

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10106
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: qfilepathinfo has fixed/variable buffers
Volker Lendecke [Tue, 27 Aug 2013 09:06:27 +0000 (09:06 +0000)]
smbd: qfilepathinfo has fixed/variable buffers

The error message will have to change depending whether the buffer is
too small for the fixed or variable buffers

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10106
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agotorture3: add clipathinfo-bufsize
Volker Lendecke [Fri, 23 Aug 2013 13:57:03 +0000 (13:57 +0000)]
torture3: add clipathinfo-bufsize

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agodbwrap_ctdb: Treat empty records as non-existing
Volker Lendecke [Wed, 28 Aug 2013 11:34:08 +0000 (11:34 +0000)]
dbwrap_ctdb: Treat empty records as non-existing

This is a patch implementing the workaround Christian mentioned in
https://bugzilla.samba.org/show_bug.cgi?id=10008#c5

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10008
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
5 years agos3: fix missing braces in nfs4_acls.c
Abhidnya Joshi [Mon, 26 Aug 2013 07:01:49 +0000 (12:31 +0530)]
s3: fix missing braces in nfs4_acls.c

Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Aug 28 20:25:56 CEST 2013 on sn-devel-104

5 years agoFix valgrind errors with memmove and talloc pools.
Jeremy Allison [Tue, 27 Aug 2013 20:20:43 +0000 (13:20 -0700)]
Fix valgrind errors with memmove and talloc pools.

bin/smbtorture //127.0.0.1 local.talloc now runs with no valgrind errors.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: "Stefan (metze) Metzmacher" <metze@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Aug 28 02:44:17 CEST 2013 on sn-devel-104

5 years agoAdd simple limited pool tests to test_memlimit().
Jeremy Allison [Tue, 27 Aug 2013 20:09:03 +0000 (13:09 -0700)]
Add simple limited pool tests to test_memlimit().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
5 years agoRemove talloc_memlimit_update(). No longer used.
Jeremy Allison [Tue, 27 Aug 2013 20:08:33 +0000 (13:08 -0700)]
Remove talloc_memlimit_update(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
5 years agoInside _talloc_realloc(), keep track of size changes over malloc/realloc/free.
Jeremy Allison [Tue, 27 Aug 2013 20:07:04 +0000 (13:07 -0700)]
Inside _talloc_realloc(), keep track of size changes over malloc/realloc/free.

Replace the last use of talloc_memlimit_update() with talloc_memlimit_grow()/
talloc_memlimit_shrink().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
5 years agoDon't call talloc_memlimit_update() inside _talloc_realloc() when we're just manipula...
Jeremy Allison [Tue, 27 Aug 2013 20:03:27 +0000 (13:03 -0700)]
Don't call talloc_memlimit_update() inside _talloc_realloc() when we're just manipulating pool members.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
5 years agoFix a conditional check. (size - tc->size > 0) is always true if size and tc->size...
Jeremy Allison [Tue, 27 Aug 2013 19:59:04 +0000 (12:59 -0700)]
Fix a conditional check. (size - tc->size > 0) is always true if size and tc->size are unsigned.

Replace with (size > tc->size).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
5 years agoIn _talloc_steal_internal(), correctly decrement the memory limit in the source,...
Jeremy Allison [Tue, 27 Aug 2013 19:57:43 +0000 (12:57 -0700)]
In _talloc_steal_internal(), correctly decrement the memory limit in the source, and increment in the destination.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
5 years agoInside _talloc_free_internal(), always call talloc_memlimit_update_on_free() before...
Jeremy Allison [Tue, 27 Aug 2013 19:54:38 +0000 (12:54 -0700)]
Inside _talloc_free_internal(), always call talloc_memlimit_update_on_free() before we free the real memory.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
5 years agoUpdate memory limits when we call free() on a pool.
Jeremy Allison [Tue, 27 Aug 2013 19:51:20 +0000 (12:51 -0700)]
Update memory limits when we call free() on a pool.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
5 years agoChange __talloc() to only call talloc_memlimit_check()/talloc_memlimit_grow() on...
Jeremy Allison [Tue, 27 Aug 2013 19:49:00 +0000 (12:49 -0700)]
Change __talloc() to only call talloc_memlimit_check()/talloc_memlimit_grow() on actual malloc allocation.

Don't check the memlimit if the allocation was successful from a pool. We already
checked the memory limit when we created the pool.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
5 years agoChange _talloc_total_mem_internal() to ignore memory allocated from a pool when calcu...
Jeremy Allison [Tue, 27 Aug 2013 19:46:09 +0000 (12:46 -0700)]
Change _talloc_total_mem_internal() to ignore memory allocated from a pool when calculating limit size.

We must only count normal tallocs, or a talloc pool itself.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
5 years agoRemove magic TC_HDR_SIZE handling inside talloc_memlimit_check().
Jeremy Allison [Tue, 27 Aug 2013 19:43:50 +0000 (12:43 -0700)]
Remove magic TC_HDR_SIZE handling inside talloc_memlimit_check().

Callers already account for TC_HDR_SIZE, do not add it twice.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
5 years agoStart to fix talloc memlimits with talloc pools.
Jeremy Allison [Tue, 27 Aug 2013 19:36:23 +0000 (12:36 -0700)]
Start to fix talloc memlimits with talloc pools.

Add the functions:

talloc_memlimit_grow(), talloc_memlimit_shrink(),
talloc_memlimit_update_on_free().

as replacements for talloc_memlimit_update().
The interface to talloc_memlimit_update() is very
hard to understand and use. The above functions
are (to me) much clearer.

The goal of these changes is to only update
the memlimits on malloc/free/realloc, not
on every pool allocation. That way we only
count pool creation as allocation from any
imposed limits, not allocation from an already
created pool.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
5 years agosmbd: Use #defines in smb2_getinfo_send
Volker Lendecke [Mon, 26 Aug 2013 08:36:14 +0000 (08:36 +0000)]
smbd: Use #defines in smb2_getinfo_send

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): Tue Aug 27 15:08:08 CEST 2013 on sn-devel-104

5 years agoFix the UNIX extensions CHOWN calls to use FCHOWN if available, else LCHOWN.
Jeremy Allison [Wed, 21 Aug 2013 19:20:48 +0000 (12:20 -0700)]
Fix the UNIX extensions CHOWN calls to use FCHOWN if available, else LCHOWN.

UNIX extensions calls must never deref links.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Aug 26 20:19:46 CEST 2013 on sn-devel-104

5 years agoAllow UNIX extensions client to act on open fsp instead of pathname if available.
Jeremy Allison [Wed, 21 Aug 2013 19:10:05 +0000 (12:10 -0700)]
Allow UNIX extensions client to act on open fsp instead of pathname if available.

Eliminates possible race condition on pathname op.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
5 years agoFix the erroneous masking of chmod requests via the UNIX extensions.
Jeremy Allison [Wed, 21 Aug 2013 19:03:25 +0000 (12:03 -0700)]
Fix the erroneous masking of chmod requests via the UNIX extensions.

Changed from switch statement to if, as "create mask", "force create mode"
are only applied to new files, not existing ones. "directory mask",
"force directory mode" are only applied to new directories, not existing
ones.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
5 years agosmbd: Simplify dropbox special case in unix_convert
Volker Lendecke [Mon, 19 Aug 2013 10:26:00 +0000 (10:26 +0000)]
smbd: Simplify dropbox special case in unix_convert

EACCESS needs special treatment: If we want to create a fresh file,
return OBJECT_PATH_NOT_FOUND, so that the client will continue creating
the file. If the client wants us to open a potentially existing file,
we need to correctly return ACCESS_DENIED.

This patch makes this behaviour hopefully a bit clearer than the code
before did.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Aug 26 12:14:26 CEST 2013 on sn-devel-104

5 years agoRevert "Fix the erroneous masking of chmod requests via the UNIX extensions."
Jeremy Allison [Sun, 25 Aug 2013 01:44:28 +0000 (18:44 -0700)]
Revert "Fix the erroneous masking of chmod requests via the UNIX extensions."

Pushed from the wrong branch - this is the version
without Simo's review changes. Apologies to all
and I'll re-submit in less of a haste after the
weekend.

This reverts commit f124d6fbcd0a03bbd95d69477c144f475546de66.

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun Aug 25 05:44:11 CEST 2013 on sn-devel-104

5 years agoRevert "Allow UNIX extensions client to act on open fsp instead of pathname if availa...
Jeremy Allison [Sun, 25 Aug 2013 01:44:20 +0000 (18:44 -0700)]
Revert "Allow UNIX extensions client to act on open fsp instead of pathname if available."

Pushed from the wrong branch - this is the version
without Simo's review changes. Apologies to all
and I'll re-submit in less of a haste after the
weekend.

This reverts commit ce776551abb07f18cf302ee7c0c437ee27952099.

5 years agoPushed from the wrong branch - this is the version
Jeremy Allison [Sun, 25 Aug 2013 01:43:29 +0000 (18:43 -0700)]
Pushed from the wrong branch - this is the version
without Simo's review changes. Apologies to all
and I'll re-submit in less of a haste after the
weekend.

Revert "Fix the UNIX extensions CHOWN calls to use FCHOWN if available, else LCHOWN."

This reverts commit cf86adc4419f2636a0b24824ab04ebfcd5bb074d.

5 years agoFix the UNIX extensions CHOWN calls to use FCHOWN if available, else LCHOWN.
Jeremy Allison [Wed, 21 Aug 2013 19:20:48 +0000 (12:20 -0700)]
Fix the UNIX extensions CHOWN calls to use FCHOWN if available, else LCHOWN.

UNIX calls never deref links.

Signed-off-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun Aug 25 01:02:40 CEST 2013 on sn-devel-104

5 years agoAllow UNIX extensions client to act on open fsp instead of pathname if available.
Jeremy Allison [Wed, 21 Aug 2013 19:10:05 +0000 (12:10 -0700)]
Allow UNIX extensions client to act on open fsp instead of pathname if available.

Eliminates possible race condition on pathname op.

Signed-off-by: Jeremy Allison <jra@samba.org>
5 years agoFix the erroneous masking of chmod requests via the UNIX extensions.
Jeremy Allison [Wed, 21 Aug 2013 19:03:25 +0000 (12:03 -0700)]
Fix the erroneous masking of chmod requests via the UNIX extensions.

Signed-off-by: Jeremy Allison <jra@samba.org>
5 years agoFix bug #10063 - source3/lib/util.c:1493 leaking memory w/ pam_winbind.so / winbind
Jeremy Allison [Fri, 2 Aug 2013 22:03:39 +0000 (15:03 -0700)]
Fix bug #10063 - source3/lib/util.c:1493 leaking memory w/ pam_winbind.so / winbind

Don't use talloc_tos() in something that can be linked to in pam_winbindd.so

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
Autobuild-User(master): Simo Sorce <idra@samba.org>
Autobuild-Date(master): Sat Aug 24 02:28:28 CEST 2013 on sn-devel-104

5 years agotorture: Split the fsinfo check into a separate test
Volker Lendecke [Thu, 22 Aug 2013 11:47:21 +0000 (11:47 +0000)]
torture: Split the fsinfo check into a separate test

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 Aug 23 20:53:12 CEST 2013 on sn-devel-104

5 years agotorture: Split the buffercheck into a separate test
Volker Lendecke [Thu, 22 Aug 2013 11:23:22 +0000 (11:23 +0000)]
torture: Split the buffercheck into a separate test

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agotorture: Change smb2.getinfo into a suite
Volker Lendecke [Thu, 22 Aug 2013 11:06:59 +0000 (11:06 +0000)]
torture: Change smb2.getinfo into a suite

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibsmb2: Fix opening the rootdirectory, part 2
Volker Lendecke [Thu, 22 Aug 2013 15:04:03 +0000 (15:04 +0000)]
libsmb2: Fix opening the rootdirectory, part 2

smb2_push_o16s16_blob is wrong for the blob.data==NULL case. It does
not do the same magic that the rest of the routine does with regards to
padding_fix.  padding_fix is wrong in its own respect, with a 0-length
blob we end up with a negative padding fix. It's wrong, but it seems
to work.

Why am I doing this? I want to make smb2.getinfo work against
w2k12. smb2_util_roothandle() always gives NT_STATUS_INVALID_PARAMETER
without this and the preceding fix.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibsmb2: Fix opening the rootdirectory, part 1
Volker Lendecke [Thu, 22 Aug 2013 15:04:03 +0000 (15:04 +0000)]
libsmb2: Fix opening the rootdirectory, part 1

[MS-SMB2], 2.2.13 says: In the request, the Buffer field MUST be at least one
byte in length. Implement that for the 0-length filename without create blobs.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agotorture: Remove an unused variable
Volker Lendecke [Thu, 22 Aug 2013 11:19:33 +0000 (11:19 +0000)]
torture: Remove an unused variable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: Fix a debug message
Volker Lendecke [Thu, 22 Aug 2013 15:19:32 +0000 (15:19 +0000)]
smbd: Fix a debug message

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agopkgconfig: Do not hardcode library version numbers in pc files.
Günther Deschner [Thu, 22 Aug 2013 13:00:32 +0000 (15:00 +0200)]
pkgconfig: Do not hardcode library version numbers in pc files.

We control version numbers via 'vnum' from the wscript_build files for all other
libraries.  In case of libndr we already reported a wrong 0.0.1 version via
pkgconfig while in fact the library is versioned as 0.0.2.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>
Autobuild-User(master): Kai Blin <kai@samba.org>
Autobuild-Date(master): Thu Aug 22 20:48:44 CEST 2013 on sn-devel-104

5 years agos3-pkgconfig: remove leftovers from autoconf build.
Günther Deschner [Thu, 22 Aug 2013 12:59:08 +0000 (14:59 +0200)]
s3-pkgconfig: remove leftovers from autoconf build.

No worries, we still ship appropriate pc files for these libs.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>
5 years agoclient: add missing newlines to error messages for invalid iosize parameter.
Michael Adam [Wed, 21 Aug 2013 14:12:30 +0000 (16:12 +0200)]
client: add missing newlines to error messages for invalid iosize parameter.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Aug 21 21:49:45 CEST 2013 on sn-devel-104

5 years agontdbtool.8.xml: Bump version up to 4.1.
Karolin Seeger [Wed, 21 Aug 2013 08:12:45 +0000 (10:12 +0200)]
ntdbtool.8.xml: Bump version up to 4.1.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agontdbrestore.8.xml: Bump version up to 4.1.
Karolin Seeger [Wed, 21 Aug 2013 08:12:10 +0000 (10:12 +0200)]
ntdbrestore.8.xml: Bump version up to 4.1.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agontdbdump.8.xml: Bump version up to 4.1.
Karolin Seeger [Wed, 21 Aug 2013 07:39:45 +0000 (09:39 +0200)]
ntdbdump.8.xml: Bump version up to 4.1.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agontdbbackup.8.xml: Bump version up to 4.1.
Karolin Seeger [Wed, 21 Aug 2013 07:38:33 +0000 (09:38 +0200)]
ntdbbackup.8.xml: Bump version up to 4.1.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agontdb.3.xml: Bump version up to 4.1.
Karolin Seeger [Wed, 21 Aug 2013 07:38:01 +0000 (09:38 +0200)]
ntdb.3.xml: Bump version up to 4.1.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbtree: use the correct count variable from NetShareEnum result.
Michael Adam [Wed, 21 Aug 2013 13:29:44 +0000 (15:29 +0200)]
smbtree: use the correct count variable from NetShareEnum result.

Fixes potential segfault, as for rpcclient from bug #10100

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agoAdd documentation for the new internal command timeout to smbclient.
Jeremy Allison [Fri, 16 Aug 2013 23:57:34 +0000 (16:57 -0700)]
Add documentation for the new internal command timeout to smbclient.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Aug 21 19:24:06 CEST 2013 on sn-devel-104

5 years agoAdd documentation for the new -t <timeout> parameter in smbclient.
Jeremy Allison [Fri, 16 Aug 2013 23:56:22 +0000 (16:56 -0700)]
Add documentation for the new -t <timeout> parameter in smbclient.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoFix the documentation of --encrypt to explain SMB3 encryption for smbclient.
Jeremy Allison [Fri, 16 Aug 2013 23:53:45 +0000 (16:53 -0700)]
Fix the documentation of --encrypt to explain SMB3 encryption for smbclient.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoFix the documentation of the iosize command to explain the new zero default for smbcl...
Jeremy Allison [Fri, 16 Aug 2013 23:49:41 +0000 (16:49 -0700)]
Fix the documentation of the iosize command to explain the new zero default for smbclient.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoFix the documentation for --send-buffersize for the new default value of zero for...
Jeremy Allison [Fri, 16 Aug 2013 23:48:18 +0000 (16:48 -0700)]
Fix the documentation for --send-buffersize for the new default value of zero for smbclient.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoExpand on the documentation of -m max-protocol for SMB2/3 for smbclient.
Jeremy Allison [Fri, 16 Aug 2013 23:47:13 +0000 (16:47 -0700)]
Expand on the documentation of -m max-protocol for SMB2/3 for smbclient.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoAdd "-e" encrypt transport command line option documentation for smbcacls.
Jeremy Allison [Fri, 16 Aug 2013 23:45:26 +0000 (16:45 -0700)]
Add "-e" encrypt transport command line option documentation for smbcacls.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoAdd "max protocol" command line documentation for smbcacls.
Jeremy Allison [Fri, 16 Aug 2013 23:44:14 +0000 (16:44 -0700)]
Add "max protocol" command line documentation for smbcacls.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoAdd new "timeout" command and -t option to smbclient to set the per-operation timeout.
Jeremy Allison [Fri, 16 Aug 2013 20:49:39 +0000 (13:49 -0700)]
Add new "timeout" command and -t option to smbclient to set the per-operation timeout.

This is needed as once SMB3 encryption is selected the server
response time can be very slow when requesting large numbers
(256) of large encrypted packets (1MB) from a Windows 2012
virtual machine. This allows clients to tune their allowable
wait time.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoAs SMB3 has transport level encryption, allow smbclient -e to force encryted SMB3...
Jeremy Allison [Fri, 16 Aug 2013 17:44:34 +0000 (10:44 -0700)]
As SMB3 has transport level encryption, allow smbclient -e to force encryted SMB3 transport.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoRemove restrictions on setting iosize inside smbclient for SMB2 connections.
Jeremy Allison [Fri, 16 Aug 2013 18:45:43 +0000 (11:45 -0700)]
Remove restrictions on setting iosize inside smbclient for SMB2 connections.

Also remove the SMB1 restriction to minimum iosize of 16384 (0x4000):
Now values >= 0 and <= 0xFFFF00 can be set for SMB1, 0 meaning server
defined behaviour. 0 is the new default for iosize, both for SMB1 and SMB2.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoFix bug #10100 - rpcclient crashes when sending the 'netshareenum 502' command
Jeremy Allison [Tue, 20 Aug 2013 17:55:27 +0000 (10:55 -0700)]
Fix bug #10100 - rpcclient crashes when sending the 'netshareenum 502' command

We are using the wrong variable for the returned count.
Reported by <pisymbol@gmail.com>.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Aug 21 17:30:33 CEST 2013 on sn-devel-104

6 years agosmbd: Simplify new_break_message_smb1
Volker Lendecke [Mon, 19 Aug 2013 12:28:24 +0000 (12:28 +0000)]
smbd: Simplify new_break_message_smb1

There's no point in allocating a fixed length array that we throw away
immediately after use.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Aug 20 14:35:21 CEST 2013 on sn-devel-104

6 years agosmbd: Replace a 0-timeout wakeup_send
Volker Lendecke [Fri, 16 Aug 2013 11:40:38 +0000 (11:40 +0000)]
smbd: Replace a 0-timeout wakeup_send

A tevent_immediate is simpler and is what we want here.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
6 years agodocs: Fix variable list in man vfs_crossrename.
Karolin Seeger [Tue, 13 Aug 2013 09:04:50 +0000 (11:04 +0200)]
docs: Fix variable list in man vfs_crossrename.

The varlist entries need a paragraph, otherwise the list is broken and the list
entries end with ".RE".

Fix bug #10076 - varlist in man vfs_crossrename broken.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Aug 20 04:19:42 CEST 2013 on sn-devel-104

6 years agoMan pages for ntdb tools missing
Rusty Russell [Thu, 15 Aug 2013 03:02:06 +0000 (12:32 +0930)]
Man pages for ntdb tools missing

Copied and modified from tdb man pages.  Avoided reproducing API documentation
which is extensively documented in the ntdb.h header already.

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

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agolibsmb: Fix a bunch of Coverity IDs
Volker Lendecke [Mon, 19 Aug 2013 20:36:02 +0000 (22:36 +0200)]
libsmb: Fix a bunch of Coverity IDs

(fnum != -1) is always true, even if fnum=-1 was initialized. fnum is
a uint16, and the comparison first casts this to 65535, which is always
!= -1.

Also change the initialization to make it clearer what is happening here.

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 Aug 20 00:52:36 CEST 2013 on sn-devel-104

6 years agoFix bug #10097 - MacOSX 10.9 will not follow path-based DFS referrals handed out...
Richard Sharpe [Sun, 18 Aug 2013 14:34:31 +0000 (07:34 -0700)]
Fix bug #10097 - MacOSX 10.9 will not follow path-based DFS referrals handed out by Samba.

Windows overloads the EA Length field in the DIRECTORY INFO leves of FIND FIRST/FIND NEXT.

This field indicates either the REPARSE_TAG if the file/folder has a reparse proint or
the EA Length if it has EAs, and is the fundamental reason you cannot have both on a
file or folder.

Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Aug 19 22:21:34 CEST 2013 on sn-devel-104

6 years agorpc_server: Fix CID 1063255 Resource leak
Volker Lendecke [Sun, 18 Aug 2013 20:41:51 +0000 (20:41 +0000)]
rpc_server: Fix CID 1063255 Resource leak

We would leak a socket 0 here

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Aug 19 03:10:51 CEST 2013 on sn-devel-104

6 years agogensec: Fix CID 1063258 Uninitialized scalar variable
Volker Lendecke [Sun, 18 Aug 2013 20:37:26 +0000 (20:37 +0000)]
gensec: Fix CID 1063258 Uninitialized scalar variable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>