metze/samba/wip.git
3 years agolib: Remove sys_waitpid
Volker Lendecke [Tue, 16 Feb 2016 14:46:06 +0000 (15:46 +0100)]
lib: Remove sys_waitpid

We have waitpid in libreplace

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agolib: Fix whitespace
Volker Lendecke [Tue, 16 Feb 2016 13:59:53 +0000 (14:59 +0100)]
lib: Fix whitespace

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agolib: Move data_blob_list_item to source4
Volker Lendecke [Sat, 20 Feb 2016 09:07:11 +0000 (10:07 +0100)]
lib: Move data_blob_list_item to source4

It's only used in dcesrv_call_state.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agosmbd: Fix line length & whitespace in write_file
Volker Lendecke [Thu, 14 Jan 2016 10:51:39 +0000 (11:51 +0100)]
smbd: Fix line length & whitespace in write_file

No code change intended. This file just looked to hard to read.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agopy_xattr: Fix a "ignoring return value" warning
Volker Lendecke [Wed, 13 Jan 2016 10:15:36 +0000 (11:15 +0100)]
py_xattr: Fix a "ignoring return value" warning

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agowinbindd: return trust parameters when listing trusts
Uri Simchoni [Tue, 9 Feb 2016 22:38:11 +0000 (00:38 +0200)]
winbindd: return trust parameters when listing trusts

When asking a child domain process to list trusts on that domain,
return (along with trust domain names and SID) the trust properties -
flags, type, and attributes.

Use those attributes to initialize domain object.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Feb 23 22:02:16 CET 2016 on sn-devel-144

3 years agowinbindd: initialize foreign domain as AD based on trust
Uri Simchoni [Tue, 9 Feb 2016 22:32:23 +0000 (00:32 +0200)]
winbindd: initialize foreign domain as AD based on trust

Based on trust parameters, initialize the active_directory
member of domain object to true.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agowinbindd: introduce add_trusted_domain_from_tdc()
Uri Simchoni [Tue, 9 Feb 2016 22:26:45 +0000 (00:26 +0200)]
winbindd: introduce add_trusted_domain_from_tdc()

This is purely a refactoring patch -
Add a routine that adds a winbindd domain object based on
domain trust cache entry. add_trusted_domain() becomes
a wrapper for this new routine.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3/winbindd: Add missing space in debug message.
Karolin Seeger [Tue, 23 Feb 2016 09:12:10 +0000 (10:12 +0100)]
s3/winbindd: Add missing space in debug message.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(master): Tue Feb 23 14:20:01 CET 2016 on sn-devel-144

3 years agoctdb-recovery: Limit scope of reclock latency statistics
Martin Schwenke [Mon, 1 Feb 2016 00:46:05 +0000 (11:46 +1100)]
ctdb-recovery: Limit scope of reclock latency statistics

It does not make sense to update this statistic for the timeout case,
since this could skew the statistic.  To keep it simple, just update
it for the usual case where there is lock contention, since this is
the usual case.  So the daemon statistic measures time to test the
lock and the corresponding recovery daemon statistic measures time to
take the lock.

Additionally, the recovery daemon will eventually use this code to
take the lock, and the method of updating the latency statistic will
need to be pushed further out to a configurable handler that depends
on the calling context.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Tue Feb 23 10:32:06 CET 2016 on sn-devel-144

3 years agoctdb-recovery: Negate the status when checking the recovery lock
Martin Schwenke [Thu, 28 Jan 2016 04:07:30 +0000 (15:07 +1100)]
ctdb-recovery: Negate the status when checking the recovery lock

Have 0 indicate that the lock was taken.  This allows non-zero values
to be used to indicate why the lock could not be taken.  EACCES means
lock contention.

For now use just EACCES to cover all failures, since
ctdb_recovery_lock() returns a bool and details of other errors will
be lost.  ctdb_recovery_lock() will undergo some big changes, so don't
try to fix this now.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agoctdb-recovery: Clean up status handling from recmode child
Martin Schwenke [Thu, 28 Jan 2016 03:59:18 +0000 (14:59 +1100)]
ctdb-recovery: Clean up status handling from recmode child

This currently returns an incorrect error when the expected number of
bytes are not read.  Separate out the different cases to clarify the
logic and avoid reporting the wrong error.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agoctdb-recovery: Don't bother ensuring file descriptor is -1
Martin Schwenke [Mon, 11 Jan 2016 03:50:14 +0000 (14:50 +1100)]
ctdb-recovery: Don't bother ensuring file descriptor is -1

This is already done before the destructor is assigned.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agoctdb-recovery: Don't store recmode in recovery mode state
Martin Schwenke [Mon, 11 Jan 2016 02:58:54 +0000 (13:58 +1100)]
ctdb-recovery: Don't store recmode in recovery mode state

The callbacks that use this value are only ever called if recovery
mode is being set to NORMAL.  So do not check if recmode is NORMAL
either.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agoctdb: Use ctdb_wait_for_process_to_exit()
Martin Schwenke [Tue, 8 Dec 2015 03:20:59 +0000 (14:20 +1100)]
ctdb: Use ctdb_wait_for_process_to_exit()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agoctdb-common: New function ctdb_wait_for_process_to_exit()
Martin Schwenke [Tue, 8 Dec 2015 03:12:46 +0000 (14:12 +1100)]
ctdb-common: New function ctdb_wait_for_process_to_exit()

This pattern is used quite a few times in the CTDB code.  Many
instances use ctdb_kill() but for signal 0 this just calls kill(2)
anyway.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agoctdb-recovery: Drop redundant status send when setting recovery mode
Martin Schwenke [Tue, 8 Dec 2015 03:21:33 +0000 (14:21 +1100)]
ctdb-recovery: Drop redundant status send when setting recovery mode

The child process writes the status into the pipe before looping to
wait.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agoctdb-recovery: Include lib/util/time.h instead of samba_util.h
Martin Schwenke [Tue, 16 Feb 2016 02:41:21 +0000 (13:41 +1100)]
ctdb-recovery: Include lib/util/time.h instead of samba_util.h

Less is more...

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agotorture:smb2: improve torture_comments in connect test
Michael Adam [Mon, 22 Feb 2016 23:27:11 +0000 (00:27 +0100)]
torture:smb2: improve torture_comments in connect test

Signed-off-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Feb 23 04:50:53 CET 2016 on sn-devel-144

3 years agotorture:smb2: fix memory leak in connect test.
Michael Adam [Mon, 22 Feb 2016 22:23:13 +0000 (23:23 +0100)]
torture:smb2: fix memory leak in connect test.

Signed-off-by: Michael Adam <obnox@samba.org>
3 years agotorture:smb2: rewrite connect test to use torture_asserts for create errors
Michael Adam [Mon, 22 Feb 2016 15:22:14 +0000 (16:22 +0100)]
torture:smb2: rewrite connect test to use torture_asserts for create errors

let torture_smb2_createfile propagate errors

Signed-off-by: Michael Adam <obnox@samba.org>
3 years agotorture:smb2: rewrite connect test to use torture_asserts
Michael Adam [Mon, 22 Feb 2016 13:32:44 +0000 (14:32 +0100)]
torture:smb2: rewrite connect test to use torture_asserts

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agowinbindd: move a variable into scope
Michael Adam [Mon, 22 Feb 2016 14:18:26 +0000 (15:18 +0100)]
winbindd: move a variable into scope

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3-kerberos: avoid entering a password change dialogue also when using MIT.
Günther Deschner [Mon, 15 Feb 2016 11:58:07 +0000 (12:58 +0100)]
s3-kerberos: avoid entering a password change dialogue also when using MIT.

Without this fix, for accounts with an expired password, a password change
process is initiated and - due to the prompter - this fails with a confusing
error message:

"kerberos_kinit_password Administrator@W2K12DOM.BER.REDHAT.COM failed: Password
mismatch
Failed to join domain: failed to connect to AD: Password mismatch"

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agowinbind: Remove unused WINBINDD_UID_TO_SID
Volker Lendecke [Tue, 9 Feb 2016 08:36:37 +0000 (09:36 +0100)]
winbind: Remove unused WINBINDD_UID_TO_SID

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Feb 22 23:39:13 CET 2016 on sn-devel-144

3 years agonss_aix: Hack away WINBINDD_UID_TO_SID
Volker Lendecke [Tue, 9 Feb 2016 08:42:28 +0000 (09:42 +0100)]
nss_aix: Hack away WINBINDD_UID_TO_SID

To do a proper xids2sids conversion I need a build environment.

Everyone who needs this and can build AIX please speak up!

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agowinbind: Remove unused WINBINDD_GID_TO_SID
Volker Lendecke [Tue, 9 Feb 2016 08:36:37 +0000 (09:36 +0100)]
winbind: Remove unused WINBINDD_GID_TO_SID

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agoselftest: "standard" process model for a few envs
Volker Lendecke [Wed, 17 Feb 2016 10:58:43 +0000 (11:58 +0100)]
selftest: "standard" process model for a few envs

This is needed as with source4/libcli/wbclient changed to nsswitch/libwbclient
we don't have a nested event loop here anymore.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agolibwbclient: Make source4/ use nsswitch/libwbclient
Volker Lendecke [Tue, 9 Feb 2016 08:30:09 +0000 (09:30 +0100)]
libwbclient: Make source4/ use nsswitch/libwbclient

Right now there's no async user of this, so I think it's okay to use the
sync libwbclient. If we really get async libwbclient users, we need to
put it there instead of calling the struct protocol directly.

The code before this patch did not look at the _NO_WINBIND environment
variable. So ignore it here too.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agolibwbclient: Use wbcCtxUnixIdsToSids in wbcCtxGidToSid
Volker Lendecke [Tue, 9 Feb 2016 07:19:41 +0000 (08:19 +0100)]
libwbclient: Use wbcCtxUnixIdsToSids in wbcCtxGidToSid

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agolibwbclient: Use wbcCtxUnixIdsToSids in wbcCtxUidToSid
Volker Lendecke [Tue, 9 Feb 2016 07:17:40 +0000 (08:17 +0100)]
libwbclient: Use wbcCtxUnixIdsToSids in wbcCtxUidToSid

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agowinbind: Remove unused WINBINDD_SID_TO_GID
Volker Lendecke [Tue, 9 Feb 2016 07:02:22 +0000 (08:02 +0100)]
winbind: Remove unused WINBINDD_SID_TO_GID

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agowinbind: Remove unused WINBINDD_SID_TO_UID
Volker Lendecke [Tue, 9 Feb 2016 07:02:22 +0000 (08:02 +0100)]
winbind: Remove unused WINBINDD_SID_TO_UID

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agolibwbclient: Use wbcCtxSidsToUnixIds in wbcCtxSidToGid
Volker Lendecke [Tue, 9 Feb 2016 06:36:13 +0000 (07:36 +0100)]
libwbclient: Use wbcCtxSidsToUnixIds in wbcCtxSidToGid

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agolibwbclient: Use wbcCtxSidsToUnixIds in wbcCtxSidToUid
Volker Lendecke [Tue, 9 Feb 2016 06:36:13 +0000 (07:36 +0100)]
libwbclient: Use wbcCtxSidsToUnixIds in wbcCtxSidToUid

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agowinbind: Remove unused wbint_Gid2Sid
Volker Lendecke [Mon, 8 Feb 2016 16:43:58 +0000 (17:43 +0100)]
winbind: Remove unused wbint_Gid2Sid

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agowinbind: Use xids2sids in getgrgid
Volker Lendecke [Mon, 8 Feb 2016 16:34:38 +0000 (17:34 +0100)]
winbind: Use xids2sids in getgrgid

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agowinbind: Use xids2sids in gid2sid
Volker Lendecke [Mon, 8 Feb 2016 16:34:38 +0000 (17:34 +0100)]
winbind: Use xids2sids in gid2sid

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agowinbind: Remove unused wbint_Uid2Sid
Volker Lendecke [Mon, 8 Feb 2016 16:43:58 +0000 (17:43 +0100)]
winbind: Remove unused wbint_Uid2Sid

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agowinbind: Use xids2sids in getpwuid
Volker Lendecke [Mon, 8 Feb 2016 16:34:38 +0000 (17:34 +0100)]
winbind: Use xids2sids in getpwuid

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agowinbind: Use xids2sids in uid2sid
Volker Lendecke [Mon, 8 Feb 2016 16:34:38 +0000 (17:34 +0100)]
winbind: Use xids2sids in uid2sid

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agowbinfo: Add --unix-ids-to-sids
Volker Lendecke [Fri, 14 Aug 2015 15:13:57 +0000 (17:13 +0200)]
wbinfo: Add --unix-ids-to-sids

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agolibwbclient: Implement wbc[Ctx]UnixIdsToSids
Volker Lendecke [Fri, 14 Aug 2015 09:55:37 +0000 (11:55 +0200)]
libwbclient: Implement wbc[Ctx]UnixIdsToSids

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agowinbind: Expose WINBINDD_XIDS_TO_SIDS externally
Volker Lendecke [Fri, 14 Aug 2015 15:15:33 +0000 (17:15 +0200)]
winbind: Expose WINBINDD_XIDS_TO_SIDS externally

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agowinbind: Add parse_xidlist()
Volker Lendecke [Fri, 14 Aug 2015 15:14:53 +0000 (17:14 +0200)]
winbind: Add parse_xidlist()

This will be part of parsing the socket protocols xids2sids request

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agowinbind: Add wb_xids2sids
Volker Lendecke [Thu, 20 Aug 2015 15:07:47 +0000 (17:07 +0200)]
winbind: Add wb_xids2sids

Async wrapper around wbint_UnixIDs2Sids

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agowinbind: Add wbint_UnixIDs2Sids
Volker Lendecke [Thu, 20 Aug 2015 15:07:19 +0000 (17:07 +0200)]
winbind: Add wbint_UnixIDs2Sids

The idmap backend function is doing multiple conversions in one run, but this
is not used so far. First step in exposing plural xid2sid. This is a fake
routine in that it does the one-element calls, but you have to start somewhere.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agowinbind: Simplify _wbint_Sids2UnixIDs
Volker Lendecke [Tue, 29 Dec 2015 21:33:20 +0000 (21:33 +0000)]
winbind: Simplify _wbint_Sids2UnixIDs

Same number of lines, but from my point of view quite a bit simpler now
that we only have to handle one domain.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agowinbind: Make _wbint_Sids2UnixIDs single-domain
Volker Lendecke [Tue, 29 Dec 2015 15:19:34 +0000 (15:19 +0000)]
winbind: Make _wbint_Sids2UnixIDs single-domain

This is required to handle domain-specific error messages properly in the
parent. Currently unused, but I want to handle DOMAIN_CONTROLLER_NOT_FOUND
for the idmap_ad backend soon by doing a getdcname (RPC or ourselves or
so) from the parent context.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agowinbind: Remove a level of indirection
Volker Lendecke [Tue, 29 Dec 2015 10:59:54 +0000 (11:59 +0100)]
winbind: Remove a level of indirection

idmap_doms does not need a talloc of its own

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:rpc_server: make it possible to build mdssvc as a shared module
Ralph Boehme [Tue, 6 Oct 2015 11:45:33 +0000 (13:45 +0200)]
s3:rpc_server: make it possible to build mdssvc as a shared module

Allow building mdssvc RPC service as shared module:

  --with-shared-modules=rpc_mdssvc_module

The default is to build it static.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Sun Feb 21 22:28:41 CET 2016 on sn-devel-144

3 years agos3:rpc_server: allow building RPC services as shared modules
Ralph Boehme [Sat, 24 Oct 2015 08:50:43 +0000 (10:50 +0200)]
s3:rpc_server: allow building RPC services as shared modules

This is the general RPC subsystem change, existing modules must be
tweaked to support being loaded as a module.

The next commit shows how to do this for the Spotlight RPC service.

The general syntax is: --with-shared-modules=rpc_NAME_module

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agotestprogs/blackbox/subunit: Fix testok
Christof Schmitt [Mon, 8 Feb 2016 21:20:56 +0000 (14:20 -0700)]
testprogs/blackbox/subunit: Fix testok

The fail count is always in the second parameter. Omit the shift
operations, so that the value can be read correctly from $2.

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): Sat Feb 20 03:58:01 CET 2016 on sn-devel-144

3 years agotest_sharesec: Fix check for deleted ACL
Christof Schmitt [Thu, 4 Feb 2016 23:39:59 +0000 (16:39 -0700)]
test_sharesec: Fix check for deleted ACL

Remove semicolon; without this change the test could not detect a
failure of removing the ACL.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agotest_sharesec: Fix usage message
Christof Schmitt [Thu, 4 Feb 2016 23:35:25 +0000 (16:35 -0700)]
test_sharesec: Fix usage message

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agotest_sharesec: Add new test for ACL entry from numerical input
Christof Schmitt [Thu, 4 Feb 2016 23:35:08 +0000 (16:35 -0700)]
test_sharesec: Add new test for ACL entry from numerical input

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agoutil_sd: Also accept hex input for ALLOW/DENIED
Christof Schmitt [Mon, 8 Feb 2016 20:56:23 +0000 (13:56 -0700)]
util_sd: Also accept hex input for ALLOW/DENIED

Implement this by explicitly checking for decimal or hexadecimal input.
This avoids using sscanf with %i and a signed integer type, and it also
matches the code paths for flags and mask that also have an explicit
check.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agotevent: version 0.9.28 samba-upstream/tags/tevent-0.9.28
Stefan Metzmacher [Fri, 19 Feb 2016 10:46:03 +0000 (11:46 +0100)]
tevent: version 0.9.28

* Fix memory leak when old signal action restored (bug #11742)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Feb 19 19:12:25 CET 2016 on sn-devel-144

3 years agos4:dsdb_notification: fix the --picky-developer build with gcc 4.4.3
Stefan Metzmacher [Thu, 18 Feb 2016 23:29:50 +0000 (00:29 +0100)]
s4:dsdb_notification: fix the --picky-developer build with gcc 4.4.3

The following warning/error is reported:

[1891/4034] Compiling source4/dsdb/samdb/ldb_modules/dsdb_notification.c
cc1: warnings being treated as errors
../source4/dsdb/samdb/ldb_modules/dsdb_notification.c: In function 'dsdb_notification_filter_search':
../source4/dsdb/samdb/ldb_modules/dsdb_notification.c:192: error: value computed is not used
Waf: Leaving directory `/memdisk/autobuild/fl/b300949/samba/bin'
Build failed:  -> task failed (err #1):
{task: cc dsdb_notification.c -> dsdb_notification_84.o}

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos4-libcli: Add missing ldb header
Andreas Schneider [Wed, 17 Feb 2016 10:41:47 +0000 (11:41 +0100)]
s4-libcli: Add missing ldb header

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agoloadparm: Remove an unneeded variable
Volker Lendecke [Thu, 18 Feb 2016 07:16:20 +0000 (08:16 +0100)]
loadparm: Remove an unneeded variable

When reviewing the patch for bug 11740 I found that the definition of
"num_to_alloc" was not part of the patch text, I had to look it up
in context. Unnecessary I believe.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Feb 19 15:56:19 CET 2016 on sn-devel-144

3 years agotests: Replace realpath with the more available 'readlink -f'
Adrian Cochrane [Tue, 16 Feb 2016 23:43:51 +0000 (12:43 +1300)]
tests: Replace realpath with the more available 'readlink -f'

The deprecation of the Debian realpath caused issues on one of the
machines we attempted to build on.

Signed-off-by: Adrian Cochrane <adrianc@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Fri Feb 19 04:43:50 CET 2016 on sn-devel-144

3 years agodocs: Add manpage for cifsdd
Andreas Schneider [Thu, 11 Feb 2016 09:49:39 +0000 (10:49 +0100)]
docs: Add manpage for cifsdd

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Thu Feb 18 18:05:55 CET 2016 on sn-devel-144

3 years agos4-client: Fix cifsdd arg parsing for skip
Andreas Schneider [Thu, 11 Feb 2016 09:47:58 +0000 (10:47 +0100)]
s4-client: Fix cifsdd arg parsing for skip

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 years agoexamples: Fix script interpreter line
Andreas Schneider [Thu, 11 Feb 2016 09:06:43 +0000 (10:06 +0100)]
examples: Fix script interpreter line

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 years agolib: tevent: Fix memory leak reported by Pavel Březina <pbrezina@redhat.com> when...
Jeremy Allison [Tue, 16 Feb 2016 22:23:53 +0000 (14:23 -0800)]
lib: tevent: Fix memory leak reported by Pavel Březina <pbrezina@redhat.com> when old signal action restored.

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

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): Thu Feb 18 01:42:50 CET 2016 on sn-devel-144

3 years agoReal memeory leak(buildup) issue in loadparm.
Hemanth Thummala [Tue, 16 Feb 2016 22:44:38 +0000 (14:44 -0800)]
Real memeory leak(buildup) issue in loadparm.

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

As part of reload services, unused service ptr structures are getting
unloaded without actually freeingup the memory associated to them.

Made changes to freeup those allocations on unload. On reload, reuse the
slots in ServicePtr global array instead of extending the array with
holes.

Also we should mark shares like IPC$ as auto loaded as they never be
exposed to users.

Signed-off-by: Hemanth Thummala <hemanth.thummala@nutanix.com>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Feb 17 22:30:25 CET 2016 on sn-devel-144

3 years agos4:selftest: run samba4.ldap.notification.python
Stefan Metzmacher [Mon, 1 Feb 2016 11:27:18 +0000 (12:27 +0100)]
s4:selftest: run samba4.ldap.notification.python

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Wed Feb 17 06:54:48 CET 2016 on sn-devel-144

3 years agos4:dsdb/tests: add notification.py with some basic tests
Stefan Metzmacher [Mon, 1 Feb 2016 09:58:41 +0000 (10:58 +0100)]
s4:dsdb/tests: add notification.py with some basic tests

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos4:dsdb: let samba_dsdb make use of the dsdb_notification module
Stefan Metzmacher [Thu, 23 Jul 2015 10:09:45 +0000 (12:09 +0200)]
s4:dsdb: let samba_dsdb make use of the dsdb_notification module

This means our LDAP server will support LDB_CONTROL_NOTIFICATION_OID now.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos4:ldap_server: add support for async notification requests
Stefan Metzmacher [Thu, 23 Jul 2015 10:08:42 +0000 (12:08 +0200)]
s4:ldap_server: add support for async notification requests

This is a simplified version that works with the current
dsdb_notification module that requires the caller to retry
periodically. We do that every 5 seconds or 100 microseconds
if we're forcing a retry.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos4:dsdb: add dsdb_notification module
Stefan Metzmacher [Thu, 23 Jul 2015 10:09:45 +0000 (12:09 +0200)]
s4:dsdb: add dsdb_notification module

This adds a simple implementation of LDB_CONTROL_NOTIFICATION_OID.
It requires caller (the ldap server task) to retry the request peridically,
using the same ldb_control structure in order to get some progress and
the never ending search behaviour an LDAP client expects.

For now we remember the known_usn in a cookie stored
in the otherwise unused ldb_control->data fielf
and we do a simple search using (uSNChanged>=${known_usn}+1).

In future we may do things based on the uSNChanged value.

for (i = old_highest + 1; i <= current_highest; i) {
search for (uSNChanged=i)
}

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos4:dsdb/samldb: check for valid lDAPDisplayName vaues on add()
Stefan Metzmacher [Mon, 1 Feb 2016 22:04:04 +0000 (23:04 +0100)]
s4:dsdb/samldb: check for valid lDAPDisplayName vaues on add()

This still leaves modifies(), but that's a task for another day.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos4:dsdb/tests: don't use spaces in lDAPDisplayName in urgent_replication.py
Stefan Metzmacher [Mon, 1 Feb 2016 22:02:14 +0000 (23:02 +0100)]
s4:dsdb/tests: don't use spaces in lDAPDisplayName in urgent_replication.py

This should result in LDAP_UNWILLING_TO_PERFORM/WERR_DS_INVALID_LDAP_DISPLAY_NAME,
so better use a useful value without spaces.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos4:ldap_server: make sure we only have one tstream_read_pdu_blob_send() on a connection
Stefan Metzmacher [Thu, 23 Jul 2015 10:06:11 +0000 (12:06 +0200)]
s4:ldap_server: make sure we only have one tstream_read_pdu_blob_send() on a connection

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos4:libcli/ldap: add support for LDB_CONTROL_DIRSYNC_EX_OID
Stefan Metzmacher [Tue, 26 Jan 2016 08:37:13 +0000 (09:37 +0100)]
s4:libcli/ldap: add support for LDB_CONTROL_DIRSYNC_EX_OID

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoldb: version 1.1.26 samba-upstream/tags/ldb-1.1.26
Stefan Metzmacher [Tue, 2 Feb 2016 09:04:20 +0000 (10:04 +0100)]
ldb: version 1.1.26

* let a timeout of -1 indicate no timeout for a given request
* fix memory leaks in pyldb ldb.search()
* build fixes
* improve pyldb ldb.search() help message
* add pyldb ldb.search_iterator() api
* add LDB_ATTR_FLAG_FORCE_BASE64_LDIF as optional argument
  to ldb_schema_attribute_add()
* add client support for LDB_CONTROL_DIRSYNC_EX

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoldb: add support for LDB_CONTROL_DIRSYNC_EX
Stefan Metzmacher [Tue, 26 Jan 2016 08:36:56 +0000 (09:36 +0100)]
ldb: add support for LDB_CONTROL_DIRSYNC_EX

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoldb: add LDB_ATTR_FLAG_FORCE_BASE64_LDIF support
Stefan Metzmacher [Fri, 5 Feb 2016 12:55:31 +0000 (13:55 +0100)]
ldb: add LDB_ATTR_FLAG_FORCE_BASE64_LDIF support

This can be used to force ldb_write_ldif() to use base64 for
a specific attribute.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopyldb: eliminate warnings from python api test
Michael Adam [Sun, 14 Feb 2016 15:50:38 +0000 (16:50 +0100)]
pyldb: eliminate warnings from python api test

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopyldb: add api tests for search_iterator()
Stefan Metzmacher [Mon, 1 Feb 2016 01:30:56 +0000 (02:30 +0100)]
pyldb: add api tests for search_iterator()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopyldb: add ldb.search_iterator()
Stefan Metzmacher [Thu, 21 Jan 2016 23:06:45 +0000 (00:06 +0100)]
pyldb: add ldb.search_iterator()

This is able to handle async requests, e.g. with a notification control
and processes results as they arrive instead of waiting for all results
before returning.

search_handle = ldb.search_iterator(...)

for e in search_handle:
    if not isinstance(msg, ldb.Message):
        # referral
        continue

    name = e["name"][0]

result = search_handle.result()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopyldb: fix help message for ldb.search()
Stefan Metzmacher [Thu, 21 Jan 2016 23:06:04 +0000 (00:06 +0100)]
pyldb: fix help message for ldb.search()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopyldb: fix memory leak in py_ldb_search()
Stefan Metzmacher [Thu, 21 Jan 2016 23:05:09 +0000 (00:05 +0100)]
pyldb: fix memory leak in py_ldb_search()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopyldb: Free correct context when pyldb_Object_AsDn() fails
Andrew Bartlett [Tue, 5 Jan 2016 04:59:32 +0000 (17:59 +1300)]
pyldb: Free correct context when pyldb_Object_AsDn() fails

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoldb: allow a timeout of -1 result in no timeout timer at all.
Stefan Metzmacher [Fri, 22 Jan 2016 07:53:57 +0000 (08:53 +0100)]
ldb: allow a timeout of -1 result in no timeout timer at all.

This is required in order to have long running async searches,
e.g. with LDB_CONTROL_NOTIFICATION_OID.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoldb-samba: fix the timeout setup in ildb_request_send()
Stefan Metzmacher [Fri, 22 Jan 2016 07:53:57 +0000 (08:53 +0100)]
ldb-samba: fix the timeout setup in ildb_request_send()

We need to use the startime as reference not the current time.

We also allow timeout == -1 to indicate no timeout at all.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos4:libcli/ldap: send AbandonRequests for cancelled requests
Stefan Metzmacher [Mon, 1 Feb 2016 10:00:14 +0000 (11:00 +0100)]
s4:libcli/ldap: send AbandonRequests for cancelled requests

This happens on a local timeout of an talloc_free() of the request.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoFIXUP: s3: VFS: Modify SMB_VFS_GET_NT_ACL to take a const struct smb_filename *
Ralph Boehme [Sun, 14 Feb 2016 20:36:15 +0000 (21:36 +0100)]
FIXUP: s3: VFS: Modify SMB_VFS_GET_NT_ACL to take a const struct smb_filename *

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Feb 16 23:26:48 CET 2016 on sn-devel-144

3 years agos3: VFS: Modify SMB_VFS_GET_NT_ACL to take a const struct smb_filename * instead...
Jeremy Allison [Fri, 12 Feb 2016 18:30:10 +0000 (10:30 -0800)]
s3: VFS: Modify SMB_VFS_GET_NT_ACL to take a const struct smb_filename * instead of const char *

Bumps VFS version to 35.

Preparing to reduce use of lp_posix_pathnames().

Most of this is boilerplate, the only subtleties are in
the modules:

vfs_catia.c
vfs_media_harmony.c
vfs_shadow_copy2.c
vfs_unityed_media.c

Where the path is modified then passed to SMB_VFS_NEXT_GET_NT_ACL().
In these cases the change uses synthetic_smb_fname() to
create a new struct smb_filename from the modified path.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <rb@sernet.de>
3 years agotdb: eliminate deprecation warnings in python tests
Michael Adam [Mon, 15 Feb 2016 10:33:10 +0000 (11:33 +0100)]
tdb: eliminate deprecation warnings in python tests

assertEquals() is superseded by assertEqual()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Feb 16 19:58:39 CET 2016 on sn-devel-144

3 years agoctdb: Fix CID 1353175 Logically dead code
Volker Lendecke [Tue, 16 Feb 2016 10:20:56 +0000 (11:20 +0100)]
ctdb: Fix CID 1353175 Logically dead code

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agoctdb: Fix CID 1353176 Logically dead code
Volker Lendecke [Tue, 16 Feb 2016 10:18:40 +0000 (11:18 +0100)]
ctdb: Fix CID 1353176 Logically dead code

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agoidmap_ad: Fix a copy&paste error
Volker Lendecke [Mon, 8 Feb 2016 09:30:43 +0000 (10:30 +0100)]
idmap_ad: Fix a copy&paste error

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Feb 16 14:14:21 CET 2016 on sn-devel-144

3 years agocredentials: Fix a typo
Volker Lendecke [Sun, 7 Feb 2016 15:22:59 +0000 (16:22 +0100)]
credentials: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agocredentials: Fix whitespace
Volker Lendecke [Sun, 7 Feb 2016 15:22:05 +0000 (16:22 +0100)]
credentials: Fix whitespace

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agowinbind: Fix a type error
Volker Lendecke [Tue, 2 Feb 2016 13:41:16 +0000 (14:41 +0100)]
winbind: Fix a type error

nss_info_methods has "get_nss_info"'s p_gid parameter as
gid_t *, not uint32_t *. Probably that did not hurt due to
typedefs, but if we find a platform where gid_t is not
uint32_t, this would be VERY hard to debug

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agowinbind: Add some const
Volker Lendecke [Tue, 2 Feb 2016 13:21:32 +0000 (14:21 +0100)]
winbind: Add some const

This makes source and destination a bit clearer to me

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agobuild: Fix cluster-support option, default was 'None' now 'False'
Noel Power [Thu, 11 Feb 2016 16:02:24 +0000 (16:02 +0000)]
build: Fix cluster-support option, default was 'None' now 'False'

Cluster-support had some auto-detection but no longer does.

Prior to commit id(s) e67c4b977a52d1744f4da8296bbcd7c213cbe92a &
69c0c43d55c93b82b2e398d5c61009fd347170bf cluster support was auto
detected

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Tue Feb 16 04:03:14 CET 2016 on sn-devel-144

3 years agolibcli: Fix debug message, print sid string for new_ace trustee.
Noel Power [Thu, 11 Feb 2016 16:00:55 +0000 (16:00 +0000)]
libcli: Fix debug message, print sid string for new_ace trustee.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>