obnox/samba/samba-obnox.git
9 years agos3:winbindd: we only need a an netlogon connection to a rwdc if we're a rodc ourself
Stefan Metzmacher [Tue, 16 Dec 2014 23:17:52 +0000 (23:17 +0000)]
s3:winbindd: we only need a an netlogon connection to a rwdc if we're a rodc ourself

If we're a member or RWDC there's no need to require talking to a rwdc,
an rodc will forward the request if required.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agos3:winbindd: make sure we try to use NCACN_IP_TCP in cm_connect_netlogon
Stefan Metzmacher [Tue, 16 Dec 2014 23:17:52 +0000 (23:17 +0000)]
s3:winbindd: make sure we try to use NCACN_IP_TCP in cm_connect_netlogon

We need to call init_dc_connection_rpc() before we can decide if we want to try
NCACN_IP_TCP.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agos3:rpc_client: add cli_rpc_pipe_open_schannel_with_creds() helper function
Stefan Metzmacher [Wed, 17 Dec 2014 09:19:49 +0000 (09:19 +0000)]
s3:rpc_client: add cli_rpc_pipe_open_schannel_with_creds() helper function

This will simplify the callers and add potential support for SEC_CHAN_DNS_DOMAIN
as cli_credentials_get_realm() will return the correct value compared to
cli_credentials_get_domain().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agos3:cli_netlogon: add rpccli_{create,setup}_netlogon_creds_with_creds() helper functions
Stefan Metzmacher [Wed, 17 Dec 2014 08:40:49 +0000 (08:40 +0000)]
s3:cli_netlogon: add rpccli_{create,setup}_netlogon_creds_with_creds() helper functions

This simplifies the callers, then can just pass in a cli_credentials structure.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoauth/credentials: add cli_credentials_set_utf16_password()
Stefan Metzmacher [Tue, 16 Dec 2014 13:58:11 +0000 (13:58 +0000)]
auth/credentials: add cli_credentials_set_utf16_password()

We need a way to initialize the cli_credentials from the raw utf16 blob,
which might not be completely valid utf16, which means the conversion
from CH_UTF16MUNGED to CH_UTF8 might loose information.

This would result in an invalid nt_hash, when we convert back
from CH_UTF8 to CH_UTF16LE.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoauth/gensec: add support for SEC_CHAN_DNS_DOMAIN to schannel_update()
Stefan Metzmacher [Tue, 16 Dec 2014 21:49:05 +0000 (21:49 +0000)]
auth/gensec: add support for SEC_CHAN_DNS_DOMAIN to schannel_update()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoauth/gensec: make sure we keep a DCERPC_AUTH_TYPE_SCHANNEL backend if required
Stefan Metzmacher [Wed, 17 Dec 2014 18:42:55 +0000 (18:42 +0000)]
auth/gensec: make sure we keep a DCERPC_AUTH_TYPE_SCHANNEL backend if required

Even with CRED_MUST_USE_KERBEROS we should keep the DCERPC_AUTH_TYPE_SCHANNEL
backend arround, this can only be specified explicitely by the caller
and cli_credentials_get_netlogon_creds() != NULL is the strong indication
that the caller is using DCERPC_AUTH_TYPE_SCHANNEL *now*.

With trusts against AD domain we can reliable use kerberos and netlogon
secure channel for authentication.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agonsswitch/wbinfo: allow 'wbinfo --ping-dc --domain=SOMEDOMAIN'
Stefan Metzmacher [Wed, 10 Dec 2014 14:03:55 +0000 (14:03 +0000)]
nsswitch/wbinfo: allow 'wbinfo --ping-dc --domain=SOMEDOMAIN'

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agonsswitch: allow passing the domain name to wbcPingDC[2]()
Stefan Metzmacher [Wed, 10 Dec 2014 14:02:18 +0000 (14:02 +0000)]
nsswitch: allow passing the domain name to wbcPingDC[2]()

winbindd already supports this.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agos3:winbindd: use find_domain_from_name_noinit() in winbindd_ping_dc_send()
Stefan Metzmacher [Tue, 16 Dec 2014 11:27:21 +0000 (11:27 +0000)]
s3:winbindd: use find_domain_from_name_noinit() in winbindd_ping_dc_send()

We should not try to connect to the given domain from within the winbindd parent.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agos3:winbindd: report our own name for PING_DC and internal domains
Stefan Metzmacher [Wed, 10 Dec 2014 12:25:55 +0000 (12:25 +0000)]
s3:winbindd: report our own name for PING_DC and internal domains

This means "wbinfo --ping-dc" works fine on a DC.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agowafsamba: check for rpath compiler/linker flags
Ralph Boehme [Thu, 18 Dec 2014 05:37:28 +0000 (06:37 +0100)]
wafsamba: check for rpath compiler/linker flags

Older SunOS linker only support -Wl,-R,/path instead of -Wl,-rpath,/path.

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

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agowafsamba: fill PRIVATE_NAME() logic again
Stefan Metzmacher [Thu, 18 Dec 2014 14:05:12 +0000 (15:05 +0100)]
wafsamba: fill PRIVATE_NAME() logic again

We append bld.env.PRIVATE_EXTENSION to the name of private libraries
again, but only unless they have a abi_directory, vnum or soname defined.

This avoids naming conflicts with system libraries, e.g. libidmap.so
on Solaris

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agonsswitch: fix soname of linux nss_*.so.2 modules
Stefan Metzmacher [Thu, 18 Dec 2014 09:33:34 +0000 (10:33 +0100)]
nsswitch: fix soname of linux nss_*.so.2 modules

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agoselftest: use shared/libnss_wrapper_winbind.so.2
Stefan Metzmacher [Thu, 18 Dec 2014 19:13:44 +0000 (20:13 +0100)]
selftest: use shared/libnss_wrapper_winbind.so.2

This library is always available in make test.
nss-wrapper strictly requires the linux nss api.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agowafsamba: add optional keep_underscore=True to SAMBA_LIBRARY()
Stefan Metzmacher [Thu, 18 Dec 2014 09:21:30 +0000 (10:21 +0100)]
wafsamba: add optional keep_underscore=True to SAMBA_LIBRARY()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoctdb-daemon: Use correct tdb flags when enabling robust mutex support
Amitay Isaacs [Thu, 11 Dec 2014 02:16:47 +0000 (13:16 +1100)]
ctdb-daemon: Use correct tdb flags when enabling robust mutex support

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agotdb: version 1.3.4 save-diskspace-tags/tdb-1.3.4
Stefan Metzmacher [Fri, 12 Dec 2014 11:28:47 +0000 (12:28 +0100)]
tdb: version 1.3.4

Transactions are supported with TDB_MUTEX_LOCKING.

This fixes https://bugzilla.samba.org/show_bug.cgi?id=11004

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Fri Dec 19 11:41:26 CET 2014 on sn-devel-104

9 years agotdb/toos: allow transactions with TDB_MUTEX_LOCKING
Stefan Metzmacher [Fri, 12 Dec 2014 11:53:37 +0000 (12:53 +0100)]
tdb/toos: allow transactions with TDB_MUTEX_LOCKING

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agotdb/test: add tdb1-run-mutex-transaction1 test
Stefan Metzmacher [Fri, 12 Dec 2014 11:24:50 +0000 (12:24 +0100)]
tdb/test: add tdb1-run-mutex-transaction1 test

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agotdb: allow transactions on on tdb's with TDB_MUTEX_LOCKING
Stefan Metzmacher [Fri, 12 Dec 2014 10:22:47 +0000 (11:22 +0100)]
tdb: allow transactions on on tdb's with TDB_MUTEX_LOCKING

There's no real reason to disallow transactions as the
allrecord lock is also available with mutexes enabled.

E.g. ctdbd requires transactions also on non-persistent databases
opened with TDB_CLEAR_IF_FIRST and TDB_MUTEX_LOCKING.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agovfs_fruit: Avoid double ()
Volker Lendecke [Tue, 16 Dec 2014 08:38:54 +0000 (09:38 +0100)]
vfs_fruit: Avoid double ()

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): Thu Dec 18 19:19:04 CET 2014 on sn-devel-104

9 years agovfs_fruit: Avoid double initialization
Volker Lendecke [Tue, 16 Dec 2014 08:38:21 +0000 (09:38 +0100)]
vfs_fruit: Avoid double initialization

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 years agolib/texpect: prefer bsd/libutil.h if available
Stefan Metzmacher [Wed, 10 Dec 2014 12:23:04 +0000 (12:23 +0000)]
lib/texpect: prefer bsd/libutil.h if available

Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Thu Dec 18 16:31:48 CET 2014 on sn-devel-104

9 years agos4:heimdal_build: remove unused openpty check
Stefan Metzmacher [Thu, 18 Dec 2014 02:05:28 +0000 (02:05 +0000)]
s4:heimdal_build: remove unused openpty check

commit 638a8edd7ce708cf550c054ac16dade795b6448b removed
HEIMDAL_BINARY('rkpty', 'lib/roken/rkpty.c',...)
(the only heimdal user of openpty().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
9 years agolibcli-dns: Remove obsolete dns_host_file subsystem.
Andreas Schneider [Thu, 20 Nov 2014 10:37:35 +0000 (11:37 +0100)]
libcli-dns: Remove obsolete dns_host_file subsystem.

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Dec 18 09:09:38 CET 2014 on sn-devel-104

9 years agos3-libsmb: Remove obsolete support for dns_host_file.
Andreas Schneider [Thu, 20 Nov 2014 10:37:13 +0000 (11:37 +0100)]
s3-libsmb: Remove obsolete support for dns_host_file.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agos4-libcli: Remove obsolete support for file resolving.
Andreas Schneider [Thu, 20 Nov 2014 10:35:48 +0000 (11:35 +0100)]
s4-libcli: Remove obsolete support for file resolving.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoaddns: Remove support for dns_host_file.
Andreas Schneider [Thu, 20 Nov 2014 10:31:29 +0000 (11:31 +0100)]
addns: Remove support for dns_host_file.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoselftest: Use resolv_wrapper in the samba3 targets to join AD.
Andreas Schneider [Thu, 4 Sep 2014 12:33:05 +0000 (14:33 +0200)]
selftest: Use resolv_wrapper in the samba3 targets to join AD.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoselftest: Use resolv_wrapper in the samba4 target.
Andreas Schneider [Wed, 10 Sep 2014 09:00:28 +0000 (11:00 +0200)]
selftest: Use resolv_wrapper in the samba4 target.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoselftest: Always enable dns fakeing.
Andreas Schneider [Thu, 20 Nov 2014 09:48:47 +0000 (10:48 +0100)]
selftest: Always enable dns fakeing.

FIXME: This should be removed once we fixed adding records to the DNS
server using nsupdate!

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoselftest: Define if we should fake dns resolving.
Andreas Schneider [Mon, 3 Nov 2014 12:22:38 +0000 (13:22 +0100)]
selftest: Define if we should fake dns resolving.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agosamba_dnsupdate: Allow the tool to work in 'make test'.
Andreas Schneider [Thu, 11 Sep 2014 08:59:20 +0000 (10:59 +0200)]
samba_dnsupdate: Allow the tool to work in 'make test'.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agosamba_dnsupdate: Always fill out the nameservers of a dns object.
Andreas Schneider [Tue, 7 Oct 2014 13:35:34 +0000 (15:35 +0200)]
samba_dnsupdate: Always fill out the nameservers of a dns object.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoselftest: Wait for the logon server to register to join the member.
Andreas Schneider [Tue, 9 Sep 2014 07:47:05 +0000 (09:47 +0200)]
selftest: Wait for the logon server to register to join the member.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agonmblookup: Return if the lookup was successful or not.
Andreas Schneider [Tue, 9 Sep 2014 07:45:51 +0000 (09:45 +0200)]
nmblookup: Return if the lookup was successful or not.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Jeremy Allison <jra@samba.org>

9 years agoselftest: Print better DC provisioning info.
Andreas Schneider [Wed, 10 Sep 2014 10:23:38 +0000 (12:23 +0200)]
selftest: Print better DC provisioning info.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoselftest: Also pass the IPv6 address for the KDC around.
Andreas Schneider [Wed, 10 Sep 2014 08:59:39 +0000 (10:59 +0200)]
selftest: Also pass the IPv6 address for the KDC around.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoselftest: Preload resolv_wrapper in selftest.
Andreas Schneider [Wed, 3 Sep 2014 15:16:36 +0000 (17:16 +0200)]
selftest: Preload resolv_wrapper in selftest.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agos3:winbindd: try to use the trust account with kerberos if possible
Stefan Metzmacher [Tue, 16 Dec 2014 09:05:39 +0000 (09:05 +0000)]
s3:winbindd: try to use the trust account with kerberos if possible

This trust account is usable for SMB authentication via kerberos,
so we should try that if we think the domain is active directory.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agos3:winbindd: fix anon fallback in cm_prepare_connection()
Stefan Metzmacher [Tue, 16 Dec 2014 11:28:41 +0000 (11:28 +0000)]
s3:winbindd: fix anon fallback in cm_prepare_connection()

We should not crash with machine_password==NULL.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agos3:winbindd: also try to fallback to anonymous if we get NT_STATUS_INVALID_ACCOUNT_NAME
Stefan Metzmacher [Thu, 18 Dec 2014 01:20:29 +0000 (01:20 +0000)]
s3:winbindd: also try to fallback to anonymous if we get NT_STATUS_INVALID_ACCOUNT_NAME

Kerberos authentication may return NT_STATUS_INVALID_ACCOUNT_NAME (PRINCIPAL_UNKNOWN)

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agos3:libsmb: let cli_session_setup_kerberos_recv() return a useful error code
Stefan Metzmacher [Tue, 16 Dec 2014 09:45:15 +0000 (09:45 +0000)]
s3:libsmb: let cli_session_setup_kerberos_recv() return a useful error code

Forcing NT_STATUS_UNSUCCESSFUL is not a good idea, we should return
NT_STATUS_LOGON_FAILURE instead.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agos3:passdb: let pdb_get_trust_credentials() try pdb_get_trusteddom_creds() first
Stefan Metzmacher [Tue, 16 Dec 2014 15:05:17 +0000 (15:05 +0000)]
s3:passdb: let pdb_get_trust_credentials() try pdb_get_trusteddom_creds() first

NT_STATUS_NOT_IMPLEMENTED lets it fallback to the old get_trust_pw_clear2()
code.

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

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): Thu Dec 18 06:46:05 CET 2014 on sn-devel-104

9 years agos3:passdb: add optional get_trusteddom_creds() hooks
Stefan Metzmacher [Thu, 11 Dec 2014 10:52:53 +0000 (10:52 +0000)]
s3:passdb: add optional get_trusteddom_creds() hooks

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agopdb: fix build issues with shared modules
Garming Sam [Wed, 3 Dec 2014 21:44:26 +0000 (10:44 +1300)]
pdb: fix build issues with shared modules

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

Change-Id: I26e78b56ead0c66afcda6b3fb8b1fd09130b24a5
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
9 years agos3:locking: fix uninitialiazed variable in brl_get_locks_readonly_parser()
Stefan Metzmacher [Wed, 17 Dec 2014 09:43:33 +0000 (10:43 +0100)]
s3:locking: fix uninitialiazed variable in brl_get_locks_readonly_parser()

In a cluster this can be called with an empty record, while
brl_parse_data() relies on an initialized structure.

This is a regression in commit 837e29035c911f3509135252c3f423d0f56b606d.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agotorture: improve rpc.remote_pac test so we check if LogonSamLogon actually succeeds
Andrew Bartlett [Tue, 16 Dec 2014 05:07:44 +0000 (18:07 +1300)]
torture: improve rpc.remote_pac test so we check if LogonSamLogon actually succeeds

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Dec 18 02:51:02 CET 2014 on sn-devel-104

9 years agotorture: Improve winbindd.pac test to check multiple GENSEC mechanims
Andrew Bartlett [Tue, 16 Dec 2014 04:19:55 +0000 (17:19 +1300)]
torture: Improve winbindd.pac test to check multiple GENSEC mechanims

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>

9 years agogensec_krb5: Match behaviour of gensec_gssapi for password-based keytabs
Andrew Bartlett [Wed, 17 Dec 2014 22:03:44 +0000 (11:03 +1300)]
gensec_krb5: Match behaviour of gensec_gssapi for password-based keytabs

This allows the winbind.pac.krb5 test to pass against the s3member environment, which uses the password from secrets.tdb.

Andrew Bartlett

Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
9 years agotest: improve kinit kerberos tests
Garming Sam [Tue, 16 Dec 2014 01:54:14 +0000 (14:54 +1300)]
test: improve kinit kerberos tests

For enterprise and windows style kinit, a UPN is now configured.

There are now additional smbclient calls and added cache removals
to make the tests more robust.

Change-Id: I7c58ae4c9f303ca74a52878aa5dce2cc5f7d6742
Pair-programmed-with: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
9 years agoautobuild: adapt a comment
Michael Adam [Sat, 6 Dec 2014 02:01:53 +0000 (03:01 +0100)]
autobuild: adapt a comment

The configure-option --with-cluster-support now only builds
against the included ctdb, and it also builds the ctdb component.
The comment in autobuild.py this patch changes was still from the olden days...

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Dec 17 21:13:44 CET 2014 on sn-devel-104

9 years agovfs/glusterfs: Change xattr key to match gluster key.
raghavendra talur [Wed, 10 Dec 2014 15:45:03 +0000 (21:15 +0530)]
vfs/glusterfs: Change xattr key to match gluster key.

Gluster changed the key used to do get_real_filename
in 3.5. This changes Samba's glusterfs vfs-module
to use the same key.

This will render SMB_VFS_GET_REALFILENAME() working
again under 3.5 and will remove support for that functionality
for Gluster 3.4 and older.

Signed-off-by: raghavendra talur <raghavendra.talur@gmail.com>
Reviewed-by: Ira Cooper <ira@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agovfs_glusterfs: Implement AIO support
Poornima G [Thu, 11 Dec 2014 02:05:10 +0000 (07:35 +0530)]
vfs_glusterfs: Implement AIO support

Signed-off-by: Poornima G <pgurusid@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Dec 17 16:35:37 CET 2014 on sn-devel-104

9 years agovfs_glusterfs: Change sys_get_acl_file/fd to return ACLs corresponding to mode bits...
Poornima G [Fri, 12 Dec 2014 13:11:49 +0000 (14:11 +0100)]
vfs_glusterfs: Change sys_get_acl_file/fd to return ACLs corresponding to mode bits when there are no ACLs set.

Signed-off-by: Poornima G <pgurusid@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoscript/autobuild.py: use --picky-developer for the samba-ctdb target
Stefan Metzmacher [Mon, 8 Dec 2014 09:30:56 +0000 (10:30 +0100)]
script/autobuild.py: use --picky-developer for the samba-ctdb target

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Wed Dec 17 11:52:25 CET 2014 on sn-devel-104

9 years agos3:lib: fix allocation check in messages_ctdbd.c
Stefan Metzmacher [Wed, 10 Dec 2014 22:00:43 +0000 (23:00 +0100)]
s3:lib: fix allocation check in messages_ctdbd.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb/server: add format string checking to ctdb_tevent_logging()
Stefan Metzmacher [Mon, 15 Dec 2014 13:54:18 +0000 (14:54 +0100)]
ctdb/server: add format string checking to ctdb_tevent_logging()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agolib/util: provide a dbgtext_va() function which takes va_list
Stefan Metzmacher [Tue, 16 Dec 2014 10:30:53 +0000 (11:30 +0100)]
lib/util: provide a dbgtext_va() function which takes va_list

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agonotify: Move path construction to notify_trigger
Volker Lendecke [Thu, 2 Jan 2014 16:54:53 +0000 (17:54 +0100)]
notify: Move path construction to notify_trigger

notify_msg won't need to construct the path anymore, it will be able to
put the parts into iovecs

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Dec 16 21:22:26 CET 2014 on sn-devel-104

9 years agolib: Add ctdbd_messaging_send to ctdb_dummy.c
Volker Lendecke [Wed, 12 Nov 2014 10:08:36 +0000 (10:08 +0000)]
lib: Add ctdbd_messaging_send to ctdb_dummy.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agomessaging3: Add messaging_handler_send/recv
Volker Lendecke [Thu, 13 Nov 2014 11:25:40 +0000 (11:25 +0000)]
messaging3: Add messaging_handler_send/recv

This repeatedly listens on msg_type. It's similar to messaging_register
with talloc based autocleanup. The handler is free to talloc_move a way
the record for later use.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agomessaging3: Add messaging_send_iov_from
Volker Lendecke [Wed, 12 Nov 2014 15:42:59 +0000 (16:42 +0100)]
messaging3: Add messaging_send_iov_from

In the notifyd code it will be very helpful to fake source server_ids

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agomessaging3: Add messaging_names_db
Volker Lendecke [Fri, 17 Oct 2014 12:09:03 +0000 (12:09 +0000)]
messaging3: Add messaging_names_db

This will enable messaging3 users to more easily register themselves
under a name

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agodbwrap: Add code to marshall a db_context's db
Volker Lendecke [Wed, 5 Nov 2014 13:02:38 +0000 (13:02 +0000)]
dbwrap: Add code to marshall a db_context's db

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolib: Add server_id_db
Volker Lendecke [Wed, 15 Oct 2014 16:14:42 +0000 (16:14 +0000)]
lib: Add server_id_db

This is a mapping from names to server_ids. In the future, this will
replace the namedb in source4/messaging.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolib: Add "strv" string handling routines
Volker Lendecke [Wed, 15 Oct 2014 13:26:51 +0000 (13:26 +0000)]
lib: Add "strv" string handling routines

This is a little set of routines designed after the glibc argz
routines. It is supposed to eventually replace our inefficient string_list
routines. A talloc blob is an array of strings separated by the \0
character. See argz(3) on a Linux system for the ideas where this came
from. Based on talloc strv is simpler because talloc knows about the
size of the blob, so we don't have to explicitly maintain it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolib: Add tdb_fetch_talloc
Volker Lendecke [Tue, 21 Oct 2014 10:39:53 +0000 (10:39 +0000)]
lib: Add tdb_fetch_talloc

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolib: Add map_unix_error_from_tdb
Volker Lendecke [Sun, 14 Sep 2014 11:10:58 +0000 (13:10 +0200)]
lib: Add map_unix_error_from_tdb

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agosmbstatus: Tell the user that smbstatus can only be run as root.
Andreas Schneider [Tue, 16 Dec 2014 14:52:43 +0000 (15:52 +0100)]
smbstatus: Tell the user that smbstatus can only be run as root.

In the meantime smbstatus tries to collection information from tdb's
which are only accessible by root as they contain sensitive information
like session keys and other secrets. This means smbstatus can no longer
be executed as a user.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Dec 16 18:54:41 CET 2014 on sn-devel-104

9 years agoRevert "script/autobuild.py: build the samba target with --with-profiling-data"
Stefan Metzmacher [Tue, 16 Dec 2014 07:52:54 +0000 (08:52 +0100)]
Revert "script/autobuild.py: build the samba target with --with-profiling-data"

This reverts commit 4958fcdfa30fd9d8dc51ceafaab35721e61e72c7.

This only works for a single user on a system, as only one can create
the sysv shared memory segment.

In future we'll use a tdb instead of sysv shared memory,
then we can readd this.

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): Tue Dec 16 11:25:47 CET 2014 on sn-devel-104

9 years agoscript/autobuild.py: build the samba target with --with-profiling-data
Stefan Metzmacher [Mon, 8 Dec 2014 09:30:56 +0000 (10:30 +0100)]
script/autobuild.py: build the samba target with --with-profiling-data

In future we may get also runtime tests for profiling...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Dec 15 16:20:14 CET 2014 on sn-devel-104

9 years agoctdb-build: fix build without xsltproc
Björn Baumbach [Mon, 1 Dec 2014 12:28:13 +0000 (13:28 +0100)]
ctdb-build: fix build without xsltproc

Check for XSLTPROC_MANPAGES before trying to build the docs.

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agopackaging: Include CTDB man pages in the tarball
Amitay Isaacs [Sun, 14 Dec 2014 13:07:33 +0000 (00:07 +1100)]
packaging: Include CTDB man pages in the tarball

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoctdb-build: Fix the installation of config files for top-level build
Amitay Isaacs [Mon, 15 Dec 2014 10:15:24 +0000 (21:15 +1100)]
ctdb-build: Fix the installation of config files for top-level build

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoctdb-build: Fix the indentation
Amitay Isaacs [Mon, 15 Dec 2014 10:14:44 +0000 (21:14 +1100)]
ctdb-build: Fix the indentation

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agolibcli/smb: only force signing of smb2 session setups when binding a new session
Stefan Metzmacher [Fri, 12 Dec 2014 13:55:38 +0000 (13:55 +0000)]
libcli/smb: only force signing of smb2 session setups when binding a new session

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

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 Dec 12 23:11:40 CET 2014 on sn-devel-104

9 years agos3:smb2_server: allow reauthentication without signing
Stefan Metzmacher [Fri, 12 Dec 2014 08:22:15 +0000 (09:22 +0100)]
s3:smb2_server: allow reauthentication without signing

If signing is not required we should not require it for reauthentication.
Windows clients would otherwise fail to reauthenticate.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolibsmb: Simplify netsamlogon_cache_get
Volker Lendecke [Fri, 12 Dec 2014 10:44:06 +0000 (11:44 +0100)]
libsmb: Simplify netsamlogon_cache_get

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolibsmb: Only print decoded netsamlogon cache entries
Volker Lendecke [Fri, 12 Dec 2014 10:41:14 +0000 (11:41 +0100)]
libsmb: Only print decoded netsamlogon cache entries

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolibsmb: Fix removing invalid samlogon cache entries
Volker Lendecke [Fri, 12 Dec 2014 10:39:25 +0000 (11:39 +0100)]
libsmb: Fix removing invalid samlogon cache entries

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agotestprogs/test_ldb: check rootdse search with extended-dn control
Stefan Metzmacher [Fri, 21 Nov 2014 13:11:54 +0000 (14:11 +0100)]
testprogs/test_ldb: check rootdse search with extended-dn control

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Dec 12 20:15:46 CET 2014 on sn-devel-104

9 years agos4:dsdb/rootdse: expand extended dn values with the AS_SYSTEM control
Stefan Metzmacher [Thu, 20 Nov 2014 13:21:06 +0000 (14:21 +0100)]
s4:dsdb/rootdse: expand extended dn values with the AS_SYSTEM control

Otherwise we can't find the GUID of the 'serverName' attribute
as ANONYMOUS.

This results in

  root@ub1204-161:~# ldbsearch -U% -H ldap://172.31.9.161 -b '' -s base --extended-dn serverName
  search error - LDAP error 1 LDAP_OPERATIONS_ERROR -  <00002020: operations error at ../source4/dsdb/samdb/ldb_modules/rootdse.c:567> <>

While it works as system:

  root@ub1204-161:~# ldbsearch -U% -H /var/lib/samba/private/sam.ldb -b '' -s base --extended-dn serverName
  # record 1
  dn:
  serverName: <GUID=348c35e1-04e3-4988-a32c-32478d584551>;CN=UB1204-161,CN=Serve
   rs,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=s4xdom,DC=base

  # returned 1 records
  # 1 entries
  # 0 referrals

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
9 years agolib/util: Fix incorrect month in timestamps
Martin Schwenke [Thu, 11 Dec 2014 23:57:37 +0000 (10:57 +1100)]
lib/util: Fix incorrect month in timestamps

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

Reported-by: Youzhong Yang <Youzhong.Yang@mathworks.com>
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): Fri Dec 12 05:02:32 CET 2014 on sn-devel-104

9 years agovfs_streams_xattr: add missing call to SMB_VFS_NEXT_CONNECT
Ralph Boehme [Thu, 11 Dec 2014 18:06:11 +0000 (19:06 +0100)]
vfs_streams_xattr: add missing call to SMB_VFS_NEXT_CONNECT

Signed-off-by: Ralph Boehme <slow@samba.org>
Rewviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Dec 12 02:09:24 CET 2014 on sn-devel-104

9 years agoselftest: Add test for joining a Samba classic DC as a BDC
Andrew Bartlett [Wed, 22 Oct 2014 23:38:15 +0000 (12:38 +1300)]
selftest: Add test for joining a Samba classic DC as a BDC

This does not join the DC itself, so as not to pertrub the test
environment mid-run, but does confirm that the join works and the
password can be changed.

Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Dec 11 21:40:27 CET 2014 on sn-devel-104

9 years agolibsmb: Allow change of BDC trust account password
Andrew Bartlett [Wed, 22 Oct 2014 23:28:48 +0000 (12:28 +1300)]
libsmb: Allow change of BDC trust account password

This account is otherwise just like the workstation trust acocunt, so use that code.

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

Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agoauth: Allow domain join to itself when we are a PDC
Andrew Bartlett [Wed, 11 Dec 2013 02:39:38 +0000 (15:39 +1300)]
auth: Allow domain join to itself when we are a PDC

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agoselftest: Add 'net dom join' test which fails cause we are a DC
Andreas Schneider [Thu, 11 Dec 2014 15:41:55 +0000 (16:41 +0100)]
selftest: Add 'net dom join' test which fails cause we are a DC

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
9 years agonetapi: Move DC check to NetJoinDomain() where it is needed.
Andrew Bartlett [Wed, 11 Dec 2013 01:59:20 +0000 (14:59 +1300)]
netapi: Move DC check to NetJoinDomain() where it is needed.

This partially reverts 15f6e27bd5a9065c8b781fa21f5989ce2c355776.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agovfs_glusterfs: Set connectpath as snapdir-entry-path.
raghavendra talur [Wed, 10 Dec 2014 07:00:10 +0000 (12:30 +0530)]
vfs_glusterfs: Set connectpath as snapdir-entry-path.

snapview client in gluster would require connectpath
in order add snapdir entry to readdir result.

Signed-off-by: raghavendra talur <raghavendra.talur@gmail.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Dec 10 16:38:27 CET 2014 on sn-devel-104

9 years agovfs_glusterfs: Remember the connect path too for reopening.
raghavendra talur [Wed, 10 Dec 2014 06:56:34 +0000 (12:26 +0530)]
vfs_glusterfs: Remember the connect path too for reopening.

As Samba allows us to share subdirs, lets re-use preopened
connections to glusterfs only if they are for same volume
AND same connectpath.

Signed-off-by: raghavendra talur <raghavendra.talur@gmail.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agovfs_glusterfs: In vfs_gluster_sys_acl_get_file/fd, reduce the number of getxattr...
Poornima G [Thu, 30 Oct 2014 11:44:51 +0000 (17:14 +0530)]
vfs_glusterfs: In vfs_gluster_sys_acl_get_file/fd, reduce the number of getxattr calls.

Signed-off-by: Poornima G <pgurusid@redhat.com>
Reviewed-by: Ira Cooper <ira@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
9 years agotorture: Fix raw.open.chained-ntcreatex
Volker Lendecke [Thu, 27 Nov 2014 20:44:18 +0000 (21:44 +0100)]
torture: Fix raw.open.chained-ntcreatex

sizeof(buf) is 5. On FreeBSD10/clang this overwrites "ret". Not good.

Same as 574750777a

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Dec  9 19:43:31 CET 2014 on sn-devel-104

9 years agonotify_inotify: Simplify inotify_dispatch
Volker Lendecke [Thu, 4 Dec 2014 16:01:17 +0000 (16:01 +0000)]
notify_inotify: Simplify inotify_dispatch

Normally, I'm trying to simplify things with early returns. But in
this case I think the reverse makes the if-condition easier to
understand

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Dec  9 06:37:24 CET 2014 on sn-devel-104

9 years agosmbd: Compile notify_inotify only if available
Volker Lendecke [Tue, 18 Nov 2014 11:28:20 +0000 (11:28 +0000)]
smbd: Compile notify_inotify only if available

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agonotify_inotify: inotify_watch now takes a mem_ctx
Volker Lendecke [Wed, 5 Nov 2014 12:18:31 +0000 (12:18 +0000)]
notify_inotify: inotify_watch now takes a mem_ctx

This will make it easier to integrate into proper memory hierarchies.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agonotify: Add "dir" to notify_event
Volker Lendecke [Wed, 5 Nov 2014 11:44:42 +0000 (11:44 +0000)]
notify: Add "dir" to notify_event

"notify_event" only reports names relative to some path that is only
implicitly known via "private_data". Right now "private_data" is the fsp
of the directory holding this notify. I want to use inotify_watch in a
notify-daemon that does not have a fsp available and has more problems
getting the path right out of "private_data". notify_inotify has the
directory under which the event happened available, so make it known to
the callback. Right now no caller uses it yet.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agonotify_inotify: Make inotify_watch return 0/errno
Volker Lendecke [Mon, 27 Oct 2014 13:26:35 +0000 (13:26 +0000)]
notify_inotify: Make inotify_watch return 0/errno

More like a cleanup, but I want to use inotify_watch in notifyd
that I would like to keep as light as possible

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>