metze/samba/wip.git
6 years agos2-rpc-server: fix enum type in assignment
Uri Simchoni [Sun, 19 Nov 2017 16:51:30 +0000 (16:51 +0000)]
s2-rpc-server: fix enum type in assignment

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos4-lib-policy: fix type of enum
Uri Simchoni [Sun, 19 Nov 2017 17:56:50 +0000 (17:56 +0000)]
s4-lib-policy: fix type of enum

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos4-torture: get rid of extra parentheses
Uri Simchoni [Sun, 19 Nov 2017 17:55:14 +0000 (17:55 +0000)]
s4-torture: get rid of extra parentheses

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos4-torture: fix file time checks
Uri Simchoni [Sun, 19 Nov 2017 17:13:26 +0000 (17:13 +0000)]
s4-torture: fix file time checks

NTTIME is an unsigned quantity. When comparing two
of them, first calculate a signed difference, then
take absolute value.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agodns server: fix warning about enum mismatch
Uri Simchoni [Sun, 19 Nov 2017 16:49:46 +0000 (16:49 +0000)]
dns server: fix warning about enum mismatch

Fix picky developer clang warning about assignment
of an enum value to a variable of a different enum type.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoldb-samba: use ldap enum instead of ldb enum
Uri Simchoni [Sun, 19 Nov 2017 13:02:56 +0000 (13:02 +0000)]
ldb-samba: use ldap enum instead of ldb enum

This silences a picky compiler warning.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agolibrpc-build: ignore unused functions in generated code
Uri Simchoni [Sun, 19 Nov 2017 11:34:01 +0000 (11:34 +0000)]
librpc-build: ignore unused functions in generated code

Some pidl-generated code includes static functions that are
to be optimized-away by the compiler if not used. When
running picky developer with clang that breaks the build. This
change ignores this warning for the pidl-generated python binding
files.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agobuild: detect availability of -Wno-unused-function
Uri Simchoni [Sun, 19 Nov 2017 11:33:03 +0000 (11:33 +0000)]
build: detect availability of -Wno-unused-function

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agobuild: allow adding cflags to end of python module build command
Uri Simchoni [Sun, 19 Nov 2017 11:32:16 +0000 (11:32 +0000)]
build: allow adding cflags to end of python module build command

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agobuild: allow passing custom cflags to end of library build
Uri Simchoni [Sun, 19 Nov 2017 11:30:56 +0000 (11:30 +0000)]
build: allow passing custom cflags to end of library build

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoldb: silence some clang warnings in picky developer mode
Uri Simchoni [Sun, 19 Nov 2017 07:19:03 +0000 (07:19 +0000)]
ldb: silence some clang warnings in picky developer mode

Avoid const in casting since it doesn't increase code
safety in this case and causes clang to generate const-qual
warning. Also initialize a pointer to NULL to silence clang
uninitialized variable warning.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agolib/crypto: remove unused code
Uri Simchoni [Sun, 19 Nov 2017 07:02:12 +0000 (07:02 +0000)]
lib/crypto: remove unused code

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agotorture: remove spurious semicolon
Uri Simchoni [Sun, 19 Nov 2017 05:20:57 +0000 (05:20 +0000)]
torture: remove spurious semicolon

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agonfs4acl: fix picky build in case rpc/xdr.h is not available
Uri Simchoni [Sun, 19 Nov 2017 05:18:03 +0000 (05:18 +0000)]
nfs4acl: fix picky build in case rpc/xdr.h is not available

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agolibgpo: Fix CID 1422263 Resource leak
Volker Lendecke [Tue, 21 Nov 2017 19:41:47 +0000 (20:41 +0100)]
libgpo: Fix CID 1422263 Resource leak

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): Wed Nov 22 02:03:17 CET 2017 on sn-devel-144

6 years agolibgpo: Fix CID 1422262 Explicit null dereferenced
Volker Lendecke [Tue, 21 Nov 2017 19:30:08 +0000 (20:30 +0100)]
libgpo: Fix CID 1422262 Explicit null dereferenced

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agos3: smbd: Chain code can return uninitialized memory when talloc buffer is grown.
Jeremy Allison [Wed, 20 Sep 2017 18:04:50 +0000 (11:04 -0700)]
s3: smbd: Chain code can return uninitialized memory when talloc buffer is grown.

Ensure we zero out unused grown area.

CVE-2017-15275

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(master): Tue Nov 21 19:42:22 CET 2017 on sn-devel-144

6 years agos3: smbd: Fix SMB1 use-after-free crash bug. CVE-2017-14746
Jeremy Allison [Tue, 19 Sep 2017 23:11:33 +0000 (16:11 -0700)]
s3: smbd: Fix SMB1 use-after-free crash bug. CVE-2017-14746

When setting up the chain, always use 'next->' variables
not the 'req->' one.

Bug discovered by 连一汉 <lianyihan@360.cn>

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

Signed-off-by: Jeremy Allison <jra@samba.org>
6 years agodocs: Fix the "aio r/w size" smb.conf entries
Volker Lendecke [Mon, 20 Nov 2017 16:18:44 +0000 (17:18 +0100)]
docs: Fix the "aio r/w size" smb.conf entries

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Nov 21 15:45:20 CET 2017 on sn-devel-144

6 years agoctdb-common: Add async version of shutdown in sock_daemon
Amitay Isaacs [Fri, 17 Nov 2017 01:38:47 +0000 (12:38 +1100)]
ctdb-common: Add async version of shutdown in sock_daemon

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Tue Nov 21 08:58:45 CET 2017 on sn-devel-144

6 years agoctdb-common: Add async version of reconfigure in sock_daemon
Amitay Isaacs [Fri, 17 Nov 2017 01:38:18 +0000 (12:38 +1100)]
ctdb-common: Add async version of reconfigure in sock_daemon

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
6 years agoctdb-common: Add async version of startup in sock_daemon
Amitay Isaacs [Fri, 17 Nov 2017 01:36:29 +0000 (12:36 +1100)]
ctdb-common: Add async version of startup in sock_daemon

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
6 years agoctdb-tests: Create sock_daemon_funcs per test
Amitay Isaacs [Fri, 17 Nov 2017 02:11:12 +0000 (13:11 +1100)]
ctdb-tests: Create sock_daemon_funcs per test

This avoids defining sock_daemon functions that are not needed in the test.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
6 years agoctdb-common: Handle errors on unexpected socket close in sock_daemon
Amitay Isaacs [Fri, 17 Nov 2017 01:31:16 +0000 (12:31 +1100)]
ctdb-common: Handle errors on unexpected socket close in sock_daemon

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
6 years agoctdb-common: Start listening to sockets only on successful startup
Amitay Isaacs [Fri, 10 Nov 2017 01:15:45 +0000 (12:15 +1100)]
ctdb-common: Start listening to sockets only on successful startup

Fix tests to use wait_send() instead of startup() as a synchronization
point to ensure that the socket is listening.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
6 years agoctdb-common: Start wait computation only after successful startup
Amitay Isaacs [Thu, 16 Nov 2017 23:52:57 +0000 (10:52 +1100)]
ctdb-common: Start wait computation only after successful startup

This orders the startup events in sock_daemon code.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
6 years agoctdb-common: Return status from sock_daemon startup()/reconfigure()
Amitay Isaacs [Fri, 10 Nov 2017 01:10:05 +0000 (12:10 +1100)]
ctdb-common: Return status from sock_daemon startup()/reconfigure()

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
6 years agoctdb-common: Do not use sock->req outside sock_socket functions
Amitay Isaacs [Mon, 20 Nov 2017 00:52:55 +0000 (11:52 +1100)]
ctdb-common: Do not use sock->req outside sock_socket functions

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
6 years agoctdb-common: Call missing tevent_wakeup_recv() in sock_daemon
Amitay Isaacs [Fri, 10 Nov 2017 01:18:01 +0000 (12:18 +1100)]
ctdb-common: Call missing tevent_wakeup_recv() in sock_daemon

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
6 years agoctdb-daemon: Allocate deferred calls off calling context
Amitay Isaacs [Thu, 19 Oct 2017 03:58:18 +0000 (14:58 +1100)]
ctdb-daemon: Allocate deferred calls off calling context

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

This makes sure that if a client disconnects, all the deferred calls
from the client are correctly freed.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
6 years agos3: utils: net. Fix return paths that don't free talloc stackframe.
Jeremy Allison [Tue, 21 Nov 2017 00:09:39 +0000 (00:09 +0000)]
s3: utils: net. Fix return paths that don't free talloc stackframe.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
6 years agoFix formating of sources to be less than 80 lines
Garming Sam [Sun, 19 Nov 2017 21:28:33 +0000 (10:28 +1300)]
Fix formating of sources to be less than 80 lines

Signed-off-by: David Mulder <dmulder@suse.com>
Signed-off-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): Tue Nov 21 01:51:59 CET 2017 on sn-devel-144

6 years agopython: Convert gop.GROUP_POLICY_OBJECT to pytalloc
Andrew Bartlett [Tue, 24 Oct 2017 03:48:13 +0000 (16:48 +1300)]
python: Convert gop.GROUP_POLICY_OBJECT to pytalloc

This avoids PyCapsule calls not available in Python 2.6

We remove the __init__ function as it is useless, the
object is created by py_ads_get_gpo_list() which now
returns a python list rather than an iterator.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
6 years agopython: Remove talloc_stackframe() held in an object
Andrew Bartlett [Tue, 24 Oct 2017 04:24:38 +0000 (17:24 +1300)]
python: Remove talloc_stackframe() held in an object

talloc_stackframe() must not be held after the return from a function.

If this causes warnings (talloc_tos() use without a stackframe), this
must be fixed in each function.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
6 years agolibgpo: Setup the stack frame in ads_connect
David Mulder [Tue, 7 Nov 2017 17:41:05 +0000 (10:41 -0700)]
libgpo: Setup the stack frame in ads_connect

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoUse talloc_stackframe() not talloc_tos() in namequery.c
Andrew Bartlett [Thu, 26 Oct 2017 03:06:27 +0000 (16:06 +1300)]
Use talloc_stackframe() not talloc_tos() in namequery.c

The pygpo code calls these functions but there was not stackframe set up so
tallos_tos() fails.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
6 years agopython: Remove Python 2.4 compat macro
Andrew Bartlett [Tue, 24 Oct 2017 03:46:19 +0000 (16:46 +1300)]
python: Remove Python 2.4 compat macro

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
6 years agopython: Use py_check_dcerpc_type() to safely check for credentials
Andrew Bartlett [Tue, 24 Oct 2017 03:40:02 +0000 (16:40 +1300)]
python: Use py_check_dcerpc_type() to safely check for credentials

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
6 years agogpoupdate: Move closer to 80 columns
Andrew Bartlett [Tue, 24 Oct 2017 03:09:17 +0000 (16:09 +1300)]
gpoupdate: Move closer to 80 columns

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
6 years agopython: This function converts days to a relative (ie negative) NTTIME
Andrew Bartlett [Tue, 24 Oct 2017 02:59:37 +0000 (15:59 +1300)]
python: This function converts days to a relative (ie negative) NTTIME

It is not nttime2unix as it claimed.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
6 years agopygpo: Check for errors in gpo.gpo_get_sysvol_gpt_version()
Andrew Bartlett [Tue, 24 Oct 2017 02:58:45 +0000 (15:58 +1300)]
pygpo: Check for errors in gpo.gpo_get_sysvol_gpt_version()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
6 years agodoc: Add samba_gpoupdate man page, update WHATSNEW
David Mulder [Mon, 10 Jul 2017 19:57:21 +0000 (13:57 -0600)]
doc: Add samba_gpoupdate man page, update WHATSNEW

Signed-off-by: David Mulder <dmulder@suse.com>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
6 years agogpo: Apply kerberos settings
David Mulder [Wed, 9 Aug 2017 17:30:00 +0000 (11:30 -0600)]
gpo: Apply kerberos settings

Add kdc kerberos settings to gpo.tdb, then retrieve those settings in
lpcfg_default_kdc_policy.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agogpo: Always enforce policy, even if unchanged
David Mulder [Mon, 12 Jun 2017 22:00:38 +0000 (16:00 -0600)]
gpo: Always enforce policy, even if unchanged

Policies should always be enforced, even if the gpo hasn't changed.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agogpo: Add GPO unapply
David Mulder [Thu, 8 Jun 2017 17:47:57 +0000 (11:47 -0600)]
gpo: Add GPO unapply

Keep a log of applied settings, and add an option to samba_gpoupdate to allow unapply. An unapply will revert settings to a state prior to any policy application.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agogpo: Add gpo tests
David Mulder [Fri, 3 Mar 2017 19:54:30 +0000 (12:54 -0700)]
gpo: Add gpo tests

Lays down a sysvol gpttmpl.inf with password policies, then runs the samba_gpoupdate command. Verifies policies are applied to the samdb.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agogpo: Install the samba_gpoupdate script
David Mulder [Fri, 10 Feb 2017 17:33:29 +0000 (10:33 -0700)]
gpo: Install the samba_gpoupdate script

The samba_gpoupdate script was not being installed by waf.
Added samba_gpoupdate to the wscripts so it gets installed as part of a make install.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agogpoupdate: Rewrite samba_gpoupdate
David Mulder [Thu, 25 May 2017 13:27:27 +0000 (07:27 -0600)]
gpoupdate: Rewrite samba_gpoupdate

Use new python bindings and remove obsoleted code

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agogpo: Make the gpclass more easily extensible
David Mulder [Fri, 24 Feb 2017 21:19:48 +0000 (14:19 -0700)]
gpo: Make the gpclass more easily extensible

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agolibgpo: Add libgpo python bindings
David Mulder [Wed, 10 May 2017 19:30:17 +0000 (13:30 -0600)]
libgpo: Add libgpo python bindings

Create libgpo python bindings for GROUP_POLICY_OBJECT, ADS_STRUCT, gpo_get_unix_path, ads_connect, and ads_get_gpo_list.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agogpo: fix the building of gpext to only once
Garming Sam [Wed, 5 Feb 2014 04:18:23 +0000 (17:18 +1300)]
gpo: fix the building of gpext to only once

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agogpo: enable gpo update with addition to build system
Luke Morrison [Fri, 7 Feb 2014 02:57:14 +0000 (15:57 +1300)]
gpo: enable gpo update with addition to build system

Split from "Initial commit for GPO work done by Luke Morrison" by Garming Sam

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Luke Morrison <luke@hubtrek.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agogpoupdate: Remove developer path from the comment
Andrew Bartlett [Tue, 24 Oct 2017 03:06:05 +0000 (16:06 +1300)]
gpoupdate: Remove developer path from the comment

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
6 years agogpoupdate: Correct comment about hard-coded 5 second runing of the script
Andrew Bartlett [Tue, 24 Oct 2017 03:04:25 +0000 (16:04 +1300)]
gpoupdate: Correct comment about hard-coded 5 second runing of the script

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
6 years agogpoupdate: Do not DEBUG(0) every scan interval
Andrew Bartlett [Tue, 24 Oct 2017 03:02:35 +0000 (16:02 +1300)]
gpoupdate: Do not DEBUG(0) every scan interval

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
6 years agogpo: Create the gpo update service
Garming Sam [Wed, 9 Aug 2017 02:17:09 +0000 (14:17 +1200)]
gpo: Create the gpo update service

Split from "Initial commit for GPO work done by Luke Morrison" by David Mulder

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Luke Morrison <luke@hubtrek.com>
Signed-off-by: David Mulder <dmulder@suse.com>
Then adapted to current master

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
6 years agogpo: Make the gpoupdate script much more reliable
David Mulder [Sat, 11 Feb 2017 14:53:07 +0000 (07:53 -0700)]
gpo: Make the gpoupdate script much more reliable

Using a static file blanks the file when samba_gpoupdate crashes. Transformed
to a tdb file and added transactions. Add info logging to monitor gpo changes,
etc. Also handle parse errors and log an error message, then recover. Modified
the parsing code to use ConfigParser. Also, use the backslash in path names
when opening smb files, otherwise it fails against a windows server.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agogpo: Initial commit for GPO work
Luke Morrison [Fri, 31 Jan 2014 00:27:05 +0000 (13:27 +1300)]
gpo: Initial commit for GPO work

Enclosed is my Summer of Code 2013 patch to have vital password GPO always applied to the Samba4 Domain Controller using a GPO update service.

To try it out "make -j" your samba with the patch, apply a security password GPO and see the difference in ~20 seconds. It also takes GPO hierarchy into account.

Split from "Initial commit for GPO work done by Luke Morrison" by David Mulder

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Luke Morrison <luke@hubtrek.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agogpo: Add python libgpo bindings
Luke Morrison [Fri, 31 Jan 2014 00:27:05 +0000 (13:27 +1300)]
gpo: Add python libgpo bindings

Split from "Initial commit for GPO work done by Luke Morrison" by David Mulder

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Luke Morrison <luke@hubtrek.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoRevert "libgpo: remove unused libgpo wscript_build."
Garming Sam [Fri, 31 Jan 2014 00:15:41 +0000 (13:15 +1300)]
Revert "libgpo: remove unused libgpo wscript_build."

This reverts commit feffac806800c1740521133e88a7ac777ce8f368.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agogpo: move mkdir_p to lib/util
David Mulder [Wed, 8 Mar 2017 15:33:56 +0000 (08:33 -0700)]
gpo: move mkdir_p to lib/util

Move the mkdir_p function to lib/util so it can be used elsewhere

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agowaf: Move script list to one-per-line
Andrew Bartlett [Tue, 24 Oct 2017 02:46:02 +0000 (15:46 +1300)]
waf: Move script list to one-per-line

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
6 years agosource3: remove sock_exec
Gary Lockyer [Fri, 3 Nov 2017 00:35:41 +0000 (13:35 +1300)]
source3: remove sock_exec

Remove the sock_exec code which is no longer needed and additionally has been
used by exploit code.

This was originally test support code, the tests relying on the sock_exec
code have been removed.

Past exploits have used sock_exec as a proxy for system() matching a talloc
destructor prototype.

See for example:
Exploit for Samba vulnerabilty (CVE-2015-0240) at
    https://gist.github.com/worawit/051e881fc94fe4a49295
    and the Red Hat post at
    https://access.redhat.com/blogs/766093/posts/1976553

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Nov 20 07:20:13 CET 2017 on sn-devel-144

6 years agowinbindd: tdb_exists returns 1 if a record is found
Ralph Boehme [Sat, 18 Nov 2017 14:14:15 +0000 (15:14 +0100)]
winbindd: tdb_exists returns 1 if a record is found

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sun Nov 19 15:14:13 CET 2017 on sn-devel-144

6 years agowinbind: Remove winbind_messaging_context
Volker Lendecke [Fri, 17 Nov 2017 10:47:37 +0000 (11:47 +0100)]
winbind: Remove winbind_messaging_context

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

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): Sat Nov 18 04:07:24 CET 2017 on sn-devel-144

6 years agowinbind: winbind_messaging_context -> server_messaging_context
Volker Lendecke [Fri, 17 Nov 2017 10:42:34 +0000 (11:42 +0100)]
winbind: winbind_messaging_context -> server_messaging_context

Don't use winbind_messaging_context anymore.

This fixes a bug analysed by Peter Somogyi <PSOMOGYI@hu.ibm.com>: If a
parent winbind forks, it only called reinit_after_fork on
winbind_messaging_context. On the other hand, deep in dbwrap_open we use
server_messaging_context(). This is not reinitialized by
winbind_reinit_after fork, so the parent and child share a ctdb
connection. This is invalid, because replies from ctdb end up in the
wrong process.

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agowinbind: Remove winbind_event_context
Volker Lendecke [Fri, 17 Nov 2017 10:37:30 +0000 (11:37 +0100)]
winbind: Remove winbind_event_context

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agowinbind: Replace winbind_event_context with server_event_context
Volker Lendecke [Fri, 17 Nov 2017 10:35:19 +0000 (11:35 +0100)]
winbind: Replace winbind_event_context with server_event_context

There's no point in having two global event contexts

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agolibnet_join: fix "net rpc oldjoin"
Stefan Metzmacher [Thu, 16 Nov 2017 21:09:20 +0000 (21:09 +0000)]
libnet_join: fix "net rpc oldjoin"

We need to open the ncacn_np (smb) transport connection with
anonymous credentials.

In order to do netr_ServerPasswordSet*() we need to
establish a 2nd netlogon connection using dcerpc schannel
authentication.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agos3:selftest: add samba3.blackbox.net_rpc_oldjoin test
Stefan Metzmacher [Fri, 17 Nov 2017 14:51:36 +0000 (15:51 +0100)]
s3:selftest: add samba3.blackbox.net_rpc_oldjoin test

This demonstrates that "net rpc oldjoin" is currently broken.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agonsswitch: Slightly simplify winbindd_request_response
Volker Lendecke [Sat, 15 Jul 2017 09:54:14 +0000 (11:54 +0200)]
nsswitch: Slightly simplify winbindd_request_response

We don't need a separate variable, C passes a copy on the stack

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agontlm_auth: Use libwbclient in get_winbind_netbios_name()
Volker Lendecke [Sat, 15 Jul 2017 08:56:47 +0000 (10:56 +0200)]
ntlm_auth: Use libwbclient in get_winbind_netbios_name()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agontlm_auth: Use libwbclient in get_require_membership_sid()
Volker Lendecke [Sat, 15 Jul 2017 09:06:38 +0000 (11:06 +0200)]
ntlm_auth: Use libwbclient in get_require_membership_sid()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agontlm_auth: Use libwbclient in get_winbind_domain()
Volker Lendecke [Sat, 15 Jul 2017 08:55:09 +0000 (10:55 +0200)]
ntlm_auth: Use libwbclient in get_winbind_domain()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agontlm_auth: Use libwbclient in winbind_separator()
Volker Lendecke [Sat, 15 Jul 2017 08:52:17 +0000 (10:52 +0200)]
ntlm_auth: Use libwbclient in winbind_separator()

Avoid direct winbindd_request_response()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agolibwbclient: Fix two signed/unsigned hickups
Volker Lendecke [Thu, 13 Jul 2017 13:52:15 +0000 (15:52 +0200)]
libwbclient: Fix two signed/unsigned hickups

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agolib: Save a few bytes of .text
Volker Lendecke [Wed, 15 Nov 2017 12:12:05 +0000 (13:12 +0100)]
lib: Save a few bytes of .text

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agolib: Fix a false/NULL hickup
Volker Lendecke [Mon, 13 Nov 2017 15:21:31 +0000 (16:21 +0100)]
lib: Fix a false/NULL hickup

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agolib: Simplify is_ipaddress_v6
Volker Lendecke [Mon, 13 Nov 2017 15:54:09 +0000 (16:54 +0100)]
lib: Simplify is_ipaddress_v6

Do an early return, avoid an "else", avoid an indentation level

Review with git show -b

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agolib: Avoid a pointless static variable
Volker Lendecke [Mon, 13 Nov 2017 15:15:42 +0000 (16:15 +0100)]
lib: Avoid a pointless static variable

Saves a few bytes of .text

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agowinbindd: Fix some signed/unsigned warnings
Volker Lendecke [Sun, 6 Aug 2017 16:04:12 +0000 (18:04 +0200)]
winbindd: Fix some signed/unsigned warnings

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agonsswitch: Fix a typo
Volker Lendecke [Mon, 17 Jul 2017 13:40:11 +0000 (15:40 +0200)]
nsswitch: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agotevent: Fix typos
Volker Lendecke [Mon, 30 Oct 2017 12:51:25 +0000 (13:51 +0100)]
tevent: Fix typos

While there, fix comment formatting

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agolibsmb: Fix a typo
Volker Lendecke [Tue, 7 Nov 2017 12:04:21 +0000 (13:04 +0100)]
libsmb: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agolib: tevent: Minor cleanup. wakeup_fd can always be gotten from the event context.
Jeremy Allison [Sat, 11 Nov 2017 03:26:55 +0000 (19:26 -0800)]
lib: tevent: Minor cleanup. wakeup_fd can always be gotten from the event context.

We don't need to store it. I prefer this as it shows that we must always
get wakeup_fd from the event context at time of use, rather than possibly
storing an out-of-date variable.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Nov 17 12:43:01 CET 2017 on sn-devel-144

6 years agopthreadpool: create a tevent_threaded_context per registered event context
Ralph Boehme [Sat, 11 Nov 2017 12:05:03 +0000 (13:05 +0100)]
pthreadpool: create a tevent_threaded_context per registered event context

We just need one tevent_threaded_context per unique combintation of
tevent event contexts and pthreadpool_tevent pools, not multiple copies
for identical combinations of a tevent contexts and a pthreadpool_tevent
pools.

With this commit we register tevent contexts in a list in the
pthreadpool_tevent structure and will only have one
tevent_threaded_context object per tevent context per pool.

With many pthreadpool_tevent_job_send reqs this pays off, I've seen a
small decrease in cpu-ticks with valgrind callgrind and a modified
local.messaging.ping-speed torture test. The test modification ensured
messages we never directly send, but always submitted via
pthreadpool_tevent_job_send.

Pair-Programmed-With: Jeremy Allison <jra@samba.org>

Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Nov 17 02:35:52 CET 2017 on sn-devel-144

6 years agos4: torture: Ensure kernel oplock test can't hang in pause().
Jeremy Allison [Wed, 15 Nov 2017 18:12:06 +0000 (10:12 -0800)]
s4: torture: Ensure kernel oplock test can't hang in pause().

Use an alarm to break out of waiting for a signal.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Nov 16 22:27:06 CET 2017 on sn-devel-144

6 years agos3: smbclient: tests: Test "volume" command over SMB1 and SMB2+.
Jeremy Allison [Tue, 14 Nov 2017 23:54:19 +0000 (15:54 -0800)]
s3: smbclient: tests: Test "volume" command over SMB1 and SMB2+.

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

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): Wed Nov 15 19:50:54 CET 2017 on sn-devel-144

6 years agos3: smbclient: Implement "volume" command over SMB2.
Jeremy Allison [Tue, 14 Nov 2017 23:42:14 +0000 (15:42 -0800)]
s3: smbclient: Implement "volume" command over SMB2.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agos3: libsmb: smbc_statvfs is missing the supporting SMB2 calls.
Jeremy Allison [Tue, 14 Nov 2017 21:52:03 +0000 (13:52 -0800)]
s3: libsmb: smbc_statvfs is missing the supporting SMB2 calls.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agopam_winbind: initial Turkish translation
ulkuderner [Tue, 1 Aug 2017 09:01:22 +0000 (12:01 +0300)]
pam_winbind: initial Turkish translation

Reviewed-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Karolin Seeger <kseeger@samba.org>
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Wed Nov 15 13:52:05 CET 2017 on sn-devel-144

6 years agosmbtorture: Remove an unused variable
Volker Lendecke [Sun, 12 Nov 2017 15:09:35 +0000 (16:09 +0100)]
smbtorture: Remove an unused variable

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 Nov 14 03:55:37 CET 2017 on sn-devel-144

6 years agodreplsrv: Use is_null_sid
Volker Lendecke [Sun, 12 Nov 2017 15:07:48 +0000 (16:07 +0100)]
dreplsrv: Use is_null_sid

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agolib: Save a few bytes of .text
Volker Lendecke [Sun, 12 Nov 2017 13:55:40 +0000 (14:55 +0100)]
lib: Save a few bytes of .text

Looks surprising, but this does save bytes if you look at the object with
"size".

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agorpcclient: Avoid a ZERO_STRUCT, save a few bytes .text
Volker Lendecke [Sun, 12 Nov 2017 13:48:24 +0000 (14:48 +0100)]
rpcclient: Avoid a ZERO_STRUCT, save a few bytes .text

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agolib: Avoid a ZERO_STRUCT, save a few bytes .text
Volker Lendecke [Sun, 12 Nov 2017 13:48:24 +0000 (14:48 +0100)]
lib: Avoid a ZERO_STRUCT, save a few bytes .text

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agosmbd: Avoid an "else"
Volker Lendecke [Fri, 4 Aug 2017 08:44:59 +0000 (10:44 +0200)]
smbd: Avoid an "else"

We always return in the if-branch before. The else is redundant

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agoutil_tdb: Make a few functions static
Volker Lendecke [Thu, 3 Aug 2017 15:08:48 +0000 (17:08 +0200)]
util_tdb: Make a few functions static

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agopassdb: Fix a typo
Volker Lendecke [Fri, 4 Aug 2017 12:47:17 +0000 (14:47 +0200)]
passdb: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agolibcli: Fix a signed/unsigned hickup
Volker Lendecke [Mon, 13 Nov 2017 07:53:04 +0000 (08:53 +0100)]
libcli: Fix a signed/unsigned hickup

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