sfrench/samba-autobuild/.git
9 years agos3-winbindd: use wcache_query_user_fullname after inspecting samlogon cache.
Günther Deschner [Mon, 7 Jul 2014 15:16:32 +0000 (17:16 +0200)]
s3-winbindd: use wcache_query_user_fullname after inspecting samlogon cache.

The reason for this followup query is that very often the samlogon cache only
contains a info3 netlogon user structure that has been retrieved during a
netlogon samlogon authentication using "network" logon level. With that logon
level only a few info3 fields are filled in; the user's fullname is never filled
in that case. This is problematic when the cache is used to fill in the user's
gecos field (for NSS queries). When we have retrieved the user's fullname during
other queries, reuse it from the other caches.

Thanks to Matt Rogers <mrogers@redhat.com>.

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

Guenther

Pair-Programmed-With: Andreas Schneider <asn@samba.org>
Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agos3-winbindd: add wcache_query_user_fullname().
Günther Deschner [Mon, 7 Jul 2014 15:14:37 +0000 (17:14 +0200)]
s3-winbindd: add wcache_query_user_fullname().

This helper function is used to query the full name of a cached user object (for
further gecos processing).

Thanks to Matt Rogers <mrogers@redhat.com>.

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

Guenther

Pair-Programmed-With: Andreas Schneider <asn@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agos3-winbindd: call interactive samlogon via rpccli_netlogon_password_logon.
Günther Deschner [Tue, 15 Jul 2014 06:29:55 +0000 (08:29 +0200)]
s3-winbindd: call interactive samlogon via rpccli_netlogon_password_logon.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Pair-Programmed-With: Andreas Schneider <asn@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agos3-rpc_client: return info3 in rpccli_netlogon_password_logon().
Günther Deschner [Tue, 15 Jul 2014 06:28:42 +0000 (08:28 +0200)]
s3-rpc_client: return info3 in rpccli_netlogon_password_logon().

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Pair-Programmed-With: Andreas Schneider <asn@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agontlm_auth: added require-membership tests
Garming Sam [Wed, 11 Jun 2014 05:07:44 +0000 (17:07 +1200)]
ntlm_auth: added require-membership tests

(updated by abartlet to fix knownfail changes due to AD DC winbindd
use in master)
Change-Id: Iec41fbfc0f501888fd16323bf78da61aa549b4de
Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by:
Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
Autobuild-User(master): Kamen Mazdrashki <kamenim@samba.org>
Autobuild-Date(master): Tue Jul 15 15:59:49 CEST 2014 on sn-devel-104

9 years agotorture: test_ntlm_auth.py now has a require-membership-of argument
Garming Sam [Fri, 4 Jul 2014 00:50:37 +0000 (12:50 +1200)]
torture: test_ntlm_auth.py now has a require-membership-of argument

Change-Id: I90c2172af792a082fbf49ee0ab7d6eedf5471440
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
9 years agoAs David Woodhouse points out, this breaks backwards compatibility.
Jeremy Allison [Mon, 14 Jul 2014 17:22:52 +0000 (10:22 -0700)]
As David Woodhouse points out, this breaks backwards compatibility.

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

Revert "libwbclient: reject unknown named blobs in wbcCredentialCache()"

This reverts commit 740d12d1e77d356ff22c3725dce8d5019c86a7a5.

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Jul 14 21:54:08 CEST 2014 on sn-devel-104

9 years agoctdb-ltdb: Use tdb_null instead of zeroing TDB_DATA variable
Amitay Isaacs [Mon, 14 Jul 2014 06:30:18 +0000 (16:30 +1000)]
ctdb-ltdb: Use tdb_null instead of zeroing TDB_DATA variable

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Jul 14 16:01:31 CEST 2014 on sn-devel-104

9 years agos3:smbd: initialize stat_ex buffer in smbd_dirptr_get_entry()
Michael Adam [Thu, 3 Jul 2014 08:00:13 +0000 (10:00 +0200)]
s3:smbd: initialize stat_ex buffer in smbd_dirptr_get_entry()

This prevents random garbage in the vfs_private member.
Usually it should not be a problem to leave initialization
of the vfs_private to the vfs module who wants to use it,
but further down in the directory listing code, in
vfswrap_readdir, there is in optimization introduced
with 2a65e8befef004fd18d17853a1b72155752346c8, to call
fstatat if possible to already fill stat info in the
readdir call.

The problem is that this calls fstatat directly,
not going through VFS, but still making the stat buffer
valid, leaving vfs_private with random garbage.
Hence a vfs module using vfs_private, like vfs_gpfs
does for offline info (and winAttrs in general)
does not have a chance to tell whether the vfs_private
is valid if the stat buffer is marked valid.
This is a reason for the "flapping offline flag" problem
of the vfs_gpfs module.

Initializing the vfs_private to 0 here will for the
vfs_gpfs module result in files being marked online
always in a directory listing. So this is not a real fix
but it does at least make the problem less random.

A real general fix might be to implement SMB_VFS_FSTATAT()
and use it here.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Autobuild-User(master): Christof Schmitt <cs@samba.org>
Autobuild-Date(master): Sun Jul 13 11:26:58 CEST 2014 on sn-devel-104

9 years agos3:vfs:gpfs: log when winAttr-garbage is detected (by heuristics) in is_offline
Michael Adam [Wed, 9 Jul 2014 21:56:34 +0000 (23:56 +0200)]
s3:vfs:gpfs: log when winAttr-garbage is detected (by heuristics) in is_offline

In is_offline(), check whether the winAttrs are filled with bits
outside 0xFFFF and log it prominently: Since GPFS only
fills 0xFFFF, this could be due to an uninitialized buffer
(or another vfs module filling vfs_private? ...).

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
9 years agos3:vfs:gpfs: fix flapping offline: always get winAttrs from gpfs for is_offline
Michael Adam [Thu, 3 Jul 2014 08:10:11 +0000 (10:10 +0200)]
s3:vfs:gpfs: fix flapping offline: always get winAttrs from gpfs for is_offline

There is a problem of flapping offline due to uninitialized
stat buffers. Due to a optimization in vfswrap_readdir which
directly calling fastatat (i.e. not through vfs), marking the
stat buffer valid, there is nothing this module can do about
it and hence can not currently not rely on the vaildity of
the stat buffer.

By always calling out to GPFS even when the stat buffer is
flagged valid, we can always return correct offline information,
thereby sacrificing the readdir optimization.

Pair-Programmed-With: Volker Lendecke <vl@samba.org>

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
9 years agos3:vfs:gpfs: store the winAttrs in the struct_ex when we got them in vfs_gpfs_fstat()
Michael Adam [Thu, 3 Jul 2014 08:07:37 +0000 (10:07 +0200)]
s3:vfs:gpfs: store the winAttrs in the struct_ex when we got them in vfs_gpfs_fstat()

This may (e.g.) have lead to some occurrences of flapping offline bits.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
9 years agos3:smb2_read: let smb2_sendfile_send_data() behave like send_file_readX()
Stefan Metzmacher [Thu, 10 Jul 2014 19:08:06 +0000 (21:08 +0200)]
s3:smb2_read: let smb2_sendfile_send_data() behave like send_file_readX()

We now pass the header to SMB_VFS_SENDFILE(), so we have to handle that also
in the fallback code.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jul 11 22:57:17 CEST 2014 on sn-devel-104

9 years agos3:winbindd: remove unused get[pw|gr]ent_initialized from winbindd_cli_state
Stefan Metzmacher [Mon, 7 Jul 2014 13:12:37 +0000 (15:12 +0200)]
s3:winbindd: remove unused get[pw|gr]ent_initialized from winbindd_cli_state

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jul 11 18:46:09 CEST 2014 on sn-devel-104

9 years agoselftest: teardown the environments also on getting SIGPIPE
Stefan Metzmacher [Thu, 10 Jul 2014 12:28:56 +0000 (14:28 +0200)]
selftest: teardown the environments also on getting SIGPIPE

make test uses

selftest.pl | subuntu-filter.py ...

FAIL_IMMEDIATELY=1 lets subuntu-filter.py exit,
which generates SIGPIPE in selftest.pl.

We should handle this just like any other signal
and teardown all environments.

This should make the teardown process more reliable/verbose.

Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
9 years agos3:smb2_negprot: change "smb max {read,write,trans}" to 8MiB (as default)
Stefan Metzmacher [Thu, 12 Jun 2014 23:55:21 +0000 (01:55 +0200)]
s3:smb2_negprot: change "smb max {read,write,trans}" to 8MiB (as default)

This matches Windows 2012R2.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jul 11 04:59:29 CEST 2014 on sn-devel-104

9 years agos3:smb2_negprot: allow "smb max {read,write,trans}" up to 8MiB
Stefan Metzmacher [Thu, 12 Jun 2014 23:55:21 +0000 (01:55 +0200)]
s3:smb2_negprot: allow "smb max {read,write,trans}" up to 8MiB

This matches Windows 2012R2.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
9 years agolibwbclient: reject unknown named blobs in wbcCredentialCache()
Stefan Metzmacher [Thu, 10 Jul 2014 03:28:36 +0000 (05:28 +0200)]
libwbclient: reject unknown named blobs in wbcCredentialCache()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jul 10 22:30:45 CEST 2014 on sn-devel-104

9 years agolibwbclient: allow only one initial_blob/challenge_blob in wbcCredentialCache()
Stefan Metzmacher [Thu, 10 Jul 2014 03:28:36 +0000 (05:28 +0200)]
libwbclient: allow only one initial_blob/challenge_blob in wbcCredentialCache()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3:vfs:gpfs: remove extra empty lines.
Michael Adam [Thu, 3 Jul 2014 07:58:30 +0000 (09:58 +0200)]
s3:vfs:gpfs: remove extra empty lines.

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): Thu Jul 10 02:50:44 CEST 2014 on sn-devel-104

9 years agos3:smbd: make dptr_ReadDirName() static.
Michael Adam [Thu, 3 Jul 2014 07:57:02 +0000 (09:57 +0200)]
s3:smbd: make dptr_ReadDirName() static.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3: libwbclient: Don't break out of loop too soon - find all parameters.
Jeremy Allison [Tue, 8 Jul 2014 23:36:30 +0000 (16:36 -0700)]
s3: libwbclient: Don't break out of loop too soon - find all parameters.

Fix bug #10692: wbcCredentialCache fails if challenge_blob is not first

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

Signed-off-by: Jeremy Allison <jra@samba.org>
9 years agolibwbclient: Call correct function for wbcPingDc2 test
Christof Schmitt [Tue, 8 Jul 2014 19:03:37 +0000 (12:03 -0700)]
libwbclient: Call correct function for wbcPingDc2 test

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Christof Schmitt <cs@samba.org>
Autobuild-Date(master): Wed Jul  9 18:36:08 CEST 2014 on sn-devel-104

9 years agos4:dsdb/samldb: don't allow 'userParameters' to be modified over LDAP for now
Stefan Metzmacher [Tue, 8 Jul 2014 14:19:09 +0000 (16:19 +0200)]
s4:dsdb/samldb: don't allow 'userParameters' to be modified over LDAP for now

For now it's safer to reject setting 'userParameters' via LDAP,
as we'll not provide the same behavior as a Windows Server.

If someone requires that feature please report this in the following
bug reports!

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Jul  9 11:07:51 CEST 2014 on sn-devel-104

9 years agodbcheck: Add check and test for various invalid userParameters values
Andrew Bartlett [Tue, 17 Jun 2014 04:00:57 +0000 (16:00 +1200)]
dbcheck: Add check and test for various invalid userParameters values

Bug: https://bugzilla.samba.org/show_bug.cgi?id=8077
Change-Id: I6f2f4169856ce78c62e3a7e74b48520cca9cb9ae
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agodsdb: Always store and return the userParameters as a array of LE 16-bit values
Andrew Bartlett [Tue, 17 Jun 2014 04:03:22 +0000 (16:03 +1200)]
dsdb: Always store and return the userParameters as a array of LE 16-bit values

This is not allowed to be odd length, as otherwise we can not send it over the SAMR transport correctly.

Allocating one byte less memory than required causes malloc() heap corruption
and then a crash or lockup of the SAMR server.

Andrew Bartlett

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10130
Change-Id: I5c0c531c1d660141e07f884a4789ebe11c1716f6
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
9 years agodsdb: Set syntax of userParameters to binary string, not unicode string
Andrew Bartlett [Tue, 24 Sep 2013 17:12:24 +0000 (10:12 -0700)]
dsdb: Set syntax of userParameters to binary string, not unicode string

This means we continue to store the values as given on SAMR, assuming
that the SAMR buffer is little endian.  The syntax for this specific
object is forced to be a binary blob, so that it is not converted on
DRSUAPI.

This commit does not fix existing databases, nor pdb_samba_dsdb (used
by classicupgrade).

Andrew Bartlett

Bug: https://bugzilla.samba.org/show_bug.cgi?id=8077
Change-Id: I10bb6aaecc381194e3c0ce6b9163f961acbdcee1
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
9 years agos4:dsdb/repl_meta_data: make sure objectGUID can't be deleted
Stefan Metzmacher [Mon, 7 Jul 2014 21:51:31 +0000 (23:51 +0200)]
s4:dsdb/repl_meta_data: make sure objectGUID can't be deleted

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agos4:dsdb/extended_dn_in: don't force DSDB_SEARCH_SHOW_RECYCLED
Stefan Metzmacher [Mon, 7 Jul 2014 10:00:14 +0000 (12:00 +0200)]
s4:dsdb/extended_dn_in: don't force DSDB_SEARCH_SHOW_RECYCLED

We should take the controls the caller provided when we search
for existing objects.

A search with a basedn of '<GUID=....>' should result in LDB_ERR_NO_SUCH_OBJECT
is the object has isDeleted=TRUE.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agos4:dsdb/kcc: use SHOW_RECYCLED instead of SHOW_DELETED in when deleting tombstone...
Stefan Metzmacher [Mon, 7 Jul 2014 20:53:19 +0000 (22:53 +0200)]
s4:dsdb/kcc: use SHOW_RECYCLED instead of SHOW_DELETED in when deleting tombstone/deleted objects

SHOW_RECYCLED implies SHOW_DELETED.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agos4:dsdb/schema_load: make error message more verbose
Stefan Metzmacher [Thu, 3 Jul 2014 14:00:48 +0000 (16:00 +0200)]
s4:dsdb/schema_load: make error message more verbose

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoctdb-daemon: Support per-node robust mutex feature
Amitay Isaacs [Sun, 10 Nov 2013 13:32:31 +0000 (00:32 +1100)]
ctdb-daemon: Support per-node robust mutex feature

To enable TDB mutex support, set tunable TDBMutexEnabled=1.

When databases are attached for the first time, attach flags must include
TDB_MUTEX_LOCKING and TDBMutexEnabled must set to enable mutex support.

However, when CTDB attaches databases internally for recovery, it will
enable mutex support if TDBMutexEnabled is set.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Wed Jul  9 06:45:17 CEST 2014 on sn-devel-104

9 years agoctdb-daemon: Enable robust mutexes only if TDB_MUTEX_LOCKING is defined
Amitay Isaacs [Mon, 30 Jun 2014 05:09:32 +0000 (15:09 +1000)]
ctdb-daemon: Enable robust mutexes only if TDB_MUTEX_LOCKING is defined

Runtime check for robust mutexes is performed just before opening local tdb.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoctdb-daemon: Allow flag TDB_MUTEX_LOCKING to pass into db_attach
Volker Lendecke [Wed, 20 Feb 2013 14:09:36 +0000 (15:09 +0100)]
ctdb-daemon: Allow flag TDB_MUTEX_LOCKING to pass into db_attach

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoctdb-daemon: Simplify code a bit
Amitay Isaacs [Tue, 24 Jun 2014 02:04:25 +0000 (12:04 +1000)]
ctdb-daemon: Simplify code a bit

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoctdb-daemon: Use false instead of 0 for boolean arguments
Amitay Isaacs [Tue, 24 Jun 2014 01:46:53 +0000 (11:46 +1000)]
ctdb-daemon: Use false instead of 0 for boolean arguments

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agosmbd: Use mutex instead of fcntl lock for echohandler coordination
Christof Schmitt [Fri, 27 Jun 2014 20:05:59 +0000 (13:05 -0700)]
smbd: Use mutex instead of fcntl lock for echohandler coordination

This is based on a patch from Volker. When the system supports roboust
mutexes, they will be used for the coordiations between worker and
echohandler process. This avoids another aspect of the fcntl scalibility
issue when handling many client connections. When mutexes are not
available, the code falls back to the fcntl lock.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jul  9 00:56:50 CEST 2014 on sn-devel-104

9 years agosmbd: Avoid double-free in get_print_db_byname
Volker Lendecke [Tue, 8 Jul 2014 12:30:54 +0000 (14:30 +0200)]
smbd: Avoid double-free in get_print_db_byname

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 Jul  8 22:27:03 CEST 2014 on sn-devel-104

9 years agosmbd: Factor out smbd_smb2_send_break
Volker Lendecke [Mon, 7 Jul 2014 10:13:56 +0000 (10:13 +0000)]
smbd: Factor out smbd_smb2_send_break

Most of this routine can be re-used for sending lease breaks

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Jul  8 19:54:09 CEST 2014 on sn-devel-104

9 years agosmbd: Rename smbd_smb2_send_oplock_break_state->buf to ->body
Volker Lendecke [Mon, 7 Jul 2014 10:05:08 +0000 (10:05 +0000)]
smbd: Rename smbd_smb2_send_oplock_break_state->buf to ->body

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agosmbd: no "dyn" in smbd_smb2_send_oplock_break
Volker Lendecke [Mon, 7 Jul 2014 09:54:12 +0000 (09:54 +0000)]
smbd: no "dyn" in smbd_smb2_send_oplock_break

We don't need the assignment to state->vector[1+SMBD_SMB2_DYN_IOV_OFS],
this is zero-initialized by talloc_zero

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agosmbd: Make hdr a field of its own in smbd_smb2_send_oplock_break
Volker Lendecke [Mon, 7 Jul 2014 09:35:40 +0000 (09:35 +0000)]
smbd: Make hdr a field of its own in smbd_smb2_send_oplock_break

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agosmbd: Make tf a field of its own in smbd_smb2_send_oplock_break
Volker Lendecke [Mon, 7 Jul 2014 09:35:40 +0000 (09:35 +0000)]
smbd: Make tf a field of its own in smbd_smb2_send_oplock_break

This actually saves a few bytes in .text. Maybe due to the struct assignments?

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agosmbd: Make nbt_hdr a field of its own in smbd_smb2_send_oplock_break
Volker Lendecke [Mon, 7 Jul 2014 09:35:40 +0000 (09:35 +0000)]
smbd: Make nbt_hdr a field of its own in smbd_smb2_send_oplock_break

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4-auth-krb: Fix talloc access after free in smb_krb5_update_keytab
Samuel Cabrero [Thu, 12 Jun 2014 08:39:02 +0000 (10:39 +0200)]
s4-auth-krb: Fix talloc access after free in smb_krb5_update_keytab

Change-Id: Iaa168d520f124e0c43c7edd649318f0b8ee25020
Signed-off-by: Samuel Cabrero <scabrero@zentyal.com>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Kamen Mazdrashki <kamenim@samba.org>
Autobuild-Date(master): Tue Jul  8 16:51:09 CEST 2014 on sn-devel-104

9 years agoctdb-tests: Do not run ip command if running against local daemons
Amitay Isaacs [Tue, 8 Jul 2014 06:31:21 +0000 (16:31 +1000)]
ctdb-tests: Do not run ip command if running against local daemons

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Tue Jul  8 12:48:06 CEST 2014 on sn-devel-104

9 years agoctdb-build: fix wscript formatting as per PEP8
Amitay Isaacs [Tue, 8 Jul 2014 02:00:00 +0000 (12:00 +1000)]
ctdb-build: fix wscript formatting as per PEP8

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agoctdb-build: Create ctdb only ctags
Amitay Isaacs [Tue, 8 Jul 2014 04:04:29 +0000 (14:04 +1000)]
ctdb-build: Create ctdb only ctags

CTDB does not use auto-generated files, there is no need to configure
to generate ctags.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agoctdb-build: Replace os.system with samba_utils.RUN_COMMAND
Amitay Isaacs [Tue, 8 Jul 2014 02:15:58 +0000 (12:15 +1000)]
ctdb-build: Replace os.system with samba_utils.RUN_COMMAND

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agoctdb-build: Check the return value of RUN_COMMAND
Amitay Isaacs [Tue, 8 Jul 2014 01:40:52 +0000 (11:40 +1000)]
ctdb-build: Check the return value of RUN_COMMAND

RUN_COMMAND does not raise exceptions if the command fails, but returns
non-zero status.  Ensure that make terminates with non-zero status if
RUN_COMMAND fails.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agoctdb-tests: Shutdown local daemons if the tests exit abnormally
Amitay Isaacs [Fri, 4 Jul 2014 07:04:10 +0000 (17:04 +1000)]
ctdb-tests: Shutdown local daemons if the tests exit abnormally

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-Programmed-With: Martin Schwenke <martin@meltin.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4: torture: Add a new lock test to show that the Samba SMB1 multi-lock implementatio...
Jeremy Allison [Mon, 7 Jul 2014 18:00:13 +0000 (11:00 -0700)]
s4: torture: Add a new lock test to show that the Samba SMB1 multi-lock implementation is (currently) correct.

Needed as there was a proposal to re-architect
our multi-lock to dispense with lock order precedence,
which isn't how Windows does it (unfortunately,
as the new code would have been cleaner :-).
Tested against the Win2k12 SMB1 implementation.

This test is designed to show that
lock precedence on the server is based
on the order received, not on the ability
to grant. For example:

A blocked lock request containing 2 locks
will be satified before a subsequent blocked
lock request over one of the same regions,
even if that region is then unlocked. E.g.

(a) lock 100->109, 120->129 (granted)
(b) lock 100->109, 120-129 (blocks)
(c) lock 100->109          (blocks)
(d) unlock 100->109

lock (c) will not be granted as lock (b)
will take precedence.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jul  8 10:16:59 CEST 2014 on sn-devel-104

9 years agos3: VFS modules: Ignore EPERM errors on [f]chmod in crossrename module.
Jeremy Allison [Sat, 28 Jun 2014 00:03:28 +0000 (17:03 -0700)]
s3: VFS modules: Ignore EPERM errors on [f]chmod in crossrename module.

This is already done for [f]chown errors. Fix from CurlyMo <curlymoo1@gmail.com>

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agoparam: Amend docs.py test to check dumping of flagged parameters
Garming Sam [Thu, 3 Jul 2014 04:04:06 +0000 (16:04 +1200)]
param: Amend docs.py test to check dumping of flagged parameters

This test uses an empty smb.conf file to check if the resulting
output from testparm is empty.

It also sets a parameter as default in an smb.conf file and then
sets the option on the command line to ensure they are displayed
correctly.

Change-Id: I48f05b6e3c9e5cd856e89b196e00ae35eb93bf9f
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Jul  8 01:57:59 CEST 2014 on sn-devel-104

9 years agoparam: remove idmap parameters as special cases in docs.py
Garming Sam [Tue, 6 May 2014 04:21:50 +0000 (16:21 +1200)]
param: remove idmap parameters as special cases in docs.py

Change-Id: Ie2395ddbe9e055b9972fd859615a022d9f675014
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agoparam: change snum parameter in special functions to a loadparm_service pointer
Garming Sam [Wed, 19 Mar 2014 23:57:22 +0000 (12:57 +1300)]
param: change snum parameter in special functions to a loadparm_service pointer

Using either an snum or the current service for special functions
depending where it was called is unnecessary and complicates the process
of handling them generically.

idmap parameters now call lpcfg_do_parameter_parametric and are now set
like normal.

Change-Id: I3eca89791274280f9d3c7b987fbd790c16ec7981
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agos3:param: pass down lp_ctx in handle include
Garming Sam [Wed, 19 Mar 2014 22:30:39 +0000 (11:30 +1300)]
s3:param: pass down lp_ctx in handle include

Currently the lp_ctx will never actually be used as it will still go
through the current s3 code.

Change-Id: Iff236aea79b2294deb8faf175c7425d075a0f4c4
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agolib/param: rename do_parameter to lpcfg_do_parameter
Garming Sam [Wed, 19 Mar 2014 22:00:11 +0000 (11:00 +1300)]
lib/param: rename do_parameter to lpcfg_do_parameter

This should be used to allow it to be called from s3 code.

Change-Id: I2f2d5526cf11a1ad78ca6ff7cb5c18fa25a98c76
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agoparam: handle smb_ports as a special handler
Garming Sam [Thu, 13 Mar 2014 21:27:54 +0000 (10:27 +1300)]
param: handle smb_ports as a special handler

Avoids some problems with using str_list_make and str_list_make_v3 and tries to
verify if the ports assignment is reasonable

Change-Id: I441c4cca605c7548a5023b65994004fbac57d2df
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agoparam: Use set_variable instead of set_variable_helper in lp_do_parameter
Garming Sam [Thu, 27 Feb 2014 22:58:55 +0000 (11:58 +1300)]
param: Use set_variable instead of set_variable_helper in lp_do_parameter

This extends the usage of the temporary s3 context in lp_do_parameter
to beyond the special functions.

At least for now, this will be necessary for sorting out the
differences between the do_parameter code.

Change-Id: Iac380d11a927e466ab1a56d34cebe343c3608707
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agoparam: add failure case for loadparm_init_s3
Garming Sam [Thu, 27 Feb 2014 22:38:51 +0000 (11:38 +1300)]
param: add failure case for loadparm_init_s3

It allocates memory, so it should be possible for it to fail.

Change-Id: Ib24f9718fb88790de23b78435866b9e79fe8c705
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agoparam: store the flags_list in the s3 lp context used for special
Garming Sam [Thu, 27 Feb 2014 22:32:24 +0000 (11:32 +1300)]
param: store the flags_list in the s3 lp context used for special

Special function needs the flag list.

Change-Id: I3c2f118704026913021e4399e89cc3583de9a743
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agoparam: mark non default options using flags in s3
Garming Sam [Wed, 26 Feb 2014 04:11:24 +0000 (17:11 +1300)]
param: mark non default options using flags in s3

This change allows lib/param code to see which s3 parameters are
currently set to defaults.

Change-Id: Ic25b3f8e792a6d72705a7e5d7159ac8f87e18512
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agoparam: fix FLAG_CMDLINE to be stored outside of the param table
Garming Sam [Wed, 26 Feb 2014 03:48:08 +0000 (16:48 +1300)]
param: fix FLAG_CMDLINE to be stored outside of the param table

In s3, flags could only be stored once in the param table and this was
global. The param table defines only the default flags however.

Change-Id: Ie673ad60dd499d930432c106e795e2cbd42d497b
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agoparam: remove unnecessary dump a service
Garming Sam [Thu, 27 Feb 2014 21:29:45 +0000 (10:29 +1300)]
param: remove unnecessary dump a service

Change-Id: I59b4edf929b4f8338e4c1a7116e0d1ef1bcad287
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agoparam: simplify lp_do_parameter
Garming Sam [Thu, 27 Feb 2014 03:31:14 +0000 (16:31 +1300)]
param: simplify lp_do_parameter

No longer checks for globals vs service twice.

Change-Id: I065e732ddb1ca2dda63dd22e3caf291fce8d327b
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agoparam: replace lp_set_cmdline in s3 helpers to store_cmdline
Garming Sam [Thu, 27 Feb 2014 23:53:32 +0000 (12:53 +1300)]
param: replace lp_set_cmdline in s3 helpers to store_cmdline

Change-Id: I9a6ac66eeb8e0dd9ba356f5201f7ac09784b476d
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agoparam: Ensure the correct mem context is always being used from s3
Garming Sam [Tue, 10 Jun 2014 21:56:20 +0000 (09:56 +1200)]
param: Ensure the correct mem context is always being used from s3

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
Change-Id: I7b93822d0d06b00f08fecc2e55778767dd785b91

9 years agoparam: set the flags on a s3 loadparm context
Garming Sam [Fri, 28 Feb 2014 00:19:16 +0000 (13:19 +1300)]
param: set the flags on a s3 loadparm context

By setting up the flags when we initialize the context, the flags can be
accessed by lib/param at any time.

Change-Id: I60d4f3a9108560e204cf5f37da9c7d995939e146
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agoparam: flag fixes in s3 loadparm
Garming Sam [Wed, 26 Feb 2014 03:43:44 +0000 (16:43 +1300)]
param: flag fixes in s3 loadparm

In s3 loadparm, the flags are stored in the param table, while in
lib/param, it is individual to a loadparm context.

Change-Id: I23d72eeec6b935c1897b34b8fc49d5a9992f2993
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agoparam: attempt to start factoring out the bInGlobalSection parameter
Garming Sam [Thu, 27 Feb 2014 22:09:24 +0000 (11:09 +1300)]
param: attempt to start factoring out the bInGlobalSection parameter

Eventually this parameter should be solely on the loadparm context. It
should really only have meaning during the globals init.

Change-Id: If0fd2037ce4e8399fbf00f63bc138d9c146d7570
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agoparam: allow fallback to s3 do_section in lib/param
Garming Sam [Thu, 27 Feb 2014 21:16:05 +0000 (10:16 +1300)]
param: allow fallback to s3 do_section in lib/param

This means that pm_process will eventually only call one do_section
method.

Change-Id: I81ffd0d61783df3e6c267f06210d4180a291ab4c
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agoparam: add do_section to s3 helpers
Garming Sam [Thu, 27 Feb 2014 20:59:05 +0000 (09:59 +1300)]
param: add do_section to s3 helpers

Change-Id: Ib9cee580f46fcb6d5046e606b4bfbf9e68dab76a
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agoparam: rename do_section in s3 to lp_do_section to avoid conflicts
Garming Sam [Thu, 27 Feb 2014 04:18:26 +0000 (17:18 +1300)]
param: rename do_section in s3 to lp_do_section to avoid conflicts

Change-Id: I9bb090b3b501a1e958eec17988901baed16c58cb
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agoparam: remove unnecessary calls to do_parameter in s3
Garming Sam [Thu, 27 Feb 2014 04:09:09 +0000 (17:09 +1300)]
param: remove unnecessary calls to do_parameter in s3

This aim of this is to try to factor out do_parameter.

Ideally, do_parameter should strictly be called from pm_process.

Change-Id: I990b53d0884e828f523a3b40e4ca72cc1596b06c
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agolib/param: add deprecated warning to be consistent with s3
Garming Sam [Thu, 27 Feb 2014 03:23:06 +0000 (16:23 +1300)]
lib/param: add deprecated warning to be consistent with s3

Change-Id: I79016279b8c5dce6263bff0477b808108e583d20
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agoparam: remove unnecessary lp_local_ptr_by_snum function
Garming Sam [Thu, 27 Feb 2014 03:27:56 +0000 (16:27 +1300)]
param: remove unnecessary lp_local_ptr_by_snum function

The function only appears twice and it can be easily inlined without
any real loss to meaning or readability.

Change-Id: Iabf6d202cedd95ad4f223e89c7d3be8dfbe36389
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agoparam: avoid the use of lp_do_parameter in popt
Garming Sam [Wed, 19 Mar 2014 20:44:59 +0000 (09:44 +1300)]
param: avoid the use of lp_do_parameter in popt

lp_do_parameter ideally should not be used outside of loadparm

Change-Id: I310f1a0ff81867151accbda551751bafcdfd8c4d
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agoparam: move defaults_saved global out of dump_globals function
Garming Sam [Wed, 26 Feb 2014 02:46:06 +0000 (15:46 +1300)]
param: move defaults_saved global out of dump_globals function

Removes an unnecessary dependency on a global variable.

Change-Id: I87fc63190a3b8ceba5fb5606fa0e7d5e1f2633a4
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agoparam: use set_variable_helper in s3 loadparm
Garming Sam [Tue, 6 May 2014 04:11:08 +0000 (16:11 +1200)]
param: use set_variable_helper in s3 loadparm

Change-Id: I1ed19ee7290f6b52f624e2aa700cf402cfcb255d
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agoparam: finish the set_param_helper lineup by rearranging case order
Garming Sam [Thu, 8 May 2014 00:13:21 +0000 (12:13 +1200)]
param: finish the set_param_helper lineup by rearranging case order

Attempting to make the code match exactly before moving it over.

Change-Id: If05fccd11d245176b5793e59d1b92317b25fd2c8
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agoparam: make some more changes to lp_do_parameter to match set_variable_helper
Garming Sam [Thu, 8 May 2014 00:10:53 +0000 (12:10 +1200)]
param: make some more changes to lp_do_parameter to match set_variable_helper

Attempting to make the code match exactly before moving it over.

Change-Id: Ie7a30d5477f3fbf95f8f43e1ac1f76b581d87709
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agolib/param: change set_variable_helper formatting
Garming Sam [Thu, 8 May 2014 00:10:04 +0000 (12:10 +1200)]
lib/param: change set_variable_helper formatting

Attempting to make the code match exactly before moving it over.

Change-Id: Id5571b00a8afd7dffc6197f2c7e020dd4fd59f85
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agoparam: attempt to align the set_variable_helper with lp_do_parameter
Garming Sam [Wed, 7 May 2014 23:57:28 +0000 (11:57 +1200)]
param: attempt to align the set_variable_helper with lp_do_parameter

This should allow some of it to be factored out into lib/param.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
Change-Id: I7d0b3b4114c73aeaf9bf63e8c5fcd0a9d00cfc00

9 years agoparam: use str_list_make_v3 instead of str_list_make in s3
Garming Sam [Tue, 6 May 2014 04:10:53 +0000 (16:10 +1200)]
param: use str_list_make_v3 instead of str_list_make in s3

Change-Id: Iea5aa39b9848bb19b0df3c70f249fd63bb61455e
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agoparam: Add null checks for upcoming str_list_make changes
Garming Sam [Thu, 13 Mar 2014 20:30:52 +0000 (09:30 +1300)]
param: Add null checks for upcoming str_list_make changes

In changing str_list_make to str_list_make_v3, the list can be NULL.
These are some additional checks to try to avoid any problems.

Where lists are dealt with, they typically check both if the list is
empty or the list is NULL.

Change-Id: I9012c31dbd9832ce877728bcb3346616ba64c4c5
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agoparam: pre-emptively correct use of str_list_make_v3 in lib/param
Garming Sam [Thu, 13 Mar 2014 00:27:24 +0000 (13:27 +1300)]
param: pre-emptively correct use of str_list_make_v3 in lib/param

lib/param uses str_list_make, while, s3 uses str_list_make_v3. These
differ slightly and should be made the same.

Notably it returns NULL when given a null or empty string

Also, includes the null check in s3 code to be consistent for merging
this section of code later on.

Change-Id: Ib543a5a5307e06989621ea16bfe87e315d66a7ef
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agolib/param: factor out a common portion of set_variable
Garming Sam [Tue, 25 Feb 2014 23:28:49 +0000 (12:28 +1300)]
lib/param: factor out a common portion of set_variable

Change-Id: Id8eeb480a377b4df8c3f51daf0d253f032fd0e83
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agoparam: Use the plus/minus syntax for reading in lists in s3 loadparm
Garming Sam [Tue, 25 Feb 2014 05:14:44 +0000 (18:14 +1300)]
param: Use the plus/minus syntax for reading in lists in s3 loadparm

This changes the behaviour the following parameters:
server services, dcerpc endpoint servers and ntvfs handler

These parameters were introduced with samba4 and are the parameters
which should utilize the newer list syntax. This allows merging
between the setting of parameters.

Change-Id: Id6226b5bede5cd4908f6718bd1b799faf881927d
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agoparam: change a number of parameters from P_LIST to P_CMDLIST
Garming Sam [Tue, 6 May 2014 02:56:46 +0000 (14:56 +1200)]
param: change a number of parameters from P_LIST to P_CMDLIST

These parameters are being changed to use their original syntax to match source3.

netbios aliases, interfaces, auth methods, invalid users, valid users,
admin users, read list, write list, hosts allow, hosts deny, preload
modules, smb ports, name resolve order, svcctl list, cluster addresses,
init logon delayed hosts, wins server, eventlog list, usershare prefix
allow list, usershare prefix deny list, vfs objects, winbind nss info

The documentation has also been changed to be consistent with the
change.

Change-Id: I536481098a508e0366c910b180f2db6a6f0634a9
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agoparam: ensure CMD_LIST is freed when freeing a parameter
Garming Sam [Wed, 7 May 2014 23:43:53 +0000 (11:43 +1200)]
param: ensure CMD_LIST is freed when freeing a parameter

As well as correctly deallocating the memory, this prevents a potential bug
where s3 globals struct may be freed, but it can be referred to
elsewhere.

Change-Id: I92fc9baa26aee5b4a35b767bed901928cbb7c74f
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
9 years agosmbcacls: parse config file argument prior to load
David Disseldorp [Mon, 7 Jul 2014 13:24:19 +0000 (15:24 +0200)]
smbcacls: parse config file argument prior to load

Fixes usage with the common "-s|--configfile" parameter.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Jul  7 23:30:50 CEST 2014 on sn-devel-104

9 years agonet/doc: make clear that net vampire is for NT4 domains only
Björn Jacke [Fri, 13 Jun 2014 12:14:41 +0000 (14:14 +0200)]
net/doc: make clear that net vampire is for NT4 domains only

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

Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Mon Jul  7 21:01:25 CEST 2014 on sn-devel-104

9 years agotorture4: Add trivial epoch test
Volker Lendecke [Fri, 4 Jul 2014 13:27:17 +0000 (13:27 +0000)]
torture4: Add trivial epoch test

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Jul  7 18:36:37 CEST 2014 on sn-devel-104

9 years agotorture4: Add smb2.lease.nobreakself
Volker Lendecke [Tue, 24 Sep 2013 17:26:48 +0000 (10:26 -0700)]
torture4: Add smb2.lease.nobreakself

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agotorture4: Add a test to break a handle twice
Volker Lendecke [Wed, 25 Sep 2013 00:07:54 +0000 (17:07 -0700)]
torture4: Add a test to break a handle twice

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agotorture4: Make sure we copy the parent_lease_key
Volker Lendecke [Tue, 24 Sep 2013 02:41:13 +0000 (19:41 -0700)]
torture4: Make sure we copy the parent_lease_key

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agosmbd: Use BVAL
Volker Lendecke [Thu, 3 Jul 2014 15:35:33 +0000 (15:35 +0000)]
smbd: Use BVAL

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoctdb-tests: Add a test for ctdb restoredb
Amitay Isaacs [Tue, 6 May 2014 07:44:24 +0000 (17:44 +1000)]
ctdb-tests: Add a test for ctdb restoredb

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Mon Jul  7 16:06:39 CEST 2014 on sn-devel-104

9 years agoctdb-tests: Check that ctdb wipedb cleans the database
Amitay Isaacs [Tue, 6 May 2014 07:16:19 +0000 (17:16 +1000)]
ctdb-tests: Check that ctdb wipedb cleans the database

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