sfrench/samba-autobuild/.git
3 years agotravis: run the samba-o3 target
Michael Adam [Thu, 12 May 2016 22:00:48 +0000 (00:00 +0200)]
travis: run the samba-o3 target

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri May 13 13:46:12 CEST 2016 on sn-devel-144

3 years agoautobuild: run the samba-o3 target by default
Michael Adam [Mon, 11 Apr 2016 08:23:00 +0000 (10:23 +0200)]
autobuild: run the samba-o3 target by default

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoautobuild: add a target samba-o3 that is built with -O3
Michael Adam [Tue, 22 Mar 2016 17:14:17 +0000 (18:14 +0100)]
autobuild: add a target samba-o3 that is built with -O3

Only run quicktest against the ad_dc env.
This currently just takes some 6 odd minutes.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos4:repl_meta_data: squelch compile warning with -O3
Christian Ambach [Thu, 12 May 2016 15:10:51 +0000 (17:10 +0200)]
s4:repl_meta_data: squelch compile warning with -O3

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri May 13 03:50:10 CEST 2016 on sn-devel-144

3 years agos3:modules/vfs_snapper squelch -O3 compile warning
Christian Ambach [Sat, 2 Apr 2016 00:08:05 +0000 (02:08 +0200)]
s3:modules/vfs_snapper squelch -O3 compile warning

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agoexamples:smbclient:write: fix O3 error unused result of fgets
Michael Adam [Tue, 5 Apr 2016 21:07:11 +0000 (23:07 +0200)]
examples:smbclient:write: fix O3 error unused result of fgets

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agoexamples:smbclient:read: fix O3 error unused result of fgets
Michael Adam [Tue, 5 Apr 2016 20:57:51 +0000 (22:57 +0200)]
examples:smbclient:read: fix O3 error unused result of fgets

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agoexamples:smbclient:fstatvfs: fix O3 error unused result of fgets
Michael Adam [Tue, 5 Apr 2016 20:55:01 +0000 (22:55 +0200)]
examples:smbclient:fstatvfs: fix O3 error unused result of fgets

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agoexamples:smbclient:statvfs: fix O3 error unused result of fgets
Michael Adam [Tue, 5 Apr 2016 20:50:52 +0000 (22:50 +0200)]
examples:smbclient:statvfs: fix O3 error unused result of fgets

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agoexamples:smbclient:notify: fix O3 error unused result from fgets
Michael Adam [Tue, 5 Apr 2016 20:36:34 +0000 (22:36 +0200)]
examples:smbclient:notify: fix O3 error unused result from fgets

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agoexamples:smbclient:testacl3: fix O3 error unused result from fgets
Michael Adam [Tue, 5 Apr 2016 20:34:32 +0000 (22:34 +0200)]
examples:smbclient:testacl3: fix O3 error unused result from fgets

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agos3:vfs:preopen: fix O3 error unused result of write
Michael Adam [Tue, 5 Apr 2016 20:22:47 +0000 (22:22 +0200)]
s3:vfs:preopen: fix O3 error unused result of write

(void) cast is not enough.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agos3:vfs:aio_fork: fix O3 error unused result of write
Michael Adam [Tue, 5 Apr 2016 20:21:19 +0000 (22:21 +0200)]
s3:vfs:aio_fork: fix O3 error unused result of write

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agos3:smbfilter: fix O3 error unused result of system()
Michael Adam [Tue, 5 Apr 2016 18:01:32 +0000 (20:01 +0200)]
s3:smbfilter: fix O3 error unused result of system()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agos3:utils:log2pcaphex: fix O3 error uninitialized variable
Michael Adam [Tue, 5 Apr 2016 17:57:42 +0000 (19:57 +0200)]
s3:utils:log2pcaphex: fix O3 error uninitialized variable

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agos3:utils:log2pcaphex: fix O3 error unused result of fgets
Michael Adam [Tue, 5 Apr 2016 17:56:25 +0000 (19:56 +0200)]
s3:utils:log2pcaphex: fix O3 error unused result of fgets

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agos3:samlogon_cache: fix O3 error unused result of truncate
Michael Adam [Tue, 5 Apr 2016 14:47:39 +0000 (16:47 +0200)]
s3:samlogon_cache: fix O3 error unused result of truncate

in netsamlogon_cache_init()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agos4:client: fix O3 error unused result of of chdir and system
Michael Adam [Tue, 5 Apr 2016 17:26:41 +0000 (19:26 +0200)]
s4:client: fix O3 error unused result of of chdir and system

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agos4:torture:nbench: fix O3 error unused result of asprintf
Michael Adam [Tue, 5 Apr 2016 16:52:29 +0000 (18:52 +0200)]
s4:torture:nbench: fix O3 error unused result of asprintf

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agos4:torture:rpc:samlogon: fix O3 error unused result of asprintf
Michael Adam [Tue, 5 Apr 2016 16:33:59 +0000 (18:33 +0200)]
s4:torture:rpc:samlogon: fix O3 error unused result of asprintf

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agos4:torture:basic:delete: fix O3 error unused result of asprintf
Michael Adam [Tue, 5 Apr 2016 16:21:17 +0000 (18:21 +0200)]
s4:torture:basic:delete: fix O3 error unused result of asprintf

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agos4:torture:basic:dir: fix O3 error unused result of asprintf
Michael Adam [Tue, 5 Apr 2016 16:19:30 +0000 (18:19 +0200)]
s4:torture:basic:dir: fix O3 error unused result of asprintf

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agos4:torture:basic: fix O3 error unused result of write
Michael Adam [Tue, 5 Apr 2016 16:16:46 +0000 (18:16 +0200)]
s4:torture:basic: fix O3 error unused result of write

in test_utable

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agos4:torture:basic:misc: fix O3 error unused result of asprintf
Michael Adam [Tue, 5 Apr 2016 16:14:19 +0000 (18:14 +0200)]
s4:torture:basic:misc: fix O3 error unused result of asprintf

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agos4:torture:basic: fix O3 error unused result of asprintf
Michael Adam [Tue, 5 Apr 2016 15:15:29 +0000 (17:15 +0200)]
s4:torture:basic: fix O3 error unused result of asprintf

in run_opentest()

While fixing this, also convert to using talloc_asprintf instead.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agos4:regshell: fix O3 error unused result of asprintf in reg_complete_key()
Michael Adam [Tue, 5 Apr 2016 13:43:52 +0000 (15:43 +0200)]
s4:regshell: fix O3 error unused result of asprintf in reg_complete_key()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agos4:ntvfs: fix O3 error unused result of write error in nbench_log()
Michael Adam [Tue, 5 Apr 2016 10:36:57 +0000 (12:36 +0200)]
s4:ntvfs: fix O3 error unused result of write error in nbench_log()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agos4:ntvfs: fix O3 error unused result of asprintf in cifspsx_file_utime()
Michael Adam [Tue, 5 Apr 2016 10:18:17 +0000 (12:18 +0200)]
s4:ntvfs: fix O3 error unused result of asprintf in cifspsx_file_utime()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agos4:ntvfs: fix O3 error unused result of asprintf in cifspsx_list_unix
Michael Adam [Sat, 26 Mar 2016 01:46:54 +0000 (02:46 +0100)]
s4:ntvfs: fix O3 error unused result of asprintf in cifspsx_list_unix

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agos4:ntvfs: fix O3 error unused result of asprintf in cifspsx_map_fileinfo
Michael Adam [Sat, 26 Mar 2016 01:24:08 +0000 (02:24 +0100)]
s4:ntvfs: fix O3 error unused result of asprintf in cifspsx_map_fileinfo

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agos4:ntvfs: fix O3 error unused result of asprintf in svfs_file_utime
Michael Adam [Sat, 26 Mar 2016 01:08:41 +0000 (02:08 +0100)]
s4:ntvfs: fix O3 error unused result of asprintf in svfs_file_utime

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agos4:ntvfs: fix O3 error unused result of asprintf
Michael Adam [Sat, 26 Mar 2016 00:53:00 +0000 (01:53 +0100)]
s4:ntvfs: fix O3 error unused result of asprintf

in svfs_map_fileinfo

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agos4:registry:patchfile: fix O3 error unused result of write
Michael Adam [Fri, 25 Mar 2016 01:04:58 +0000 (02:04 +0100)]
s4:registry:patchfile: fix O3 error unused result of write

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agos4:libcli:resolve: fix O3 error unused result of write
Michael Adam [Fri, 25 Mar 2016 00:29:40 +0000 (01:29 +0100)]
s4:libcli:resolve: fix O3 error unused result of write

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agolib: add sys_write_v - void variant of sys_write
Michael Adam [Fri, 25 Mar 2016 00:28:56 +0000 (01:28 +0100)]
lib: add sys_write_v - void variant of sys_write

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agolib: add sys_read_v - void variant of sys_read
Michael Adam [Fri, 25 Mar 2016 00:28:27 +0000 (01:28 +0100)]
lib: add sys_read_v - void variant of sys_read

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agodebug: fix -O3 warning - unused return code of write()
Michael Adam [Tue, 22 Mar 2016 22:01:10 +0000 (23:01 +0100)]
debug: fix -O3 warning - unused return code of write()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agotdb:torture: fix -O3 error unused result of write
Michael Adam [Wed, 23 Mar 2016 01:47:13 +0000 (02:47 +0100)]
tdb:torture: fix -O3 error unused result of write

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agotdb:torture: fix -O3 error unused result code of read
Michael Adam [Wed, 23 Mar 2016 01:36:04 +0000 (02:36 +0100)]
tdb:torture: fix -O3 error unused result code of read

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agotevent:testsuite: fix O3 errors unused result of write
Michael Adam [Tue, 5 Apr 2016 16:51:13 +0000 (18:51 +0200)]
tevent:testsuite: fix O3 errors unused result of write

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agotevent:testsuite: fix O3 errors unused result for read
Michael Adam [Tue, 5 Apr 2016 16:40:37 +0000 (18:40 +0200)]
tevent:testsuite: fix O3 errors unused result for read

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agotevent:signal: fix -O3 error unused result of read
Michael Adam [Wed, 23 Mar 2016 01:23:35 +0000 (02:23 +0100)]
tevent:signal: fix -O3 error unused result of read

some compilers don't tolerate void-casting for warn_unused_result

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agotevent:signal: fix -O3 error unused result of write
Michael Adam [Wed, 23 Mar 2016 00:41:29 +0000 (01:41 +0100)]
tevent:signal: fix -O3 error unused result of write

some compilers don't tolerate void-casting for warn_unused_result

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agotevent:threads: fix -O3 error unused result of write
Michael Adam [Wed, 23 Mar 2016 00:41:17 +0000 (01:41 +0100)]
tevent:threads: fix -O3 error unused result of write

some compilers don't tolerate void-casting for warn_unused_result

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
3 years agos3:rpcclient add -m option
Christian Ambach [Wed, 11 May 2016 16:54:58 +0000 (18:54 +0200)]
s3:rpcclient add -m option

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu May 12 17:36:09 CEST 2016 on sn-devel-144

3 years agos3:selftest add a test for rpcclient --pw-nt-hash option
Christian Ambach [Wed, 11 May 2016 17:21:20 +0000 (19:21 +0200)]
s3:selftest add a test for rpcclient --pw-nt-hash option

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3:rpcclient make --pw-nt-hash option work
Christian Ambach [Wed, 11 May 2016 15:41:24 +0000 (17:41 +0200)]
s3:rpcclient make --pw-nt-hash option work

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

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3:rpc_server/samr: simplify the logic in get_user_info_18()
Stefan Metzmacher [Mon, 14 Mar 2016 12:07:48 +0000 (13:07 +0100)]
s3:rpc_server/samr: simplify the logic in get_user_info_18()

We only allow SetUserInformation(level=18) via NCALRPC.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu May 12 14:02:27 CEST 2016 on sn-devel-144

3 years agos3:libsmb/clifile use correct value for MaxParameterCount for setting EAs
Christian Ambach [Tue, 10 May 2016 17:47:02 +0000 (19:47 +0200)]
s3:libsmb/clifile use correct value for MaxParameterCount for setting EAs

Windows servers will refuse trans2 requests which use excessive
request parameters. From [MS-CIFS|:
<239> Section 3.3.5.2.5: Windows NT servers fail a transaction request with
STATUS_INSUFF_SERVER_RESOURCES, if (SetupCount + MaxSetupCount +
TotalParameterCount + MaxParameterCount + TotalDataCount + MaxDataCount)
is greater than 65*1024.

When attempting to set a large list of EAs for a file, this limit can be
hit when using CLI_BUFFER_SIZE as MaxDataCount
while the TRANS2_SET_PATH_INFORMATION response has no data reply,
only parameters (section 2.2.6.7.2).

Be as minimal as possible here to allow a maximum number of EAs to
be written.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11354
Reviewed-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Christian Ambach <ambi@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed May 11 18:35:59 CEST 2016 on sn-devel-144

3 years agoldb-samba: Add "secret" as a value to hide in LDIF files
Andrew Bartlett [Sat, 2 Jan 2016 07:58:39 +0000 (20:58 +1300)]
ldb-samba: Add "secret" as a value to hide in LDIF files

This is not secret or encrypted in LDAP, but is sensitive in secrets.ldb

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Wed May 11 07:17:38 CEST 2016 on sn-devel-144

3 years agoclassicupgrade: Avoid needing to quote CN values in an DN, use dn.set_component()
Andrew Bartlett [Wed, 23 Sep 2015 19:41:22 +0000 (07:41 +1200)]
classicupgrade: Avoid needing to quote CN values in an DN, use dn.set_component()

While invalid for samAccountName values, when also used for
samAccountName we should be dealing with this at the samldb layer, not
here.

This comes from unvalidated Samba3 data that can contain a , or =
without a problem in that codebase.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agosamr4: Remove talloc_asprintf leak onto mem_ctx
Garming Sam [Wed, 11 May 2016 01:02:03 +0000 (13:02 +1200)]
samr4: Remove talloc_asprintf leak onto mem_ctx

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

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamr4: Use <SID=%s> in GetAliasMembership
Mantas Mikulėnas [Wed, 24 Feb 2016 17:40:47 +0000 (19:40 +0200)]
samr4: Use <SID=%s> in GetAliasMembership

As in commit 841845dea35089a187fd1626c9752d708989ac7b, this avoids
quoting problems in user DN's.

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

Signed-off-by: Mantas Mikulėnas <grawity@gmail.com>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoctdb-tests: rename tests from stubby.* to ctdb.*
Amitay Isaacs [Tue, 10 May 2016 08:28:40 +0000 (18:28 +1000)]
ctdb-tests: rename tests from stubby.* to ctdb.*

These tests do not use ctdb tool stub anymore.

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): Wed May 11 02:19:20 CEST 2016 on sn-devel-144

3 years agoctdb-tests: Fix output for ctdb reloadnodes tests
Amitay Isaacs [Thu, 28 Apr 2016 05:12:40 +0000 (15:12 +1000)]
ctdb-tests: Fix output for ctdb reloadnodes tests

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-tests: Fix output for ctdb lvs test
Amitay Isaacs [Thu, 28 Apr 2016 08:43:56 +0000 (18:43 +1000)]
ctdb-tests: Fix output for ctdb lvs test

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-tests: Fix output for ctdb getcapabilities test
Amitay Isaacs [Thu, 28 Apr 2016 08:43:32 +0000 (18:43 +1000)]
ctdb-tests: Fix output for ctdb getcapabilities test

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-tests: Remove ctdb tool stub code
Amitay Isaacs [Tue, 10 May 2016 08:38:56 +0000 (18:38 +1000)]
ctdb-tests: Remove ctdb tool stub code

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-tests: Use fake_ctdbd for ctdb tool tests instead of ctdb stub
Amitay Isaacs [Tue, 26 Apr 2016 15:42:33 +0000 (01:42 +1000)]
ctdb-tests: Use fake_ctdbd for ctdb tool tests instead of ctdb stub

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-tests: Add fake ctdb daemon implementation for testing
Amitay Isaacs [Fri, 22 Apr 2016 07:30:52 +0000 (17:30 +1000)]
ctdb-tests: Add fake ctdb daemon implementation for testing

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-tool: All errors should be logged via stderr
Amitay Isaacs [Fri, 6 May 2016 04:06:43 +0000 (14:06 +1000)]
ctdb-tool: All errors should be logged via stderr

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-tool: Add test-hooks to enable testing of the tool
Amitay Isaacs [Thu, 28 Apr 2016 03:03:35 +0000 (13:03 +1000)]
ctdb-tool: Add test-hooks to enable testing of the tool

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-tests: Remove ctdb reloadips tests
Amitay Isaacs [Thu, 28 Apr 2016 05:40:22 +0000 (15:40 +1000)]
ctdb-tests: Remove ctdb reloadips tests

Since there are no public IPs setup, these tests do not really test the
functionality.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-tool: Remove xpnn command and related tests
Amitay Isaacs [Thu, 28 Apr 2016 03:32:31 +0000 (13:32 +1000)]
ctdb-tool: Remove xpnn command and related tests

It's unreliable and should not be used.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-protocol: Add function to compare ctdb_sock_addr
Amitay Isaacs [Wed, 27 Apr 2016 08:30:12 +0000 (18:30 +1000)]
ctdb-protocol: Add function to compare ctdb_sock_addr

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-natgw: Allow override of CTDB for testing
Amitay Isaacs [Thu, 28 Apr 2016 03:11:29 +0000 (13:11 +1000)]
ctdb-natgw: Allow override of CTDB for testing

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-lvs: Allow override of CTDB for testing
Amitay Isaacs [Tue, 26 Apr 2016 15:43:39 +0000 (01:43 +1000)]
ctdb-lvs: Allow override of CTDB for testing

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-tests: Get rid of ctdb func tests
Amitay Isaacs [Wed, 27 Apr 2016 02:21:18 +0000 (12:21 +1000)]
ctdb-tests: Get rid of ctdb func tests

This tested parse_nodestring function from tools/ctdb.c.  However,
ctdb.c is soon going to be replaced with the code using new client API.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agotests/dcerpc: add tests for string allocation and deletion
Douglas Bagnall [Tue, 3 May 2016 23:24:12 +0000 (11:24 +1200)]
tests/dcerpc: add tests for string allocation and deletion

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue May 10 05:11:42 CEST 2016 on sn-devel-144

3 years agoselftest: Enable samba.tests.dcerpc.array test
Douglas Bagnall [Tue, 3 May 2016 23:21:47 +0000 (11:21 +1200)]
selftest: Enable samba.tests.dcerpc.array test

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/dcerpc/array.py: test deletion of arrays
Douglas Bagnall [Wed, 4 May 2016 05:43:33 +0000 (17:43 +1200)]
tests/dcerpc/array.py: test deletion of arrays

We expect an AttributeError.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoPython pidl: avoid segfault with "del obj->attr"
Douglas Bagnall [Wed, 4 May 2016 04:51:37 +0000 (16:51 +1200)]
Python pidl: avoid segfault with "del obj->attr"

Deleting an attribute in Python (using the "del" statement) is (at
some stages along a winding path, for C objects) converted into
setting the attribute to NULL. Not None, actual NULL. The way we
handled this NULL was to dereference it. This changes the behaviour to
raising an AttributeError, which is more or less what Python does in
similar situations with builtin objects.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopytalloc: avoid double 0x0x in repr strings
Douglas Bagnall [Tue, 3 May 2016 22:16:41 +0000 (10:16 +1200)]
pytalloc: avoid double 0x0x in repr strings

The %p format puts one in itself.

Before: <drsblobs.repsFromTo2 talloc based object at 0x0x1b551e0>
After:  <drsblobs.repsFromTo2 talloc based object at 0x1b551e0>

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopidl: Correct string handling to use talloc and be in common
Andrew Bartlett [Thu, 21 Apr 2016 09:44:56 +0000 (21:44 +1200)]
pidl: Correct string handling to use talloc and be in common

The previous string handling assumed the python variables referenced
by PyString_AS_STRING had infinite life.  When they were re-used
the C structure started to point at unexpected things.

We now check correctly for Unicode in every case, and we always
duplicate the string with talloc_strdup()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agojoin.py: Fetch the remote DC NTDS GUID early
Andrew Bartlett [Sun, 27 Mar 2016 04:29:35 +0000 (17:29 +1300)]
join.py: Fetch the remote DC NTDS GUID early

This avoids touching the LDAP connection after the long replicate cycle, as it may
have timed out

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agoselftest: Include a few more details in selftest and samba startup.
Andrew Bartlett [Wed, 4 May 2016 23:35:46 +0000 (11:35 +1200)]
selftest: Include a few more details in selftest and samba startup.

This helps us understand failure modes in selftest

Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
3 years agorepl_meta_data: Explain why time(NULL) is good enough here
Andrew Bartlett [Fri, 26 Feb 2016 02:57:48 +0000 (15:57 +1300)]
repl_meta_data: Explain why time(NULL) is good enough here

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agoldb: Fix error string when renaming to an DN that already exists
Andrew Bartlett [Tue, 15 Mar 2016 01:07:22 +0000 (14:07 +1300)]
ldb: Fix error string when renaming to an DN that already exists

We were printing the DN renamed from, not the DN being renamed to.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agosource4/registry/local: avoid str_list_length() to check first element
Douglas Bagnall [Fri, 6 May 2016 03:30:57 +0000 (15:30 +1200)]
source4/registry/local: avoid str_list_length() to check first element

We don't need to walk to the end of the list to find out if the first
one is NULL.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agodsdb schema_query: reduce calls to str_list_length
Douglas Bagnall [Fri, 6 May 2016 03:30:15 +0000 (15:30 +1200)]
dsdb schema_query: reduce calls to str_list_length

We were calling str_list_length(new_attrs) three times when one is
enough.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agodsdb/common/util: be careful about zero length string lists
Douglas Bagnall [Fri, 6 May 2016 03:25:54 +0000 (15:25 +1200)]
dsdb/common/util: be careful about zero length string lists

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agodsdb/common/util: remove some unnecessary str_list_length()s
Douglas Bagnall [Fri, 6 May 2016 03:22:35 +0000 (15:22 +1200)]
dsdb/common/util: remove some unnecessary str_list_length()s

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosource4/param/pyparam.c: fix strange indentation
Douglas Bagnall [Tue, 3 May 2016 02:39:08 +0000 (14:39 +1200)]
source4/param/pyparam.c: fix strange indentation

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopython/join.py: Avoid unchecked print in error path
Douglas Bagnall [Wed, 4 May 2016 21:39:58 +0000 (09:39 +1200)]
python/join.py: Avoid unchecked print in error path

In autobuild this print causes an IOError when stdout is dead,
which hides the exception you care about and prevents the actual
clean up.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agodsdb: Improve debug messages in operational module
Andrew Bartlett [Sun, 20 Mar 2016 22:29:04 +0000 (11:29 +1300)]
dsdb: Improve debug messages in operational module

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agodsdb: Clarify rename handling as to which record is being renamed
Andrew Bartlett [Tue, 15 Mar 2016 02:13:36 +0000 (15:13 +1300)]
dsdb: Clarify rename handling as to which record is being renamed

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agoselftest: Wait 60 seconds for a RID alloc
Andrew Bartlett [Thu, 5 May 2016 10:21:11 +0000 (22:21 +1200)]
selftest: Wait 60 seconds for a RID alloc

This ensures we give it a reasonable enough chance to start up.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agoselftest: Print a message when RID allocation fails
Andrew Bartlett [Thu, 5 May 2016 07:34:41 +0000 (19:34 +1200)]
selftest: Print a message when RID allocation fails

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agolibcli/auth: let msrpc_parse() return talloc'ed empty strings
Stefan Metzmacher [Mon, 9 May 2016 14:14:31 +0000 (16:14 +0200)]
libcli/auth: let msrpc_parse() return talloc'ed empty strings

This make it more predictable for the callers.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11912
BUG: https://bugzilla.redhat.com/show_bug.cgi?id=1334356
BUG: https://launchpad.net/bugs/1578576

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon May  9 22:27:21 CEST 2016 on sn-devel-144

3 years agosmbd: Remove an unused #define
Volker Lendecke [Mon, 9 May 2016 11:12:01 +0000 (13:12 +0200)]
smbd: Remove an unused #define

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): Mon May  9 17:20:22 CEST 2016 on sn-devel-144

3 years agoheimdal: encode/decode kvno as signed integer
Uri Simchoni [Thu, 5 May 2016 20:40:22 +0000 (23:40 +0300)]
heimdal: encode/decode kvno as signed integer

This patch changes the encoding/decoding of kvno (key version number)
in blobs and packets to signed integer, for compatibility with Windows.
Reportedly, MIT Kerberos does the same.

This patch effectively reverts commit 1124c4872dfb81bec9c4b527b8927ca35e39a599
in the heimdal tree.

According to the Kerberos spec (RFC 4120 5.2.9), the kvno field
in encrypted data object is an unsigned integer that fits in
32 bits. The Heimdal Kerberos component bundled with Samba
conforms to this. However, Windows deviates from the standard
and encodes kvno as a signed integer, and this creates
interoperability issues.

ASN.1 DER has no special encoding for unsigned integer. A 32-bit
unsigned integer is encoded as a signed integer, so while a signed
32-bit integer (covering the range of -0x80000000..0x7fffffff) is
encoded using up to 4 bytes, an unsigned integer (covering
0..0xffffffff) could require 5 bytes.

Normally, kvno for a given account starts at 1 and increments on
password changes. Kerberos defined this as unsigned because there's
no meaning for negative version numbers, so the standard writers figured
4 billion versions is better than 2 billion. It was not
expected for a kvno to really go past 0x7fffffff and the disctinction
usually does not matter. However, RODCs use kvnos which
have the most-significant bit set.

In Active Directory, RODCs have a private secret for the krbtgt,
because the assumption is that the RODC is less secure, and
recovering the domain krbtgt secret from the RODC would compromise
the security of the entire domain. The kvno field is being used
to identify the private krbtgt account that owns the key - the
upper 16 bits are the RODC id, and the lower 16 bits identify
the key version number for this specific RODC. It's common to
have an RODC id greater than 0x8000, and therefore to have a
kvno larger than 0x7fffffff, which would be DER-encoded using
5 bytes.

Windows encodes kvno as signed integer - basically taking the
32 bits and treating them as a signed integer rather than an
unsigned integer. This means that in Windows a kvno can
always be encoded using 4 bytes, and Windows DCs reject a kvno
encoded using more than 4 bytes without even generating an error
response (the DC assumes it's an attack).

Heimdal re-encodes the TGT when it creates a TGS request. Obviously
it cannot decode and encode the encrypted parts but it does re-encode
the plain parts, which include the kvno. That leads to a 5-byte
kvno in the TGS request, which is rejected without an error
response.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Sat May  7 21:14:21 CEST 2016 on sn-devel-144

3 years agoinit: set core file size to unlimited by default
Raghavendra Talur [Mon, 2 May 2016 10:44:06 +0000 (16:14 +0530)]
init: set core file size to unlimited by default

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

Signed-off-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jose A. Rivera <jarrpa@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri May  6 19:15:17 CEST 2016 on sn-devel-144

3 years agoctdb-recoverd: Fold IP allocation house-keeping into IP verification
Martin Schwenke [Tue, 3 May 2016 06:36:37 +0000 (16:36 +1000)]
ctdb-recoverd: Fold IP allocation house-keeping into IP verification

Now all the IP takeover code for non-master node is in this function.
The function can always be renamed to something more suitable.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Fri May  6 15:10:59 CEST 2016 on sn-devel-144

3 years agoctdb-recoverd: Clean up local IP verification
Martin Schwenke [Mon, 9 Nov 2015 05:12:31 +0000 (16:12 +1100)]
ctdb-recoverd: Clean up local IP verification

Update log levels and messages, comments and wrapping of long lines.
No functional changes.

Note that interfaces_have_changed() already does adequate logging.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agoctdb-recoverd: Skip known IP address checking when it is disabled
Martin Schwenke [Mon, 9 Nov 2015 04:44:15 +0000 (15:44 +1100)]
ctdb-recoverd: Skip known IP address checking when it is disabled

When public IP checking is disabled, verify_local_ip_allocation()
still retrieves known IP addresses and runs through a loop that does
nothing.

Instead, completely skip the retrieval and checking loop.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agoctdb-recoverd: Check that IP failover is active in IP verification
Martin Schwenke [Mon, 9 Nov 2015 04:41:45 +0000 (15:41 +1100)]
ctdb-recoverd: Check that IP failover is active in IP verification

This makes verify_local_ip_allocation() self-contained and simplifies
main_loop().

Due to indentation changes, this commit is most easily read when
ignoring whitespace.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agoctdb-recoverd: Call election when necessary in recovery master validation
Martin Schwenke [Thu, 28 Apr 2016 06:58:35 +0000 (16:58 +1000)]
ctdb-recoverd: Call election when necessary in recovery master validation

There is no need to return one of several states and then trigger an
election for one of those return states.  Have the recovery master
validation trigger the election directly and just return whether
monitoring should continue.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agoctdb-recoverd: Simplify return values when updating local flags
Martin Schwenke [Wed, 27 Apr 2016 11:47:08 +0000 (21:47 +1000)]
ctdb-recoverd: Simplify return values when updating local flags

Change this to return just 0 or -1.  It isn't monitoring anything.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agoctdb-recoverd: Drop unreachable code
Martin Schwenke [Wed, 27 Apr 2016 11:44:36 +0000 (21:44 +1000)]
ctdb-recoverd: Drop unreachable code

update_local_flags() never returns MONITOR_ELECTION_NEEDED, so drop
this entire if-statement.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agoctdb-protocol: Drop unused CTDB_SRVID_TAKEOVER_RUN_RESPONSE
Martin Schwenke [Wed, 4 May 2016 06:51:05 +0000 (16:51 +1000)]
ctdb-protocol: Drop unused CTDB_SRVID_TAKEOVER_RUN_RESPONSE

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