samba.git
7 years agonmbd: xfile->stdio
Volker Lendecke [Sat, 26 Nov 2016 08:50:33 +0000 (09:50 +0100)]
nmbd: xfile->stdio

Unfortunately this is a larger patch. Doing it in small pieces would
have been pretty difficult, as everybody calls everybody else.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agolib: smbreadline xfile->stdio
Volker Lendecke [Wed, 23 Nov 2016 09:07:48 +0000 (10:07 +0100)]
lib: smbreadline xfile->stdio

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agolibnbt: lmhosts xfile->stdio
Volker Lendecke [Wed, 23 Nov 2016 07:55:16 +0000 (08:55 +0100)]
libnbt: lmhosts xfile->stdio

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agoprinting: Convert aix_cache_reload to stdio
Volker Lendecke [Sat, 26 Nov 2016 14:33:06 +0000 (15:33 +0100)]
printing: Convert aix_cache_reload to stdio

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agoprinting: std_pcap_cache_reload xfile->stdio
Volker Lendecke [Sat, 26 Nov 2016 08:27:19 +0000 (09:27 +0100)]
printing: std_pcap_cache_reload xfile->stdio

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agorpc_server: svcctl xfile->stdio
Volker Lendecke [Tue, 22 Nov 2016 00:44:48 +0000 (01:44 +0100)]
rpc_server: svcctl xfile->stdio

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agovfs: expand_msdfs xfile->stdio
Volker Lendecke [Tue, 22 Nov 2016 00:42:36 +0000 (01:42 +0100)]
vfs: expand_msdfs xfile->stdio

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agontlm_auth3: xfile->stdio
Volker Lendecke [Sat, 19 Nov 2016 09:25:12 +0000 (09:25 +0000)]
ntlm_auth3: xfile->stdio

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agotorture: upload_printer_driver_file xfile->stdio
Volker Lendecke [Fri, 25 Nov 2016 21:01:38 +0000 (22:01 +0100)]
torture: upload_printer_driver_file xfile->stdio

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agosmbd: username map file handling xfile->stdio
Volker Lendecke [Tue, 22 Nov 2016 00:38:16 +0000 (01:38 +0100)]
smbd: username map file handling xfile->stdio

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agolib: Add fgets_slash
Volker Lendecke [Mon, 21 Nov 2016 18:20:10 +0000 (19:20 +0100)]
lib: Add fgets_slash

Copy x_fgets_slash with conversion to stdio and talloc.

Probably I'd do this functionality a bit differently, but for simplicity I
chose to make it the same as what is there.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agolib: popt_common xfile->stdio
Volker Lendecke [Tue, 22 Nov 2016 00:26:08 +0000 (01:26 +0100)]
lib: popt_common xfile->stdio

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agoidmap_hash: xfile->stdio
Volker Lendecke [Tue, 22 Nov 2016 00:30:29 +0000 (01:30 +0100)]
idmap_hash: xfile->stdio

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agosmbclient: xfile->stdio
Volker Lendecke [Tue, 22 Nov 2016 00:59:22 +0000 (01:59 +0100)]
smbclient: xfile->stdio

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agosmbclient4: xfile->stdio
Volker Lendecke [Wed, 23 Nov 2016 09:11:13 +0000 (10:11 +0100)]
smbclient4: xfile->stdio

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos3: ntlm_auth: Don't corrupt the output stream with debug messages.
Jeremy Allison [Sat, 10 Dec 2016 21:56:18 +0000 (13:56 -0800)]
s3: ntlm_auth: Don't corrupt the output stream with debug messages.

Calling programs expect to cleanly read from STDOUT.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 years agos3: torture: Adds regression test case for se_access_check() owner rights issue.
Jeremy Allison [Thu, 8 Dec 2016 18:40:27 +0000 (10:40 -0800)]
s3: torture: Adds regression test case for se_access_check() owner rights issue.

This test passes against Win2K12 but fails against smbd
without the previous commit.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Dec 10 10:11:10 CET 2016 on sn-devel-144

7 years agolib: security: se_access_check() incorrectly processes owner rights (S-1-3-4) DENY...
Jeremy Allison [Thu, 8 Dec 2016 18:40:18 +0000 (10:40 -0800)]
lib: security: se_access_check() incorrectly processes owner rights (S-1-3-4) DENY ace entries

Reported and proposed fix by Shilpa K <shilpa.krishnareddy@gmail.com>.

When processing DENY ACE entries for owner rights SIDs (S-1-3-4) the
code OR's in the deny access mask bits without taking into account if
they were being requested in the requested access mask.

E.g. The current logic has:

An ACL containining:

[0] SID: S-1-3-4
    TYPE: DENY
    MASK: WRITE_DATA
[1] SID: S-1-3-4
    TYPE: ALLOW
    MASK: ALLOW_ALL

prohibits an open request by the owner for READ_DATA - even though this
is explicitly allowed.

Furthermore a non-canonical ACL containing:

[0] SID: User SID 1-5-21-something
    TYPE: ALLOW
    MASK: READ_DATA

[1] SID: S-1-3-4
    TYPE: DENY
    MASK: READ_DATA

[2] SID: User SID 1-5-21-something
    TYPE: ALLOW
    MASK: WRITE_DATA

prohibits an open request by the owner for READ_DATA|WRITE_DATA - even
though READ_DATA is explicitly allowed in ACE no 0 and is thus already
filtered out of the "access-still-needed" mask when the deny ACE no 1 is
evaluated.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agoutil: use SCOPE_DELIMITER for the IPv6 scope delimiter
Björn Jacke [Thu, 8 Dec 2016 16:53:43 +0000 (17:53 +0100)]
util: use SCOPE_DELIMITER for the IPv6 scope delimiter

Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Fri Dec  9 20:45:15 CET 2016 on sn-devel-144

7 years agoreplace: make sure we have a SCOPE_DELIMITER define
Björn Jacke [Thu, 8 Dec 2016 16:56:24 +0000 (17:56 +0100)]
replace: make sure we have a SCOPE_DELIMITER define

Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
7 years agoad/provision: change http://samba.org to https://www.samba.org
Björn Jacke [Thu, 8 Dec 2016 17:45:26 +0000 (18:45 +0100)]
ad/provision: change samba.org to https://samba.org

Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: Karolin Seeger <kseeger@samba.org>
Autobuild-User(master): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(master): Fri Dec  9 16:57:31 CET 2016 on sn-devel-144

7 years agoman pages: change http://samba.org to https://www.samba.org
Björn Jacke [Thu, 8 Dec 2016 17:45:25 +0000 (18:45 +0100)]
man pages: change samba.org to https://samba.org

Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: Karolin Seeger <kseeger@samba.org>
7 years agodocs-xml: change http://samba.org to https://www.samba.org
Björn Jacke [Thu, 8 Dec 2016 17:45:24 +0000 (18:45 +0100)]
docs-xml: change samba.org to https://samba.org

Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: Karolin Seeger <kseeger@samba.org>
7 years agos3:libsmb: don't pass 'passlen' to cli_tree_connect[_send]() and allow pass=NULL
Stefan Metzmacher [Thu, 8 Dec 2016 06:13:57 +0000 (07:13 +0100)]
s3:libsmb: don't pass 'passlen' to cli_tree_connect[_send]() and allow pass=NULL

There're no callers which try to pass a raw lm_response directly anymore.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Dec  9 13:09:37 CET 2016 on sn-devel-144

7 years agos3:libsmb: avoid using cli->{use_kerberos,...} in remote_password_change()
Stefan Metzmacher [Sun, 30 Oct 2016 15:10:03 +0000 (16:10 +0100)]
s3:libsmb: avoid using cli->{use_kerberos,...} in remote_password_change()

As we pass flags=0 to cli_connect_nb() all values can only be false,
so we can use false directly.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:client: avoid using cli->{use_kerberos,...} for cli_session_creds_init() in smbspool.c
Stefan Metzmacher [Sun, 30 Oct 2016 15:21:31 +0000 (16:21 +0100)]
s3:client: avoid using cli->{use_kerberos,...} for cli_session_creds_init() in smbspool.c

CLI_FULL_CONNECTION_USE_KERBEROS is the only possible flag the
caller of smb_complete_connection() will pass, so we can avoid
use it directly instead of going via cli_start_connection()
to use cli->use_kerberos.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:client: make use of cli_tree_connect_creds() in smbspool.c
Stefan Metzmacher [Thu, 8 Dec 2016 05:54:29 +0000 (06:54 +0100)]
s3:client: make use of cli_tree_connect_creds() in smbspool.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:libsmb: add cli_tree_connect_creds()
Stefan Metzmacher [Wed, 7 Dec 2016 16:32:58 +0000 (17:32 +0100)]
s3:libsmb: add cli_tree_connect_creds()

This can be used with a valid creds structure in order
to do a share level authentication or with NULL in the cases
we assume a modern server already.

Later we can change the ordering and implement
cli_tree_connect() on top of cli_tree_connect_creds().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:libsmb: fix 'client lanman auth = no' DEBUG message in cli_session_setup_creds_send()
Stefan Metzmacher [Wed, 7 Dec 2016 16:18:01 +0000 (17:18 +0100)]
s3:libsmb: fix 'client lanman auth = no' DEBUG message in cli_session_setup_creds_send()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:libsmb: fix memory leak in cli_raw_ntlm_smb_encryption_start()
Stefan Metzmacher [Thu, 3 Nov 2016 12:49:43 +0000 (13:49 +0100)]
s3:libsmb: fix memory leak in cli_raw_ntlm_smb_encryption_start()

smb_trans_enc_state is a talloc pointer now, so we can talloc_move()
the gensec_security to the correct talloc parent.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:torture: make use of cli_full_connection_creds() in torture.c
Stefan Metzmacher [Fri, 28 Oct 2016 10:44:51 +0000 (12:44 +0200)]
s3:torture: make use of cli_full_connection_creds() in torture.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agoauth/credentials: clear all unused blobs in cli_credentials_get_ntlm_response()
Stefan Metzmacher [Wed, 7 Dec 2016 16:17:44 +0000 (17:17 +0100)]
auth/credentials: clear all unused blobs in cli_credentials_get_ntlm_response()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agoauth/credentials: fix cut'n'paste error in cli_credentials_get_principal_and_obtained()
Stefan Metzmacher [Tue, 8 Nov 2016 06:19:11 +0000 (07:19 +0100)]
auth/credentials: fix cut'n'paste error in cli_credentials_get_principal_and_obtained()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agoauth/credentials: let cli_credentials_parse_string() handle the "winbind separator"
Stefan Metzmacher [Fri, 28 Oct 2016 13:55:48 +0000 (15:55 +0200)]
auth/credentials: let cli_credentials_parse_string() handle the "winbind separator"

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agoctdb: add test script for ctdb_mutex_ceph_rados_helper
David Disseldorp [Tue, 6 Dec 2016 12:03:27 +0000 (13:03 +0100)]
ctdb: add test script for ctdb_mutex_ceph_rados_helper

This standalone test script performs the following:
- using ctdb_mutex_ceph_rados_helper, take a lock on the Ceph RADOS
  object a CLUSTER/$POOL/$OBJECT using the Ceph keyring for $USER
  + confirm that lock is obtained, via ctdb_mutex_ceph_rados_helper "0"
    output
- check RADOS object lock state, using the "rados lock info" command
- attempt to obtain the lock again, using ctdb_mutex_ceph_rados_helper
  + confirm that the lock is not successfully taken
- tell the first locker to drop the lock and exit, via SIGTERM
- once the first locker has exited, attempt to get the lock again
  + confirm that this attempt succeeds

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Fri Dec  9 07:59:33 CET 2016 on sn-devel-144

7 years agoctdb/doc: man page for Ceph RADOS cluster mutex helper
David Disseldorp [Thu, 1 Dec 2016 13:22:45 +0000 (14:22 +0100)]
ctdb/doc: man page for Ceph RADOS cluster mutex helper

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb: cluster mutex helper using Ceph RADOS
David Disseldorp [Thu, 1 Dec 2016 12:33:22 +0000 (13:33 +0100)]
ctdb: cluster mutex helper using Ceph RADOS

ctdb_mutex_ceph_rados_helper implements the cluster mutex helper API
atop Ceph using the librados rados_lock_exclusive()/rados_unlock()
functionality.

Once configured, split brain avoidance during CTDB recovery will be
handled using locks against an object located in a Ceph RADOS pool.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-build: configure time switch for etcd support
David Disseldorp [Tue, 6 Dec 2016 12:52:47 +0000 (13:52 +0100)]
ctdb-build: configure time switch for etcd support

Disable generation/installation of the etcd cluster mutex helper by
default. Support can be explicitly enabled at configure time with
--enable-etcd-reclock.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-build: move ctdb_etcd_lock to utils/etcd
David Disseldorp [Tue, 6 Dec 2016 12:38:45 +0000 (13:38 +0100)]
ctdb-build: move ctdb_etcd_lock to utils/etcd

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-build: Generate pre-built documentation in wscript itself
Amitay Isaacs [Thu, 8 Dec 2016 05:47:16 +0000 (16:47 +1100)]
ctdb-build: Generate pre-built documentation in wscript itself

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: David Disseldorp <ddiss@samba.org>
7 years agoctdb-build: Avoid duplicate list of man pages
Amitay Isaacs [Thu, 8 Dec 2016 04:38:36 +0000 (15:38 +1100)]
ctdb-build: Avoid duplicate list of man pages

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: David Disseldorp <ddiss@samba.org>
7 years agolib/util: Fix indentation within routine description for dbghdrclass
Anoop C S [Tue, 6 Dec 2016 09:55:46 +0000 (15:25 +0530)]
lib/util: Fix indentation within routine description for dbghdrclass

Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Dec  9 02:02:36 CET 2016 on sn-devel-144

7 years agolib/util: Fix input arguments description for dbghdrclass() routine
Anoop C S [Tue, 6 Dec 2016 09:50:51 +0000 (15:20 +0530)]
lib/util: Fix input arguments description for dbghdrclass() routine

Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agotevent: remove shebang from tevent.py
Lukas Slebodnik [Mon, 5 Dec 2016 13:23:40 +0000 (14:23 +0100)]
tevent: remove shebang from tevent.py

The tevent.py is not a executable python script.
And rpmlint consider it as an error if module file
contians shebang

    python2-tevent.x86_64: E: non-executable-script
        /usr/lib64/python2.7/site-packages/tevent.py 644 /usr/bin/python
    python3-tevent.x86_64: E: non-executable-script
        /usr/lib64/python3.5/site-packages/tevent.py 644 /usr/bin/python

Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
7 years agos4:repl_meta_data: normalize rdn attribute name via the schema
Stefan Metzmacher [Sun, 30 Oct 2016 22:54:44 +0000 (23:54 +0100)]
s4:repl_meta_data: normalize rdn attribute name via the schema

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Dec  8 17:16:47 CET 2016 on sn-devel-144

7 years agopidl: Make dcesrv\_$name\_interface "static const"
Andrew Bartlett [Sun, 20 Nov 2016 22:21:50 +0000 (11:21 +1300)]
pidl: Make dcesrv\_$name\_interface "static const"

This moves it out of the global namespace

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Dec  8 13:25:57 CET 2016 on sn-devel-144

7 years agos4-rpc_server: Avoid extern reference to dcesrv_mgmt_interface and memcpy()
Andrew Bartlett [Sun, 20 Nov 2016 22:31:27 +0000 (11:31 +1300)]
s4-rpc_server: Avoid extern reference to dcesrv_mgmt_interface and memcpy()

Use a typesafe struct-returning function instead

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
7 years agos3: torture: Regression test case for permissions check on rename.
Jeremy Allison [Mon, 5 Dec 2016 22:34:18 +0000 (14:34 -0800)]
s3: torture: Regression test case for permissions check on rename.

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

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): Wed Dec  7 11:52:03 CET 2016 on sn-devel-144

7 years agos3: smbd: Add missing permissions check on destination folder.
Jeremy Allison [Mon, 5 Dec 2016 22:32:55 +0000 (14:32 -0800)]
s3: smbd: Add missing permissions check on destination folder.

Based on code from Michael Zeis <mzeis.quantum@gmail.com>.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agos3: smbd: Make check_parent_access() available to rename code.
Jeremy Allison [Mon, 5 Dec 2016 22:32:03 +0000 (14:32 -0800)]
s3: smbd: Make check_parent_access() available to rename code.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agos3: smbd: rename - missing early error exit if source and destination prefixes are...
Jeremy Allison [Mon, 5 Dec 2016 22:13:14 +0000 (14:13 -0800)]
s3: smbd: rename - missing early error exit if source and destination prefixes are different.

Noticed by Michael Zeis <mzeis.quantum@gmail.com>.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agowinbind: dom_sid_parse_endp always initializes "endp" when ok
Volker Lendecke [Thu, 1 Dec 2016 16:16:14 +0000 (16:16 +0000)]
winbind: dom_sid_parse_endp always initializes "endp" when ok

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 Dec  7 00:11:03 CET 2016 on sn-devel-144

7 years agoidmap_autorid: dom_sid_parse_endp always initializes "endp" when ok
Volker Lendecke [Thu, 1 Dec 2016 16:16:14 +0000 (16:16 +0000)]
idmap_autorid: dom_sid_parse_endp always initializes "endp" when ok

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agolib: Make dom_sid_parse_endp init "endp" on all "ok" paths
Volker Lendecke [Thu, 1 Dec 2016 16:15:29 +0000 (16:15 +0000)]
lib: Make dom_sid_parse_endp init "endp" on all "ok" paths

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agoidmap_autorid: Add a {} pair in an if-statement
Volker Lendecke [Thu, 1 Dec 2016 16:11:38 +0000 (16:11 +0000)]
idmap_autorid: Add a {} pair in an if-statement

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agoprinting: Fix building with CUPS version older than 1.7
Andreas Schneider [Tue, 6 Dec 2016 08:44:28 +0000 (09:44 +0100)]
printing: Fix building with CUPS version older than 1.7

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Karolin Seeger <kseeger@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Dec  6 13:54:28 CET 2016 on sn-devel-144

7 years agoctdb: Add new helper ctdb_etcd_lock
Jose A. Rivera [Mon, 25 Jul 2016 19:58:16 +0000 (14:58 -0500)]
ctdb: Add new helper ctdb_etcd_lock

This introduces a mutex helper called ctdb_etcd_lock, which allows CTDB to
use an existing etcd cluster to provide the functionality of a recovery lock
using the API outlined in ctdb/doc/cluster_mutex_helper.txt.

Signed-off-by: Jose A. Rivera <jarrpa@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): José A. Rivera <jarrpa@samba.org>
Autobuild-Date(master): Mon Dec  5 19:39:10 CET 2016 on sn-devel-144

7 years agoctdb-recovery: Start recovery helper with ctdb_vfork_exec
Amitay Isaacs [Wed, 30 Nov 2016 01:23:04 +0000 (12:23 +1100)]
ctdb-recovery: Start recovery helper with ctdb_vfork_exec

The recovery helper does it's own logging, so there is no need to
pass logfd.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Mon Dec  5 11:59:42 CET 2016 on sn-devel-144

7 years agoctdb-locking: Start locking helper using ctdb_vfork_exec
Amitay Isaacs [Wed, 30 Nov 2016 01:22:02 +0000 (12:22 +1100)]
ctdb-locking: Start locking helper using ctdb_vfork_exec

This avoids the extra argument of logfd to ctdb_lock_helper.  The log
messages from lock helper are captured by ctdbd.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-daemon: Add ctdb_vfork_exec()
Amitay Isaacs [Wed, 30 Nov 2016 01:15:11 +0000 (12:15 +1100)]
ctdb-daemon: Add ctdb_vfork_exec()

This will replace ctdb_vfork_with_logging().

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-daemon: Log to stderr when running in interactive mode
Amitay Isaacs [Tue, 29 Nov 2016 06:52:00 +0000 (17:52 +1100)]
ctdb-daemon: Log to stderr when running in interactive mode

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-daemon: Initialize logging in recovery daemon
Amitay Isaacs [Tue, 29 Nov 2016 05:49:41 +0000 (16:49 +1100)]
ctdb-daemon: Initialize logging in recovery daemon

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-recoverd: Log a message when terminating
Amitay Isaacs [Fri, 25 Nov 2016 03:57:30 +0000 (14:57 +1100)]
ctdb-recoverd: Log a message when terminating

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-logging: Get rid of debug_extra
Amitay Isaacs [Tue, 29 Nov 2016 06:59:32 +0000 (17:59 +1100)]
ctdb-logging: Get rid of debug_extra

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-daemon: Remove setting of debug_extra
Amitay Isaacs [Fri, 25 Nov 2016 03:50:01 +0000 (14:50 +1100)]
ctdb-daemon: Remove setting of debug_extra

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-daemon: Remove setting of debug_extra from switch_from_server_to_client()
Amitay Isaacs [Fri, 25 Nov 2016 03:44:10 +0000 (14:44 +1100)]
ctdb-daemon: Remove setting of debug_extra from switch_from_server_to_client()

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-daemon: Remove setting of debug_extra via ctdb_set_child_info()
Amitay Isaacs [Fri, 25 Nov 2016 03:37:17 +0000 (14:37 +1100)]
ctdb-daemon: Remove setting of debug_extra via ctdb_set_child_info()

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-daemon: Don't depend on debug_extra in exit handler
Amitay Isaacs [Fri, 25 Nov 2016 03:54:07 +0000 (14:54 +1100)]
ctdb-daemon: Don't depend on debug_extra in exit handler

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-daemon: Fix debug messages
Amitay Isaacs [Wed, 30 Nov 2016 06:04:54 +0000 (17:04 +1100)]
ctdb-daemon: Fix debug messages

- Use fprintf() before logging is initialized
- replace DEBUG_ALERT with DEBUG_ERR

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-daemon: Consolidate initialization of logging and debug level
Amitay Isaacs [Wed, 30 Nov 2016 05:46:19 +0000 (16:46 +1100)]
ctdb-daemon: Consolidate initialization of logging and debug level

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-logging: Remove duplicate logging code
Amitay Isaacs [Tue, 29 Nov 2016 05:36:57 +0000 (16:36 +1100)]
ctdb-logging: Remove duplicate logging code

ctdb_logging_init() now uses logging_init().

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-logging: Refactor logging code
Amitay Isaacs [Tue, 29 Nov 2016 05:17:23 +0000 (16:17 +1100)]
ctdb-logging: Refactor logging code

This extracts the code from following files:
  - server/ctdb_logging.c
  - server/ctdb_logging_file.c
  - server/ctdb_logging_syslog.c

This is in preparation for each daemon (and some processes) doing
their own loging instead of relying on CTDB.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-logging: Use Samba's debug levels
Martin Schwenke [Wed, 23 Nov 2016 08:03:23 +0000 (19:03 +1100)]
ctdb-logging: Use Samba's debug levels

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-scripts: Update CTDB_SCRIPT_DEBUGLEVEL to be symbolic
Martin Schwenke [Wed, 23 Nov 2016 10:36:36 +0000 (21:36 +1100)]
ctdb-scripts: Update CTDB_SCRIPT_DEBUGLEVEL to be symbolic

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-tests: Use symbolic debug levels in tool tests
Martin Schwenke [Wed, 23 Nov 2016 10:38:14 +0000 (21:38 +1100)]
ctdb-tests: Use symbolic debug levels in tool tests

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-tests: Use symbolic debug levels in eventscript tests
Martin Schwenke [Wed, 23 Nov 2016 10:37:45 +0000 (21:37 +1100)]
ctdb-tests: Use symbolic debug levels in eventscript tests

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-tests: Use symbolic debug level for local daemons
Martin Schwenke [Wed, 23 Nov 2016 06:01:54 +0000 (17:01 +1100)]
ctdb-tests: Use symbolic debug level for local daemons

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-tests: Use symbolic debug levels in takeover tests
Martin Schwenke [Wed, 23 Nov 2016 09:40:50 +0000 (20:40 +1100)]
ctdb-tests: Use symbolic debug levels in takeover tests

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-tests: Support symbolic debug level in takeover tests
Martin Schwenke [Wed, 23 Nov 2016 08:16:56 +0000 (19:16 +1100)]
ctdb-tests: Support symbolic debug level in takeover tests

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-doc: Don't advertise numeric debug levels
Martin Schwenke [Wed, 23 Nov 2016 05:51:53 +0000 (16:51 +1100)]
ctdb-doc: Don't advertise numeric debug levels

The plan is to switch to Samba's (incompatible) debug levels, so just
expect CTDB users to use the symbolic name for the debug level.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-logging: Drop enum debug_level
Martin Schwenke [Fri, 25 Nov 2016 02:23:11 +0000 (13:23 +1100)]
ctdb-logging: Drop enum debug_level

We are switching to Samba-style integer debug levels.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Remove tevent debug logging
Amitay Isaacs [Mon, 24 Oct 2016 05:53:12 +0000 (16:53 +1100)]
ctdb-daemon: Remove tevent debug logging

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agodebug: Add minimalist D_* macros
Martin Schwenke [Thu, 24 Nov 2016 03:48:04 +0000 (14:48 +1100)]
debug: Add minimalist D_* macros

These don't include the function name or any other header.

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): Mon Dec  5 05:58:48 CET 2016 on sn-devel-144

7 years agoidmap_hash: stdio.h comes with replace.h
Volker Lendecke [Tue, 22 Nov 2016 00:31:19 +0000 (01:31 +0100)]
idmap_hash: stdio.h comes with replace.h

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Sun Dec  4 20:20:19 CET 2016 on sn-devel-144

7 years agoidmap_hash: Make lw_map_file static
Volker Lendecke [Tue, 22 Nov 2016 00:27:40 +0000 (01:27 +0100)]
idmap_hash: Make lw_map_file static

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
7 years agowinbind: lookup_usergroups_cached doesn't use the "domain" parameter
Volker Lendecke [Fri, 4 Nov 2016 14:33:11 +0000 (15:33 +0100)]
winbind: lookup_usergroups_cached doesn't use the "domain" parameter

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
7 years agos3:waf: Remove unneeded CHARSET3 dependency
Andreas Schneider [Tue, 22 Nov 2016 16:35:31 +0000 (17:35 +0100)]
s3:waf: Remove unneeded CHARSET3 dependency

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agos3:waf: Make PARAM and SMBREGISTRY a subsystem of smbconf only
Andreas Schneider [Tue, 22 Nov 2016 12:47:32 +0000 (13:47 +0100)]
s3:waf: Make PARAM and SMBREGISTRY a subsystem of smbconf only

This is the only way to resolve cirular dependencies with these
libraries.  I've tried several ways but this is the only way to do it
correctly. In future we should try to seperate them by passing down
information or making a more lightweight loadparm mechanism.

+---------+                       +-------------+
|         |                       |             |
|  param  <---------+    +--------+ smbregistry |
|         |         |    |        |             |
+----+----+         |    |        +------^------+
     |          +---+----v--+            |
     |          |           |            |
     +---------->  smbconf  +------------+
                |           |
                +-----------+

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agos4:waf: Remove unneded dependency to s3 param
Andreas Schneider [Tue, 22 Nov 2016 12:45:50 +0000 (13:45 +0100)]
s4:waf: Remove unneded dependency to s3 param

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agos3:waf samba3util requires CHARSET3
Andreas Schneider [Tue, 22 Nov 2016 10:50:04 +0000 (11:50 +0100)]
s3:waf samba3util requires CHARSET3

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agos3:waf: Move cbuf functions to samba3-util
Andreas Schneider [Tue, 22 Nov 2016 10:18:40 +0000 (11:18 +0100)]
s3:waf: Move cbuf functions to samba3-util

This is used more commonly in the meantime and this way we avoid linking
to smbconf.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agos3:waf: Move popt_samba3 up in the stack
Andreas Schneider [Tue, 22 Nov 2016 10:09:42 +0000 (11:09 +0100)]
s3:waf: Move popt_samba3 up in the stack

Only daemons and client directly need to link against it.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agos3:waf: Reformat vlp
Andreas Schneider [Tue, 22 Nov 2016 10:04:59 +0000 (11:04 +0100)]
s3:waf: Reformat vlp

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agos3:waf: Reformat rpc_open_tcp
Andreas Schneider [Tue, 22 Nov 2016 10:04:47 +0000 (11:04 +0100)]
s3:waf: Reformat rpc_open_tcp

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agos3:waf: Reformat versiontest
Andreas Schneider [Tue, 22 Nov 2016 10:04:30 +0000 (11:04 +0100)]
s3:waf: Reformat versiontest

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agos3:waf: Reformat vfstest
Andreas Schneider [Tue, 22 Nov 2016 10:04:14 +0000 (11:04 +0100)]
s3:waf: Reformat vfstest

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agos3:waf: Reformat pdbtest
Andreas Schneider [Tue, 22 Nov 2016 10:03:50 +0000 (11:03 +0100)]
s3:waf: Reformat pdbtest

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agos3:waf: Reformat msg_source
Andreas Schneider [Tue, 22 Nov 2016 10:03:22 +0000 (11:03 +0100)]
s3:waf: Reformat msg_source

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agos3:waf: Reformat msg_sink
Andreas Schneider [Tue, 22 Nov 2016 10:03:02 +0000 (11:03 +0100)]
s3:waf: Reformat msg_sink

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agos3:waf: Reformat msgtest
Andreas Schneider [Tue, 22 Nov 2016 10:02:48 +0000 (11:02 +0100)]
s3:waf: Reformat msgtest

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>