jra/samba-autobuild/.git
6 years agoldb: version 1.2.1 ldb-1.2.1
Stefan Metzmacher [Fri, 21 Jul 2017 12:36:08 +0000 (14:36 +0200)]
ldb: version 1.2.1

* Bug #12882: Do not install _ldb_text.py if we have system libldb
* Use libraries from build dir for testsuite
* Bug #12900: Fix index out of bound in ldb_msg_find_common_values

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Sat Jul 22 03:46:25 CEST 2017 on sn-devel-144

6 years agotevent: version 0.9.33 tevent-0.9.33
Stefan Metzmacher [Fri, 21 Jul 2017 12:34:59 +0000 (14:34 +0200)]
tevent: version 0.9.33

* make tevent_req_print() more robust against crashes

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agotevent: handle passing req = NULL to tevent_req_print()
Stefan Metzmacher [Thu, 20 Jul 2017 12:20:03 +0000 (14:20 +0200)]
tevent: handle passing req = NULL to tevent_req_print()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agotevent: avoid calling talloc_get_name(NULL) in tevent_req_default_print()
Stefan Metzmacher [Thu, 20 Jul 2017 12:16:44 +0000 (14:16 +0200)]
tevent: avoid calling talloc_get_name(NULL) in tevent_req_default_print()

We have the same information available under req->internal.private_type.

This way it's possible to call tevent_req_print() after
tevent_req_received() was called.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agotalloc: version 2.1.10 talloc-2.1.10
Stefan Metzmacher [Fri, 21 Jul 2017 12:33:57 +0000 (14:33 +0200)]
talloc: version 2.1.10

* build, documentation and python3 improvements

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agos4:http/gensec: add missing tevent_req_done() to gensec_http_ntlm_update_done()
Stefan Metzmacher [Thu, 20 Jul 2017 09:56:21 +0000 (11:56 +0200)]
s4:http/gensec: add missing tevent_req_done() to gensec_http_ntlm_update_done()

This was missing in commit d718e92d5e145dccd492c46febc249e462ce50c6.

Sadly we can't have automated tests for this as we only implement
the client side for this protocol.

I've tested with using:

bin/smbtorture \
  -W BLA --realm=BLA.BASE \
  -s /dev/null -Uadministrator%A1b2C3d4 \
  ncacn_http:w2k8r2-219[593,RpcProxy=w2k8r2-219.bla.base,HttpUseTls=false,HttpAuthOption=basic] \
  rpc.epmapper.epmapper.Lookup_simple \

and:

bin/smbtorture \
  -W BLA --realm=BLA.BASE \
  -s /dev/null -Uadministrator%A1b2C3d4 \
  ncacn_http:w2k8r2-219[593,RpcProxy=w2k8r2-219.bla.base,HttpUseTls=false,HttpAuthOption=ntlm] \
  rpc.epmapper.epmapper.Lookup_simple \

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

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 Jul 21 23:29:39 CEST 2017 on sn-devel-144

6 years agowinbindd: avoid refreshing sequence number when domain is offline
Uri Simchoni [Wed, 7 Jun 2017 17:34:33 +0000 (20:34 +0300)]
winbindd: avoid refreshing sequence number when domain is offline

When there's no connectivity to the domain, avoid attempt to
refresh sequence number. Before the change, this was avoided
only if winbind offline logon was enabled. However, being
able to operate based on cached data is desired even when
offline logons are disabled (offline logons are about caching
credentials for PAM authentication, a user may not want this
and still want service from the SMB server during short
AD disconnects).

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agowinbindd: queryuser - only get group name if needed
Uri Simchoni [Wed, 7 Jun 2017 17:33:57 +0000 (20:33 +0300)]
winbindd: queryuser - only get group name if needed

When calculating the user entry for a user, the
primary group id *name* might be needed if it is
part of a home dir / shell template (%g or %G).

Only resolve primary group SID to primary group name
if it is needed, thereby saving a round-trip to the DC
(and better handling situations where it is disconnected).

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agowinbindd: cache name-to-sid from PAC based on lookup domain
Uri Simchoni [Wed, 7 Jun 2017 17:33:24 +0000 (20:33 +0300)]
winbindd: cache name-to-sid from PAC based on lookup domain

The name-to-sid lookup for trusted domains is not necessarily
done against the domain - in AD member case it is done
against the primary domain. Therefore the caching should also
be done against the lookup domain.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_ceph: fix cephwrap_chdir()
David Disseldorp [Fri, 14 Jul 2017 21:55:29 +0000 (23:55 +0200)]
vfs_ceph: fix cephwrap_chdir()

When provided a '/' path (i.e. CephFS root), vfs_ceph does a *local*
chdir() to the share path. This breaks smb client directory listings.

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

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Jul 21 19:10:46 CEST 2017 on sn-devel-144

6 years agoselftest: Add test for password change when NTLM is disabled
Tim Beale [Tue, 4 Jul 2017 05:27:27 +0000 (17:27 +1200)]
selftest: Add test for password change when NTLM is disabled

When NTLM is disabled, the server should reject NTLM-based password
changes. Changing the password is a bit complicated from python, but
because the server should reject the password change outright with
NTLM_BLOCKED, the test doesn't actually need to provide valid
credentials.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11923
Signed-off-by: Tim Beale <timbeale@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): Fri Jul 21 13:54:35 CEST 2017 on sn-devel-144

6 years agogetncchanges: Do not segfault if somehow we get 0 results from an ldb_search with...
Andrew Bartlett [Thu, 20 Apr 2017 02:00:21 +0000 (14:00 +1200)]
getncchanges: Do not segfault if somehow we get 0 results from an ldb_search with scope BASE

This should not happen, but we have seen this happen in autobuild
before the whole-DB locking issues were resolved by
https://bugzilla.samba.org/show_bug.cgi?id=12858

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
6 years agobuild: fix ceph_statx check when configured with libcephfs_dir
David Disseldorp [Thu, 20 Jul 2017 09:10:57 +0000 (11:10 +0200)]
build: fix ceph_statx check when configured with libcephfs_dir

When configured with a custom libcephfs_dir, the ceph_statx check fails
to link. This is due to the location of the ceph-common dependency,
which is installed under a ceph subdirectory.

ceph/build > make DESTDIR=./inst install
...
ceph/build > find inst/|grep -e /libcephfs -e /libceph-common
inst/usr/local/lib64/ceph/libceph-common.so.0
inst/usr/local/lib64/ceph/libceph-common.so
inst/usr/local/lib64/libcephfs.so.2.0.0
inst/usr/local/lib64/libcephfs.so.2
inst/usr/local/lib64/libcephfs.so
inst/usr/local/include/cephfs/libcephfs.h

Signed-off-by: David Disseldorp <ddiss@suse.de>
Reviewed-by: Jeff Layton <jlayton@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Thu Jul 20 23:02:27 CEST 2017 on sn-devel-144

6 years agos3/utils: smbcacls failed to detect DIRECTORIES using SMB2 (windows only)
Noel Power [Thu, 20 Jul 2017 12:01:50 +0000 (13:01 +0100)]
s3/utils: smbcacls failed to detect DIRECTORIES using SMB2 (windows only)

uint16_t get_fileinfo(...) returns file attributes, this function
called

     cli_qfileinfo_basic(cli, fnum, &mode, NULL, NULL, NULL,
                     NULL, NULL, NULL);

which was failing with NT_STATUS_ACCESS_DENIED errors when fnum above
was obtained via (when using protocol > SMB). Note: This only seems to be
an issue when run against a windows server, with smbd SMB1 & SMB2 work fine.

    status = cli_ntcreate(cli, filename, 0, CREATE_ACCESS_READ,
                  0, FILE_SHARE_READ|FILE_SHARE_WRITE,
                  FILE_OPEN, 0x0, 0x0, &fnum, NULL);

The failing cli_qfileinfo_basic call above is unnecessary as we can already
obtain the required information from the cli_ntcreate call

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
6 years agos4-torture: point out why we cannot validate MSZIP compressed files
Günther Deschner [Tue, 23 May 2017 13:50:55 +0000 (15:50 +0200)]
s4-torture: point out why we cannot validate MSZIP compressed files

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jul 20 01:38:02 CEST 2017 on sn-devel-144

6 years agolibrpc/ndr: add MSZIP compression for cabinet files
Aurelien Aptel [Tue, 23 May 2017 10:09:28 +0000 (12:09 +0200)]
librpc/ndr: add MSZIP compression for cabinet files

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agolibrpc/ndr: simplify cabinet file size calculation
Aurelien Aptel [Tue, 23 May 2017 13:41:24 +0000 (15:41 +0200)]
librpc/ndr: simplify cabinet file size calculation

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agolibrpc/ndr: Use correct value for max compression size
Andreas Schneider [Wed, 21 Jun 2017 15:01:43 +0000 (17:01 +0200)]
librpc/ndr: Use correct value for max compression size

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agolibrpc/ndr: Use MAX_WBITS zlib define and change memLevel in MSZIP code
Günther Deschner [Tue, 23 May 2017 13:48:42 +0000 (15:48 +0200)]
librpc/ndr: Use MAX_WBITS zlib define and change memLevel in MSZIP code

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agolibrpc/ndr: remove unused ndr_cab_get_compression() function
Aurelien Aptel [Tue, 23 May 2017 13:37:13 +0000 (15:37 +0200)]
librpc/ndr: remove unused ndr_cab_get_compression() function

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agolibrpc: use DATA_BLOB in CFDATA structure
Aurelien Aptel [Tue, 23 May 2017 13:31:44 +0000 (15:31 +0200)]
librpc: use DATA_BLOB in CFDATA structure

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agolibrpc/ndr: add helper functions to setup and free compression states.
Aurelien Aptel [Tue, 23 May 2017 10:02:33 +0000 (12:02 +0200)]
librpc/ndr: add helper functions to setup and free compression states.

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agolibrpc/ndr: add new MSZIP compression type for cabinet files
Günther Deschner [Tue, 23 May 2017 10:02:10 +0000 (12:02 +0200)]
librpc/ndr: add new MSZIP compression type for cabinet files

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agolibrpc/ndr: add new ndr_compression_state
Aurelien Aptel [Tue, 23 May 2017 09:59:59 +0000 (11:59 +0200)]
librpc/ndr: add new ndr_compression_state

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agolibndr/compression: pass down compressed length in ndr_pull_compression_start
Günther Deschner [Mon, 19 Sep 2016 22:18:43 +0000 (00:18 +0200)]
libndr/compression: pass down compressed length in ndr_pull_compression_start

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agolibrpc/ndr: remove trailing whitespace from compression file.
Aurelien Aptel [Tue, 24 Jan 2017 18:00:53 +0000 (19:00 +0100)]
librpc/ndr: remove trailing whitespace from compression file.

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agolibrpc:ndr_cab: Cast data pointer correctly
Andreas Schneider [Tue, 9 May 2017 14:51:43 +0000 (16:51 +0200)]
librpc:ndr_cab: Cast data pointer correctly

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agondr_compression: use MAX_WBITS constant
Aurelien Aptel [Fri, 30 Jun 2017 13:07:31 +0000 (15:07 +0200)]
ndr_compression: use MAX_WBITS constant

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agosmbd: Fix a connection run-down race condition
Volker Lendecke [Wed, 19 Jul 2017 12:51:33 +0000 (14:51 +0200)]
smbd: Fix a connection run-down race condition

When we do a server exit with active aio jobs, we need to keep the
aio state active for the helper thread. Right now I don't see another
chance than to leak memory in this case. And, I don't really oversee
how cancelling requests works in this case, but this does fix crashes
seen at a customer site.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agoexamples: add winbindd.stp and a shell script to generate it
Ralph Boehme [Fri, 30 Jun 2017 17:37:03 +0000 (19:37 +0200)]
examples: add winbindd.stp and a shell script to generate it

Usage:

  Instrument all winbindd processes:
  # stap winbindd.stp

  Instrument a specific winbindd process:
  # stap -x PID winbindd.stp

Example output:

  # stap winbindd.stp
  Collecting data, press ctrl-C to stop... ^C

  Winbind request service time
  ============================
  winbindd_getpwnam_send                   count:    99, sum:   6229 ms (min:   2669 us, avg:  62921 us, max: 157907 us)

  Winbind request runtime
  =======================
  winbindd_getpwnam_send                   count:    99, sum:      3 ms (min:     21 us, avg:     36 us, max:     77 us)

  Winbind domain-child request service time
  =========================================
  _wbint_LookupName                        count:    99, sum:   1403 ms (min:    619 us, avg:  14181 us, max: 136613 us)
  _wbint_GetNssInfo                        count:    99, sum:      0 ms (min:      2 us, avg:      3 us, max:      6 us)
  _wbint_LookupSid                         count:   102, sum:     49 ms (min:     13 us, avg:    481 us, max:   6315 us)
  _wbint_Sids2UnixIDs                      count:   101, sum:      2 ms (min:     18 us, avg:     29 us, max:     49 us)
  _wbint_LookupSids                        count:   101, sum:     84 ms (min:    411 us, avg:    838 us, max:   3524 us)

  Winbind domain-child AD-backend service time
  ============================================
  sid_to_name                              count:    56, sum:     45 ms (min:    431 us, avg:    816 us, max:   6275 us)
  sequence_number                          count:    12, sum:   1209 ms (min:  46618 us, avg: 100803 us, max: 131439 us)
  name_to_sid                              count:    99, sum:    176 ms (min:    547 us, avg:   1781 us, max:   9866 us)

  ...

Regenerate winbindd.stp:

  $ examples/systemtap/generate-winbindd.stp.sh

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Jul 19 16:20:56 CEST 2017 on sn-devel-144

6 years agoexamples: add gencache.stp
Ralph Boehme [Fri, 30 Jun 2017 10:59:37 +0000 (12:59 +0200)]
examples: add gencache.stp

Add a Systemtap script to profile gencache.

Usage:

- profile a single smbd process:
  # stap -x 22225 gencache.stp smbd

- profile all winbindd proceses:
  # stap gencache.stp winbindd

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
6 years agodbwrap_ctdb: Fix calculation of persistent flag
Amitay Isaacs [Wed, 19 Jul 2017 02:04:35 +0000 (12:04 +1000)]
dbwrap_ctdb: Fix calculation of persistent flag

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
6 years agos3:tests: Fix directory creation and deletion of test_nosymlinks()
Andreas Schneider [Tue, 18 Jul 2017 10:29:16 +0000 (12:29 +0200)]
s3:tests: Fix directory creation and deletion of test_nosymlinks()

This should fix flakey autobuild.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jul 19 11:59:52 CEST 2017 on sn-devel-144

6 years agos3:tests: Fix directory creation and deletion of test_local_symlinks()
Andreas Schneider [Tue, 18 Jul 2017 10:03:32 +0000 (12:03 +0200)]
s3:tests: Fix directory creation and deletion of test_local_symlinks()

This should fix flakey autobuild.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agodocs: Fix a typo in cifsdd.8
Samba-JP oota [Tue, 18 Jul 2017 09:06:58 +0000 (11:06 +0200)]
docs: Fix a typo in cifsdd.8

Signed-off-by: Samba-JP oota <ribbon@samba.gr.jp>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Jul 18 18:35:16 CEST 2017 on sn-devel-144

6 years agos3: smbclient: Add a test for the setmode command.
Jeremy Allison [Fri, 14 Jul 2017 23:09:50 +0000 (16:09 -0700)]
s3: smbclient: Add a test for the setmode command.

Tested over SMB1 and SMB2.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jul 18 14:05:18 CEST 2017 on sn-devel-144

6 years agos3: libsmb: Reverse sense of 'clear all attributes', ignore attribute change in SMB2...
Jeremy Allison [Mon, 17 Jul 2017 17:37:15 +0000 (10:37 -0700)]
s3: libsmb: Reverse sense of 'clear all attributes', ignore attribute change in SMB2 to match SMB1.

SMB1 uses attr == 0 to clear all attributes
on a file (end up with FILE_ATTRIBUTE_NORMAL),
and attr == FILE_ATTRIBUTE_NORMAL to mean ignore
request attribute change.

SMB2 uses exactly the reverse. Unfortunately as the
cli_setatr() ABI is exposed inside libsmbclient,
we must make the SMB2 cli_smb2_setatr() call
export the same ABI as the SMB1 cli_setatr()
which calls it. This means reversing the sense
of the requested attr argument if it's zero
or FILE_ATTRIBUTE_NORMAL.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
6 years agoRevert "s3:smbclient: Allow last dos attribute to be cleared"
Jeremy Allison [Mon, 17 Jul 2017 17:38:36 +0000 (10:38 -0700)]
Revert "s3:smbclient: Allow last dos attribute to be cleared"

Incorrect fix - this must be fixed inside cli_setatr(), not
the callers.

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

This reverts commit a4c3ee6767d768365a47bfda32a26cb7994b3787.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
6 years agos3:client: The smbspool krb5 wrapper needs negotiate for authentication
Andreas Schneider [Fri, 7 Jul 2017 12:08:49 +0000 (14:08 +0200)]
s3:client: The smbspool krb5 wrapper needs negotiate for authentication

If you create a new printer it doesn't have AuthInfoRequired set and so
cups calls the backend with:

  AUTH_INFO_REQUIRED=none

In this case we need to return:

  ATTR: auth-info-required=negotiate

and return an error that we require authentication.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Jul 15 06:43:47 CEST 2017 on sn-devel-144

6 years agos3: smbd: Fix a read after free if a chained SMB1 call goes async.
Jeremy Allison [Thu, 13 Jul 2017 19:06:58 +0000 (12:06 -0700)]
s3: smbd: Fix a read after free if a chained SMB1 call goes async.

Reported to the Samba Team by Yihan Lian <lianyihan@360.cn>, a security
researcher of Qihoo 360 GearTeam. Thanks a lot!

smb1_parse_chain() incorrectly used talloc_tos() for the memory
context of the chained smb1 requests. This gets freed between
requests so if a chained request goes async, the saved request
array also is freed, which causes a crash on resume.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
6 years agos3/notifyd: ensure notifyd doesn't return from smbd_notifyd_init
Ralph Boehme [Fri, 14 Jul 2017 14:38:36 +0000 (16:38 +0200)]
s3/notifyd: ensure notifyd doesn't return from smbd_notifyd_init

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agos3: drop build_env
Bernhard M. Wiedemann [Mon, 10 Jul 2017 16:29:41 +0000 (18:29 +0200)]
s3: drop build_env

As a follow up to eedebe2ef1b ("docs-xml: Sort input file list"), this
change enables reproducible builds, without the added complexity of
https://lists.samba.org/archive/samba-technical/2017-June/121302.html

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

Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Jul 14 18:48:08 CEST 2017 on sn-devel-144

6 years agoBuild py3 versions of other rpc modules
Alexander Bokovoy [Thu, 13 Jul 2017 11:49:12 +0000 (14:49 +0300)]
Build py3 versions of other rpc modules

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

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Fri Jul 14 11:36:53 CEST 2017 on sn-devel-144

6 years agopy3: Make sure to specify METH_VARARGS together with METH_KEYWORDS
Alexander Bokovoy [Thu, 13 Jul 2017 12:37:47 +0000 (15:37 +0300)]
py3: Make sure to specify METH_VARARGS together with METH_KEYWORDS

A Python 3 bug https://bugs.python.org/issue15657 explains that one should
always use METH_VARARGS|METH_KEYWORDS when defining a function rather
than a lonely METH_KEYWORDS. We had only one definition like this in
Samba and it was the one that affects FreeIPA when running in Python 3
mode.

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

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos3:smbclient: Allow last dos attribute to be cleared
Steve French [Thu, 13 Jul 2017 18:57:53 +0000 (13:57 -0500)]
s3:smbclient: Allow last dos attribute to be cleared

With the upgrade to SMB3.1.1 from cifs for smbclient,
setmode no longer works when removing attributes,
if the resultant attribute is 0 it is skipped
(unlike for the old cifs setpathinfo).

When clearing the final attribute, pass in ATTRIBUTE_NORMAL
instead of zero.

This also removes a redundant cli_setatr call
when clearing attributes (cli_setatr was being called
twice).

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

Signed-off-by: Steve French <sfrench@samba.org>
Reviewed-by: Anne Marie Merritt <annemarie.merritt@primarydata.com>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jul 14 02:43:47 CEST 2017 on sn-devel-144

6 years agovfs_fruit: don't use MS NFS ACEs with Windows clients
Ralph Boehme [Wed, 12 Jul 2017 07:33:59 +0000 (09:33 +0200)]
vfs_fruit: don't use MS NFS ACEs with Windows clients

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Thu Jul 13 22:21:08 CEST 2017 on sn-devel-144

6 years agoctdb-docs: Update documentation of ipreallocated event
Martin Schwenke [Wed, 12 Jul 2017 02:22:10 +0000 (12:22 +1000)]
ctdb-docs: Update documentation of ipreallocated event

This was out of date due to the removal of service_check_reconfigure()
and similar.

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): Thu Jul 13 17:57:11 CEST 2017 on sn-devel-144

6 years agoctdb-common: Set close-on-exec when creating PID file
Martin Schwenke [Wed, 12 Jul 2017 03:41:17 +0000 (13:41 +1000)]
ctdb-common: Set close-on-exec when creating PID file

Otherwise, for example, the file descriptor for the main PID file will
leak all the way down to event scripts.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agolibwbclient: Fix CID 1414781 Dereference null return value
Volker Lendecke [Tue, 11 Jul 2017 14:04:01 +0000 (16:04 +0200)]
libwbclient: Fix CID 1414781 Dereference null return value

Basically a cut&paste error from somewhere else

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Jul 12 22:12:22 CEST 2017 on sn-devel-144

6 years agospoolss: Fix CID 1414784 Uninitialized scalar variable
Volker Lendecke [Tue, 11 Jul 2017 11:50:09 +0000 (13:50 +0200)]
spoolss: Fix CID 1414784 Uninitialized scalar variable

"struct tm" can contain more members than we explicitly initialize.

Initialize them all.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agoCVE-2017-11103: Orpheus' Lyre KDC-REP service name validation
Jeffrey Altman [Wed, 12 Apr 2017 19:40:42 +0000 (15:40 -0400)]
CVE-2017-11103: Orpheus' Lyre KDC-REP service name validation

In _krb5_extract_ticket() the KDC-REP service name must be obtained from
encrypted version stored in 'enc_part' instead of the unencrypted version
stored in 'ticket'.  Use of the unecrypted version provides an
opportunity for successful server impersonation and other attacks.

Identified by Jeffrey Altman, Viktor Duchovni and Nico Williams.

Change-Id: I45ef61e8a46e0f6588d64b5bd572a24c7432547c

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12894
(based on heimdal commit 6dd3eb836bbb80a00ffced4ad57077a1cdf227ea)

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Jul 12 17:44:50 CEST 2017 on sn-devel-144

6 years agodbwrap: Ask CTDB for local tdb open flags
Ralph Boehme [Tue, 11 Jul 2017 19:35:17 +0000 (21:35 +0200)]
dbwrap: Ask CTDB for local tdb open flags

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Jul 12 13:25:11 CEST 2017 on sn-devel-144

6 years agoctdbd_conn: pass persistent bool instead of tdb_flags
Ralph Boehme [Tue, 11 Jul 2017 18:41:43 +0000 (20:41 +0200)]
ctdbd_conn: pass persistent bool instead of tdb_flags

ctdbd_db_attach() only needs to know the ctdb database model, not the
rest of the flags.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdbd_conn: move CTDB_CONTROL_ENABLE_SEQNUM control to db_open_ctdb
Ralph Boehme [Tue, 11 Jul 2017 18:36:35 +0000 (20:36 +0200)]
ctdbd_conn: move CTDB_CONTROL_ENABLE_SEQNUM control to db_open_ctdb

No change in behaviour.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agodbwrap: CTDB ignores tdb_flags passed to db attach controls
Amitay Isaacs [Mon, 10 Jul 2017 14:38:59 +0000 (00:38 +1000)]
dbwrap: CTDB ignores tdb_flags passed to db attach controls

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
6 years agodbwrap: enable mutexes by default for volatile TDBs
Ralph Boehme [Sun, 9 Jul 2017 14:23:20 +0000 (16:23 +0200)]
dbwrap: enable mutexes by default for volatile TDBs

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdb: enable mutexes for volatile TDBs by default
Ralph Boehme [Sun, 9 Jul 2017 14:20:11 +0000 (16:20 +0200)]
ctdb: enable mutexes for volatile TDBs by default

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoidmap_ad: Retry query_user exactly once if we get TLDAP_SERVER_DOWN
Dustin L. Howett via samba-technical [Fri, 30 Jun 2017 23:10:01 +0000 (16:10 -0700)]
idmap_ad: Retry query_user exactly once if we get TLDAP_SERVER_DOWN

All other ldap-querying methods in idmap_ad make a single retry attempt if they get
TLDAP_SERVER_DOWN. This patch brings idmap_ad_query_user in line with that design.

This fixes the symptom described in 12720 at the cost of an additional reconnect per
failed lookup.

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

Signed-off-by: Dustin L. Howett <dustin@howett.net>
Reviewed-by: Ralph Boehme <slow@samba.org>
6 years agoselftest: add some basic tests for idmap_ad
Ralph Boehme [Mon, 10 Jul 2017 14:20:23 +0000 (16:20 +0200)]
selftest: add some basic tests for idmap_ad

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoselftest: add ad_member_idmap_ad server
Ralph Boehme [Mon, 10 Jul 2017 14:19:18 +0000 (16:19 +0200)]
selftest: add ad_member_idmap_ad server

Add a member server that uses idmap_ad. Gets used in the next commit.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agovfs_fruit: add fruit:model = <modelname> parametric option
Günther Deschner [Wed, 28 Jun 2017 16:10:28 +0000 (18:10 +0200)]
vfs_fruit: add fruit:model = <modelname> parametric option

fruit:model = iMac
fruit:model = MacBook
fruit:model = MacPro
fruit:model = Xserve

will all display a different icon inside Finder.

Formerly, we used "Samba" which resulted in a "?" icon in Finder, with
the new default "MacSamba" we appear with a computer box icon at least.

Guenther

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

Signed-off-by: Guenther Deschner <gd@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Jul 12 03:17:57 CEST 2017 on sn-devel-144

6 years agoctdb-scripts: Fix inline comments in 10.interface
Anoop C S [Wed, 5 Jul 2017 13:37:04 +0000 (19:07 +0530)]
ctdb-scripts: Fix inline comments in 10.interface

Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Tue Jul 11 11:45:04 CEST 2017 on sn-devel-144

6 years agos3/vfs: rename SMB_VFS_STRICT_LOCK to SMB_VFS_STRICT_LOCK_CHECK
Ralph Boehme [Sun, 9 Jul 2017 12:34:10 +0000 (14:34 +0200)]
s3/vfs: rename SMB_VFS_STRICT_LOCK to SMB_VFS_STRICT_LOCK_CHECK

As per MS-SMB2 and MS-FSA and our SMB_VFS_STRICT_LOCK implementation,
we're merely testing for locks, not setting any.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jul 11 03:37:44 CEST 2017 on sn-devel-144

6 years agos3/vfs: remove SMB_VFS_STRICT_UNLOCK
Ralph Boehme [Sun, 9 Jul 2017 12:21:21 +0000 (14:21 +0200)]
s3/vfs: remove SMB_VFS_STRICT_UNLOCK

It's just a noop, so let's remove it. SMB_VFS_STRICT_LOCK doesn't set
logs, it just checks for the presence of incompatible locks.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agos3:smbd: consistently use talloc_tos() memory for rpc_pipe_open_interface()
Stefan Metzmacher [Mon, 10 Jul 2017 09:29:58 +0000 (11:29 +0200)]
s3:smbd: consistently use talloc_tos() memory for rpc_pipe_open_interface()

The result is only used temporary and should not be leaked on a long term
memory context as 'conn'.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_fruit: fix a typo
Ralph Boehme [Sun, 9 Jul 2017 06:32:16 +0000 (08:32 +0200)]
vfs_fruit: fix a typo

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Jul 10 16:48:24 CEST 2017 on sn-devel-144

6 years agodelete duplicate test
Herb Lewis [Fri, 7 Jul 2017 20:10:54 +0000 (13:10 -0700)]
delete duplicate test

Signed-off-by: Herb Lewis <herb@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Autobuild-User(master): Herb Lewis <herb@samba.org>
Autobuild-Date(master): Sat Jul  8 05:57:55 CEST 2017 on sn-devel-144

6 years agoselftest: add a test for accessing previous version of directories with snapdirsevery...
Ralph Boehme [Fri, 7 Jul 2017 11:12:19 +0000 (13:12 +0200)]
selftest: add a test for accessing previous version of directories with snapdirseverywhere

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Sat Jul  8 00:33:51 CEST 2017 on sn-devel-144

6 years agos3/smbd: let non_widelink_open() chdir() to directories directly
Ralph Boehme [Fri, 7 Jul 2017 10:57:57 +0000 (12:57 +0200)]
s3/smbd: let non_widelink_open() chdir() to directories directly

If the caller passes O_DIRECTORY we just try to chdir() to smb_fname
directly, not to the parent directory.

The security check in check_reduced_name() will continue to work, but
this fixes the case of an open() for a previous version of a
subdirectory that contains snapshopt.

Eg:

[share]
    path = /shares/test
    vfs objects = shadow_copy2
    shadow:snapdir = .snapshots
    shadow:snapdirseverywhere = yes

Directory tree with fake snapshots:

$ tree -a /shares/test/
/shares/test/
├── dir
│   ├── file
│   └── .snapshots
│       └── @GMT-2017.07.04-04.30.12
│           └── file
├── dir2
│   └── file
├── file
├── .snapshots
│   └── @GMT-2001.01.01-00.00.00
│       ├── dir2
│       │   └── file
│       └── file
└── testfsctl.dat

./bin/smbclient -U slow%x //localhost/share -c 'ls @GMT-2017.07.04-04.30.12/dir/*'
NT_STATUS_OBJECT_NAME_NOT_FOUND listing \@GMT-2017.07.04-04.30.12\dir\*

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agoldb/tests: more thoroughly test empty ldb_msg elements
Douglas Bagnall [Thu, 6 Jul 2017 00:41:07 +0000 (12:41 +1200)]
ldb/tests: more thoroughly test empty ldb_msg elements

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jul  7 20:10:37 CEST 2017 on sn-devel-144

6 years agoldb: avoid searching empty lists in ldb_msg_find_common_values
Douglas Bagnall [Wed, 5 Jul 2017 22:01:24 +0000 (10:01 +1200)]
ldb: avoid searching empty lists in ldb_msg_find_common_values

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agoldb: Fix index out of bound in ldb_msg_find_common_values
Lukas Slebodnik [Tue, 4 Jul 2017 13:46:49 +0000 (15:46 +0200)]
ldb: Fix index out of bound in ldb_msg_find_common_values

cmocka unit test failed on i386
[==========] Running 2 test(s).
[ RUN      ] test_ldb_msg_find_duplicate_val
[       OK ] test_ldb_msg_find_duplicate_val
[ RUN      ] test_ldb_msg_find_common_values
[  FAILED  ] test_ldb_msg_find_common_values
[==========] 2 test(s) run.
[  ERROR   ] --- 0x14 != 0
[   LINE   ] --- ../tests/ldb_msg.c:266: error: Failure!
[  PASSED  ] 1 test(s).
[  FAILED  ] 1 test(s), listed below:
[  FAILED  ] test_ldb_msg_find_common_values
 1 FAILED TEST(S)

But we were just lucky on other platforms because there is
index out of bound according to valgrind error.

==3298== Invalid read of size 4
==3298==    at 0x486FCF6: ldb_val_cmp (ldb_msg.c:95)
==3298==    by 0x486FCF6: ldb_msg_find_common_values (ldb_msg.c:266)
==3298==    by 0x109A3D: test_ldb_msg_find_common_values (ldb_msg.c:265)
==3298==    by 0x48E7490: ??? (in /usr/lib/libcmocka.so.0.4.1)
==3298==    by 0x48E7EB0: _cmocka_run_group_tests (in /usr/lib/libcmocka.so.0.4.1)
==3298==    by 0x1089B7: main (ldb_msg.c:352)
==3298==  Address 0x4b07734 is 4 bytes after a block of size 48 alloc'd
==3298==    at 0x483223E: malloc (vg_replace_malloc.c:299)
==3298==    by 0x4907AA7: _talloc_array (in /usr/lib/libtalloc.so.2.1.9)
==3298==    by 0x486FBF8: ldb_msg_find_common_values (ldb_msg.c:245)
==3298==    by 0x109A3D: test_ldb_msg_find_common_values (ldb_msg.c:265)
==3298==    by 0x48E7490: ??? (in /usr/lib/libcmocka.so.0.4.1)
==3298==    by 0x48E7EB0: _cmocka_run_group_tests (in /usr/lib/libcmocka.so.0.4.1)
==3298==    by 0x1089B7: main (ldb_msg.c:352)

Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agos3: tests: Add test for new smbclient "deltree" command.
Jeremy Allison [Thu, 6 Jul 2017 17:52:45 +0000 (10:52 -0700)]
s3: tests: Add test for new smbclient "deltree" command.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jul  7 13:38:24 CEST 2017 on sn-devel-144

6 years agodocs: Document new smbclient deltree command.
Jeremy Allison [Thu, 6 Jul 2017 00:23:48 +0000 (17:23 -0700)]
docs: Document new smbclient deltree command.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agos3: smbclient: Add new command deltree.
Jeremy Allison [Thu, 6 Jul 2017 00:21:18 +0000 (17:21 -0700)]
s3: smbclient: Add new command deltree.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agos3: client: Move struct file_list code to using talloc from malloc.
Jeremy Allison [Wed, 5 Jul 2017 22:53:07 +0000 (15:53 -0700)]
s3: client: Move struct file_list code to using talloc from malloc.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agowaf: Do not install _ldb_text.py if we have system libldb
Andreas Schneider [Thu, 6 Jul 2017 05:44:28 +0000 (07:44 +0200)]
waf: Do not install _ldb_text.py if we have system libldb

_ldb_text.py is installed as part of the ldb package and also if you
compile Samba with the system ldb version. This way we have have the
file twice in the same location and run into file confilcts.

This has already been fixed some time ago:
    60dc26bfe1573265dcbd87b9dd3439f945e57d97

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
6 years agomessaging: Remove messaging_handler_send
Volker Lendecke [Sat, 24 Jun 2017 07:01:46 +0000 (09:01 +0200)]
messaging: Remove messaging_handler_send

This did not really take off, notifyd was the only user

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): Fri Jul  7 05:11:48 CEST 2017 on sn-devel-144

6 years agonotifyd: Remove notifyd_handler_done
Volker Lendecke [Sat, 24 Jun 2017 06:57:18 +0000 (08:57 +0200)]
notifyd: Remove notifyd_handler_done

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agonotifyd: Use messaging_register for MSG_SMB_NOTIFY_DB
Volker Lendecke [Sat, 24 Jun 2017 06:56:35 +0000 (08:56 +0200)]
notifyd: Use messaging_register for MSG_SMB_NOTIFY_DB

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agonotifyd: Use messaging_register for MSG_SMB_NOTIFY_GET_DB
Volker Lendecke [Sat, 24 Jun 2017 06:48:45 +0000 (08:48 +0200)]
notifyd: Use messaging_register for MSG_SMB_NOTIFY_GET_DB

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agonotifyd: Use messaging_register for MSG_SMB_NOTIFY_TRIGGER
Volker Lendecke [Sat, 24 Jun 2017 06:45:17 +0000 (08:45 +0200)]
notifyd: Use messaging_register for MSG_SMB_NOTIFY_TRIGGER

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agonotifyd: Use messaging_register for MSG_SMB_NOTIFY_REC_CHANGE
Volker Lendecke [Sat, 24 Jun 2017 06:38:53 +0000 (08:38 +0200)]
notifyd: Use messaging_register for MSG_SMB_NOTIFY_REC_CHANGE

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agomessaging: make messaging_rec_create public
Volker Lendecke [Sat, 24 Jun 2017 06:38:19 +0000 (08:38 +0200)]
messaging: make messaging_rec_create public

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agonotifyd: Avoid an if-expression
Volker Lendecke [Wed, 5 Jul 2017 07:37:14 +0000 (09:37 +0200)]
notifyd: Avoid an if-expression

Best reviewed with "git show -b -U10"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agonotifyd: Consolidate two #ifdef CLUSTER into one
Volker Lendecke [Wed, 5 Jul 2017 07:34:51 +0000 (09:34 +0200)]
notifyd: Consolidate two #ifdef CLUSTER into one

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agonotifyd: Only ask for messaging_ctdb_conn when clustering
Volker Lendecke [Fri, 16 Jun 2017 13:20:22 +0000 (15:20 +0200)]
notifyd: Only ask for messaging_ctdb_conn when clustering

Without clustering, messaging_ctdb_conn will fail anyway.

Review with "git show -b".

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agoAdd support for passing the max_referral_level into the cli call to get a DFS referra...
Richard Sharpe [Mon, 26 Jun 2017 16:43:31 +0000 (09:43 -0700)]
Add support for passing the max_referral_level into the cli call to get a DFS referral. This is being done so I can write tests of the DFS referral code on the server side.

Signed-off-by: Richard Sharpe <richard.sharpe@primarydata.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agounittests: Do not install the test_dummy rpc module
Andreas Schneider [Wed, 5 Jul 2017 08:30:35 +0000 (10:30 +0200)]
unittests: Do not install the test_dummy rpc module

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Jul  5 22:21:06 CEST 2017 on sn-devel-144

6 years agounittests: Add missing stdint.h include
Andreas Schneider [Wed, 5 Jul 2017 06:59:23 +0000 (08:59 +0200)]
unittests: Add missing stdint.h include

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
6 years agowaf: Only build unit tests with selftest enabled
Andreas Schneider [Wed, 5 Jul 2017 08:08:49 +0000 (10:08 +0200)]
waf: Only build unit tests with selftest enabled

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
6 years agoAdd code to run the tests for 'samba-tool user edit'
Rowland Penny [Tue, 4 Jul 2017 14:07:53 +0000 (15:07 +0100)]
Add code to run the tests for 'samba-tool user edit'

Signed-off-by: Rowland Penny <rpenny@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Wed Jul  5 17:53:24 CEST 2017 on sn-devel-144

6 years agoAdd test for 'samba-tool user edit'
Rowland Penny [Tue, 4 Jul 2017 14:04:36 +0000 (15:04 +0100)]
Add test for 'samba-tool user edit'

Signed-off-by: Rowland Penny <rpenny@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
6 years agoEasily edit a users object in AD, as if using ldbedit.
Rowland Penny [Tue, 4 Jul 2017 14:00:58 +0000 (15:00 +0100)]
Easily edit a users object in AD, as if using ldbedit.

Signed-off-by: Rowland Penny <rpenny@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
6 years agoauth/spnego: pass spnego_in to gensec_spnego_parse_negTokenInit()
Stefan Metzmacher [Fri, 30 Dec 2016 15:06:49 +0000 (16:06 +0100)]
auth/spnego: pass spnego_in to gensec_spnego_parse_negTokenInit()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Jul  5 06:43:17 CEST 2017 on sn-devel-144

6 years agoauth/spnego: remove useless indentation level for SPNEGO_SERVER_START
Stefan Metzmacher [Tue, 13 Jun 2017 21:56:47 +0000 (23:56 +0200)]
auth/spnego: remove useless indentation level for SPNEGO_SERVER_START

Check with git show -w

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agoauth/spnego: move SERVER gensec_spnego_create_negTokenInit() handling to the top
Stefan Metzmacher [Tue, 13 Jun 2017 21:55:00 +0000 (23:55 +0200)]
auth/spnego: move SERVER gensec_spnego_create_negTokenInit() handling to the top

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agoauth/spnego: set spnego_state->{state_position,expected_packet} gensec_spnego_create_...
Stefan Metzmacher [Thu, 29 Jun 2017 14:55:09 +0000 (16:55 +0200)]
auth/spnego: set spnego_state->{state_position,expected_packet} gensec_spnego_create_negTokenInit()

We should only do the state change in a defined place
and not with any error gensec_spnego_create_negTokenInit() might return.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agoauth/spnego: don't pass 'in' to gensec_spnego_create_negTokenInit()
Stefan Metzmacher [Wed, 14 Jun 2017 00:46:29 +0000 (02:46 +0200)]
auth/spnego: don't pass 'in' to gensec_spnego_create_negTokenInit()

It's always en empty blob.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agoauth/spnego: add a struct spnego_negTokenTarg *ta variable to make some lines shorter
Stefan Metzmacher [Wed, 14 Jun 2017 01:36:22 +0000 (03:36 +0200)]
auth/spnego: add a struct spnego_negTokenTarg *ta variable to make some lines shorter

This makes future modifications easier to review.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>