sfrench/samba-autobuild/.git
8 years agos3-utils/smbget: Fix user-/name password reading from rcfile
Christian Ambach [Wed, 27 Jan 2016 21:00:31 +0000 (22:00 +0100)]
s3-utils/smbget: Fix user-/name password reading from rcfile

As the password option is gone, code needs to be able to read password
from user parameter when user%password syntax is used.

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 years agos3-utils/smbget: Fix reading the rcfile
Christian Ambach [Wed, 27 Jan 2016 20:56:10 +0000 (21:56 +0100)]
s3-utils/smbget: Fix reading the rcfile

shortName in POPT_AUTOHELP is null, so the loop always stopped at this
item.

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 years agos3-utils/smbget: Fix option parsing and apply samba defaults
Andreas Schneider [Wed, 28 Oct 2015 11:37:36 +0000 (12:37 +0100)]
s3-utils/smbget: Fix option parsing and apply samba defaults

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
8 years agoselftest: un-flap samba3.blackbox.dfree_quota
Uri Simchoni [Wed, 27 Jan 2016 20:09:51 +0000 (22:09 +0200)]
selftest: un-flap samba3.blackbox.dfree_quota

Remove test from flapping list after fix.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jan 28 01:10:54 CET 2016 on sn-devel-144

8 years agoselftest: fix test_dfree_quota.sh
Uri Simchoni [Wed, 27 Jan 2016 19:47:30 +0000 (21:47 +0200)]
selftest: fix test_dfree_quota.sh

Eliminate backslashes from smbcquotas output so that we
don't have to deal with them correctly when parsing the output.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agoselftest: add test case for different quote/dfree block size
Uri Simchoni [Tue, 19 Jan 2016 12:38:03 +0000 (14:38 +0200)]
selftest: add test case for different quote/dfree block size

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agosmbd: show correct disk size for different quota and dfree block sizes
Uri Simchoni [Tue, 19 Jan 2016 12:57:16 +0000 (14:57 +0200)]
smbd: show correct disk size for different quota and dfree block sizes

When file system stats (VFS disk_free_fn) and quota (VFS get_quota_fn)
return different block sizes, normalize values before comparing.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agoctdb: NAT gateway capability and control to set it are obsolete
Martin Schwenke [Tue, 5 Jan 2016 05:02:09 +0000 (16:02 +1100)]
ctdb: NAT gateway capability and control to set it are obsolete

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): Wed Jan 27 18:35:24 CET 2016 on sn-devel-144

8 years agoctdb-protocol: Drop protocol support for setting NAT gatway capability
Martin Schwenke [Tue, 5 Jan 2016 05:00:57 +0000 (16:00 +1100)]
ctdb-protocol: Drop protocol support for setting NAT gatway capability

This is no longer used.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-client: Drop support for updating NAT gateway capability
Martin Schwenke [Tue, 5 Jan 2016 04:59:43 +0000 (15:59 +1100)]
ctdb-client: Drop support for updating NAT gateway capability

This is no longer used.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoselftest: mark samba3.blackbox.dfree_quota as flakey
Uri Simchoni [Wed, 27 Jan 2016 09:37:42 +0000 (11:37 +0200)]
selftest: mark samba3.blackbox.dfree_quota as flakey

samba3.blackbox.dfree_quota fails repeatedly on sn-devel-144,
although it seems like it initially passed. Marking as flapping
until further investigation.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Jan 27 15:27:52 CET 2016 on sn-devel-144

8 years agoctdb-doc: Document reasons for separating private and public networks
Martin Schwenke [Thu, 21 Jan 2016 09:02:41 +0000 (20:02 +1100)]
ctdb-doc: Document reasons for separating private and public networks

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agosmbd quotas: avoid stat of foreign file systems
Uri Simchoni [Mon, 18 Jan 2016 21:34:48 +0000 (23:34 +0200)]
smbd quotas: avoid stat of foreign file systems

When determining the block device of our file system, avoid
stat'ing paths which are definitely not the mount point of
our file system. This is done to avoid stalling smbd due to
unresponsive network file systems (e.g. NFS) which are not
related to the SMB shares.

See discussion in samba-technical for vfs_fileid:
https://lists.samba.org/archive/samba-technical/2016-January/111553.html

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jan 27 03:35:48 CET 2016 on sn-devel-144

8 years agos3-lib: introduce sys_realpath()
Uri Simchoni [Mon, 18 Jan 2016 21:34:06 +0000 (23:34 +0200)]
s3-lib: introduce sys_realpath()

Add sys_realpath() function that captures the OS variations
on realpath().

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agodbwrap_file: fix use of read_data()
Uri Simchoni [Thu, 21 Jan 2016 11:18:20 +0000 (13:18 +0200)]
dbwrap_file: fix use of read_data()

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jan 27 00:09:05 CET 2016 on sn-devel-144

8 years agos4-torture: let smb2.replay.replay4 test deal with scale out shares.
Günther Deschner [Fri, 15 Jan 2016 17:30:15 +0000 (18:30 +0100)]
s4-torture: let smb2.replay.replay4 test deal with scale out shares.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agos4-torture: let smb2.replay.replay3 test deal with scale out shares.
Günther Deschner [Fri, 15 Jan 2016 17:24:08 +0000 (18:24 +0100)]
s4-torture: let smb2.replay.replay3 test deal with scale out shares.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agos4-torture: let smb2.replay.replay2 test deal with scale out shares.
Günther Deschner [Fri, 15 Jan 2016 17:07:31 +0000 (18:07 +0100)]
s4-torture: let smb2.replay.replay2 test deal with scale out shares.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agoVERSION: Bump version up to 4.5.0pre1
Karolin Seeger [Tue, 26 Jan 2016 10:17:37 +0000 (11:17 +0100)]
VERSION: Bump version up to 4.5.0pre1

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Jan 26 19:12:42 CET 2016 on sn-devel-144

8 years agoVERSION: Set version to 4.4.0rc1... samba-4.4.0rc1
Karolin Seeger [Tue, 26 Jan 2016 10:08:12 +0000 (11:08 +0100)]
VERSION: Set version to 4.4.0rc1...

and disable git snapshots for 4.4.0rc1 release.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
8 years agoWHATSNEW: Add smbstatus changes.
Karolin Seeger [Tue, 26 Jan 2016 09:57:00 +0000 (10:57 +0100)]
WHATSNEW: Add smbstatus changes.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
8 years agoWHATSNEW: Extend release notes for Samba 4.4.0rc1.
Karolin Seeger [Tue, 26 Jan 2016 09:52:15 +0000 (10:52 +0100)]
WHATSNEW: Extend release notes for Samba 4.4.0rc1.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agowaf: Only build smb_krb5_wrapper if we have CUPS
Andreas Schneider [Tue, 26 Jan 2016 10:28:50 +0000 (11:28 +0100)]
waf: Only build smb_krb5_wrapper if we have CUPS

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agodisk_quotas: style fix
Uri Simchoni [Thu, 21 Jan 2016 19:09:12 +0000 (21:09 +0200)]
disk_quotas: style fix

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agovfs_gpfs: make sure get_quota does not return bogus values
Uri Simchoni [Sun, 10 Jan 2016 18:28:57 +0000 (20:28 +0200)]
vfs_gpfs: make sure get_quota does not return bogus values

add implementation of get_quota_fn to vfs_gpfs. The implemetation
returns ENOSYS for the case of user and group quota, to make sure
the default VFS does not accidentally succeed (and return wrong
values which would alter the disk-free calculation)

For other quota types the function calls the underlying VFS as
before.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agomake disk_norm() static
Uri Simchoni [Sun, 10 Jan 2016 17:54:06 +0000 (19:54 +0200)]
make disk_norm() static

Now that disk_norm() is being run centrally from the SMB layer
it can be made static.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agovfs_gpfs: do not call disk_norm() on disk_free_fn
Uri Simchoni [Sun, 10 Jan 2016 13:39:44 +0000 (15:39 +0200)]
vfs_gpfs: do not call disk_norm() on disk_free_fn

This is handled at the SMB layer now.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agovfs_ceph: do not call disk_norm() on disk_free_fn
Uri Simchoni [Sun, 10 Jan 2016 13:38:49 +0000 (15:38 +0200)]
vfs_ceph: do not call disk_norm() on disk_free_fn

This is handled at SMB layer now.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agovfs_fake_dfq: remove quota code from disk_free
Uri Simchoni [Sun, 10 Jan 2016 13:29:32 +0000 (15:29 +0200)]
vfs_fake_dfq: remove quota code from disk_free

When mocking disk-free, do not take quota into
account since this is now done in the SMB layer.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agosmbd: refactor disk_free handling
Uri Simchoni [Sun, 10 Jan 2016 13:15:41 +0000 (15:15 +0200)]
smbd: refactor disk_free handling

Move most of the logic that handles determination of
disk size and free space from default VFS handler to
the SMB layer - letting the VFS handle the basic task
of querying the file system for general stats and
quota.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agovfs_snapper: add get_quota function
Uri Simchoni [Sun, 10 Jan 2016 12:14:58 +0000 (14:14 +0200)]
vfs_snapper: add get_quota function

This is in preparation for handling the quota part
of disk_free via the VFS - each module with a
disk_free_fn should also have a get_quota_fn.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agovfs_shadow_copy2: add get_quota function
Uri Simchoni [Sun, 10 Jan 2016 12:13:38 +0000 (14:13 +0200)]
vfs_shadow_copy2: add get_quota function

This is in preparation for handling the quota part
of disk_free via the VFS - each module with a
disk_free_fn should also have a get_quota_fn.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agovfs_cap: add get_quota function
Uri Simchoni [Sun, 10 Jan 2016 12:10:10 +0000 (14:10 +0200)]
vfs_cap: add get_quota function

This is in preparation for handling the quota part
of disk_free via the VFS - each module with a
disk_free_fn should also have a get_quota_fn.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agovfs: add path parameter to get_quota
Uri Simchoni [Sun, 10 Jan 2016 11:29:25 +0000 (13:29 +0200)]
vfs: add path parameter to get_quota

Adding a path parameter would allow the VFS get_quota
function to be used for determining the quota/usage
when calculating size and free spacei.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agoselftest: add disk-free and quota tests based on fake_dfq VFS module
Uri Simchoni [Wed, 6 Jan 2016 10:59:06 +0000 (12:59 +0200)]
selftest: add disk-free and quota tests based on fake_dfq VFS module

These tests use the vfs_fake_dfq module to simulate some
relations between the quota status and disk-free status.

The tests will become meaningful when we take the code that
does those calculations out of the VFS layer - the tests will
then exercise the server code.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agovfs_fake_dfq: add vfs module
Uri Simchoni [Tue, 5 Jan 2016 19:12:00 +0000 (21:12 +0200)]
vfs_fake_dfq: add vfs module

Add a vfs module "vfs_fake_dfq" for mocking disk-free
and user/group quota functions.

In this commit there are quota considerations in
disk_free calculations, based on the mocking of quota.

Those considerations will later be removed once we
refactor the server code to weigh the disk-free and quota in
the smb layer and not in individual vfs implementations.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agosmbd: enable unit-testing of NT_TRANSACT_GET_USER_QUOTA
Uri Simchoni [Sat, 9 Jan 2016 19:24:10 +0000 (21:24 +0200)]
smbd: enable unit-testing of NT_TRANSACT_GET_USER_QUOTA

Processing of NT_TRANSACT_GET_USER_QUOTA involves a security check to
see the user is an admin, allow this check to run in unit-testing mode.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agoquotas: correct comment about SMB_GROUP_QUOTA_TYPE
Uri Simchoni [Wed, 6 Jan 2016 11:30:59 +0000 (13:30 +0200)]
quotas: correct comment about SMB_GROUP_QUOTA_TYPE

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agoloadparm: introduce lp_parm_ulonglong() and lpcfg_parm_ulonglong()
Uri Simchoni [Mon, 18 Jan 2016 04:56:43 +0000 (06:56 +0200)]
loadparm: introduce lp_parm_ulonglong() and lpcfg_parm_ulonglong()

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agosmbd:smb2_negprot: implement connection passing based on client_guid
Michael Adam [Tue, 26 Jan 2016 09:12:46 +0000 (10:12 +0100)]
smbd:smb2_negprot: implement connection passing based on client_guid

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

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
8 years agosmbd:smb2_server: let smbd_server_connection_terminate() only call exit_server()...
Stefan Metzmacher [Thu, 18 Sep 2014 17:27:42 +0000 (19:27 +0200)]
smbd:smb2_server: let smbd_server_connection_terminate() only call exit_server() for the last connection

TODO: We need to cancel pending requests on the connection and defer the
talloc_free.

Currently we only ever have one connection.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
8 years agosmbd:process: use smbXsrv_client_create.
Michael Adam [Fri, 22 Jan 2016 12:13:44 +0000 (13:13 +0100)]
smbd:process: use smbXsrv_client_create.

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
8 years agosmbd:process: treat initialized table in smbXsrv_connection_init_tables
Michael Adam [Mon, 25 Jan 2016 18:02:04 +0000 (19:02 +0100)]
smbd:process: treat initialized table in smbXsrv_connection_init_tables

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

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
8 years agosmbd: add smbXsrv_client.c
Stefan Metzmacher [Tue, 26 Jan 2016 00:10:25 +0000 (01:10 +0100)]
smbd: add smbXsrv_client.c

Pair-Programmed-With: Michael Adam <obnox@samba.org>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
8 years agosmbd:globals.h: add guid_verified to smbXsrv_connection.smb2.client
Michael Adam [Mon, 25 Jan 2016 21:50:28 +0000 (22:50 +0100)]
smbd:globals.h: add guid_verified to smbXsrv_connection.smb2.client

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
8 years agoidl:smbXsrv: add smbXsrv_connection_pass structures.
Stefan Metzmacher [Mon, 25 Jan 2016 23:39:35 +0000 (00:39 +0100)]
idl:smbXsrv: add smbXsrv_connection_pass structures.

To be used for the connection passing message.

Pair-Programmed-With: Michael Adam <obnox@samba.org>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
8 years agoidl:smbXsrv: add smbXsrv_client_global structures
Stefan Metzmacher [Mon, 23 Jun 2014 10:17:04 +0000 (12:17 +0200)]
idl:smbXsrv: add smbXsrv_client_global structures

This is for marshalling smbXsrv_client.

Pair-Programmed-With: Michael Adam <obnox@samba.org>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
8 years agoidl:messagaing: add MSG_SMBXSRV_CONNECTION_PASS
Stefan Metzmacher [Tue, 24 Jun 2014 05:43:27 +0000 (07:43 +0200)]
idl:messagaing: add MSG_SMBXSRV_CONNECTION_PASS

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3:smbd: only process fsctl_network_iface_info if multi channel is enabled
Michael Adam [Mon, 25 Jan 2016 11:01:44 +0000 (12:01 +0100)]
s3:smbd: only process fsctl_network_iface_info if multi channel is enabled

This effectively disables it for now.
Ultimately, we may want to remove this restriction.
Hence a separate patch.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Jan 26 10:40:44 CET 2016 on sn-devel-144

8 years agos3:smbd: implement fsctl_network_iface_info
Stefan Metzmacher [Fri, 13 Jun 2014 15:42:00 +0000 (17:42 +0200)]
s3:smbd: implement fsctl_network_iface_info

The ioctl used for detecting interfaces for multi-channel.

Pair-Programmed-With: Michael Adam <obnox@samba.org>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
8 years agodocs:smb.conf: document new extra syntax for interfaces.
Michael Adam [Mon, 25 Jan 2016 15:35:12 +0000 (16:35 +0100)]
docs:smb.conf: document new extra syntax for interfaces.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agos4:lib:socket: skip extra data in interpret_interface()
Michael Adam [Mon, 25 Jan 2016 15:22:57 +0000 (16:22 +0100)]
s4:lib:socket: skip extra data in interpret_interface()

This is currently smbd-specific.
No need to duplicate the extended parsing
while these functions have not been merged yet.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agos3:lib: extend interpret_interface() to optionally read speed, caps, and index from...
Michael Adam [Mon, 25 Jan 2016 02:38:54 +0000 (03:38 +0100)]
s3:lib: extend interpret_interface() to optionally read speed, caps, and index from config

New syntax for interfaces parameter:

  interfaces = address[;key=value[,key=value[,...]]]

- keys can be 'speed', 'capability', and 'if_index'.

- speed is in bits per second.

- capability can be RSS and RDMA.

- if_index should be used with care, because
  these indexes should not conicide with indexes
  the kernel sets...

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agos3:lib: remove an unmotivated comment from interpret_interface()
Michael Adam [Sun, 24 Jan 2016 12:26:35 +0000 (13:26 +0100)]
s3:lib: remove an unmotivated comment from interpret_interface()

This seems to be a left-over from historic code.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agos3:lib: copy speed, cap, and index in add_interface()
Michael Adam [Mon, 25 Jan 2016 13:09:37 +0000 (14:09 +0100)]
s3:lib: copy speed, cap, and index in add_interface()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agosmb.h: add linkspeed, capability, and if_index to interface struct
Michael Adam [Mon, 25 Jan 2016 02:38:16 +0000 (03:38 +0100)]
smb.h: add linkspeed, capability, and if_index to interface struct

Pair-Programmed-With: Anoop C S <anoopcs@redhat.com>

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agolib:socket: detect link speed with ethtool ioctl in get_interfaces (on linux)
Anoop C S [Fri, 22 Jan 2016 15:21:55 +0000 (20:51 +0530)]
lib:socket: detect link speed with ethtool ioctl in get_interfaces (on linux)

Pair-Programmed-With: Michael Adam <obnox@samba.org>

Signed-off-by: Anoop C S <anoopcs@redhat.com>
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agobuild: detect support for ethtool
Michael Adam [Mon, 25 Jan 2016 02:30:39 +0000 (03:30 +0100)]
build: detect support for ethtool

Pair-Programmed-With: Anoop C S <anoopcs@redhat.com>

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agolib:socket: set defaults for linkspeed and capability in get_interfaces()
Michael Adam [Mon, 25 Jan 2016 02:38:31 +0000 (03:38 +0100)]
lib:socket: set defaults for linkspeed and capability in get_interfaces()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agolib:socket: get interface index from kernel
Michael Adam [Mon, 25 Jan 2016 11:23:40 +0000 (12:23 +0100)]
lib:socket: get interface index from kernel

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agolib:socket: add linkspeed, capability and if_index to iface_struct
Michael Adam [Mon, 25 Jan 2016 02:38:05 +0000 (03:38 +0100)]
lib:socket: add linkspeed, capability and if_index to iface_struct

Pair-Programmed-With: Anoop C S <anoopcs@redhat.com>

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agolibrpc:idl: define FSCTL_NET_IFACE_NONE_CAPABLE in ioctl.idl
Michael Adam [Mon, 25 Jan 2016 02:37:38 +0000 (03:37 +0100)]
librpc:idl: define FSCTL_NET_IFACE_NONE_CAPABLE in ioctl.idl

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agos3:lib: add braces around if-block in my_sam_name()
Michael Adam [Thu, 21 Jan 2016 11:46:40 +0000 (12:46 +0100)]
s3:lib: add braces around if-block in my_sam_name()

Clean-up after moving the function.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Jan 26 03:19:18 CET 2016 on sn-devel-144

8 years agos3:lib: remove supefluous comments from map_my_name()
Michael Adam [Thu, 21 Jan 2016 11:45:42 +0000 (12:45 +0100)]
s3:lib: remove supefluous comments from map_my_name()

cleanup after moving

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 years agos3:lib: fix white spaces in my_sam_name()
Michael Adam [Thu, 21 Jan 2016 11:44:19 +0000 (12:44 +0100)]
s3:lib: fix white spaces in my_sam_name()

Clean-up after function has been moved.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 years agovfs_shadow_copy2: documentation for snapsharepath
Uri Simchoni [Tue, 3 Nov 2015 11:21:58 +0000 (13:21 +0200)]
vfs_shadow_copy2: documentation for snapsharepath

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agovfs_shadow_copy2: add tests for snapsharepath
Uri Simchoni [Tue, 3 Nov 2015 09:15:52 +0000 (11:15 +0200)]
vfs_shadow_copy2: add tests for snapsharepath

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agovfs_shadow_copy2: add snapsharepath parameter
Uri Simchoni [Tue, 3 Nov 2015 08:57:13 +0000 (10:57 +0200)]
vfs_shadow_copy2: add snapsharepath parameter

This new parameter defines how to get from the snapshot's
root directory to the share's root directory. It is an
alternative to the "basedir" parameter, but functionally
is a superset of basedir.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agovfs_shadow_copy2: remove basedir state variable
Uri Simchoni [Tue, 3 Nov 2015 07:15:12 +0000 (09:15 +0200)]
vfs_shadow_copy2: remove basedir state variable

Remove the basedir state variable from the module-specific data
of vfs_shadow_copy2 - this variable is not being used.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agos3-parm: clean up defaults when removing global parameters
Alexander Bokovoy [Fri, 22 Jan 2016 09:44:03 +0000 (11:44 +0200)]
s3-parm: clean up defaults when removing global parameters

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

When globals are re-initialized, they are cleared and globals' talloc
context is freed. However, parm_table still contains a reference to the
global value in the defaults. This confuses lpcfg_string_free() after
commit 795c543d858b2452f062a02846c2f908fe4cffe4 because it tries to
free already freed pointer which is passed by lp_save_defaults():

....
    case P_STRING:
    case P_USTRING:
                  lpcfg_string_set(Globals.ctx,
                                   &parm_table[i].def.svalue,
                                   *(char **)lp_parm_ptr(NULL, &parm_table[i]));
....

here &parm_table[i].def.svalue is passed to lpcfg_string_free() but it
is a pointer to a value allocated with previous Globals.ctx which
already was freed.

This specifically affects registry backend of smb.conf in lp_load_ex()
where init_globals() called explicitly to re-init globals after
lp_save_defaults() if we have registry backend defined.

Reviewed-by: Uri Simchoni <uri@samba.org>
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Mon Jan 25 23:58:42 CET 2016 on sn-devel-144

8 years agos3-client: Add a KRB5 wrapper for smbspool
Andreas Schneider [Tue, 12 Jan 2016 14:17:22 +0000 (15:17 +0100)]
s3-client: Add a KRB5 wrapper for smbspool

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

We need a wrapper for smbspool to be able to authenticate with Kerberos.
This needs to replace the cups smb backend. The permission need to be
0700 and the owner root.

Note that Kerberos support is broken in CUPS 2.1.2 maybe earlier
versions. It works with 1.6.3.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Jan 25 19:58:46 CET 2016 on sn-devel-144

8 years agoWHATSNEW: Documentation CTDB changes for v4.4
Martin Schwenke [Mon, 25 Jan 2016 09:29:35 +0000 (20:29 +1100)]
WHATSNEW: Documentation CTDB changes for v4.4

Signed-off-by: Martin Schwenke <martin@meltin.net>
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Mon Jan 25 16:47:54 CET 2016 on sn-devel-144

8 years agos3:utils/smbget make use of bool for flags
Christian Ambach [Sun, 24 Jan 2016 10:57:01 +0000 (11:57 +0100)]
s3:utils/smbget make use of bool for flags

convert flags stored as int to bool

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Jan 25 13:33:12 CET 2016 on sn-devel-144

8 years agos3:utils/smbget use C99 format identifiers
Christian Ambach [Sun, 24 Jan 2016 10:45:59 +0000 (11:45 +0100)]
s3:utils/smbget use C99 format identifiers

for ssize_t and off_t variables

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 years agos3:utils/smbget code format
Christian Ambach [Sun, 24 Jan 2016 10:17:20 +0000 (11:17 +0100)]
s3:utils/smbget code format

adopt the code to latest README.Coding standards
e.g. curly braces everywhere, blanks before braces,
obey 80 character limit (except for the popt definitions)

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 years agos3:utils/smbget fix recursive download
Christian Ambach [Wed, 30 Dec 2015 20:25:13 +0000 (21:25 +0100)]
s3:utils/smbget fix recursive download

get_auth_data is called multiple times (once for the directory listing and then
for every file to be downloaded). Save the obtained values across multiple calls
to make smbclient use the correct username for each download.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=6482
Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 years agoWHATSNEW: CTDB_NATGW_SLAVE_ONLY is no longer used
Martin Schwenke [Mon, 25 Jan 2016 01:52:43 +0000 (12:52 +1100)]
WHATSNEW: CTDB_NATGW_SLAVE_ONLY is no longer used

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 Jan 25 10:23:49 CET 2016 on sn-devel-144

8 years agoctdb-tools: Drop support for setting and viewing NAT gateway capability
Martin Schwenke [Tue, 5 Jan 2016 04:58:29 +0000 (15:58 +1100)]
ctdb-tools: Drop support for setting and viewing NAT gateway capability

This is no longer used.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-scripts: No longer set the NAT gateway capability
Martin Schwenke [Tue, 5 Jan 2016 04:53:50 +0000 (15:53 +1100)]
ctdb-scripts: No longer set the NAT gateway capability

Nothing checks it anymore.

This means that the NAT gateway capability in the daemon is now
unused.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb/tools: Update ctdb CLI tool to call ctdb_natgw
Martin Schwenke [Thu, 21 Jan 2016 01:53:43 +0000 (12:53 +1100)]
ctdb/tools: Update ctdb CLI tool to call ctdb_natgw

The "natgwlist" command is no longer marked "auto all" and is also
marked "without daemon".  That latter is not strictly true because
ctdb_natgw needs the daemon so a subsequent invocation of "ctdb
nodestatus" will work.  However, "without daemon" is used here because
the top-level "ctdb natgwlist" does not need to open a connection to
the daemon.  It just needs to invoke ctdb_natgw.

Update tests to suit.

It would make sense to make "ctdb natgw" generally call out to
ctdb_natgw, passing all argument.  However, that can be done later.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-tests: Drop some unnecessary NAT gateway tests
Martin Schwenke [Thu, 21 Jan 2016 08:35:46 +0000 (19:35 +1100)]
ctdb-tests: Drop some unnecessary NAT gateway tests

These tests deal only with timeouts that can occur retrieving
capabilities.  The NAT gateway capability is going away so drop the
tests now to simplify future commits.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb: Call out to ctdb_natgw helper from 11.natgw
Martin Schwenke [Mon, 14 Dec 2015 10:37:44 +0000 (21:37 +1100)]
ctdb: Call out to ctdb_natgw helper from 11.natgw

To keep this commit comprehensible, 11.natgw and the CTDB CLI tool are
temporarily inconsistent.  The tool will be made consistent in a
subsequent commit.

ctdb_natgw_slave_only() is reimplemented to check for the option in
the appropriate line in $CTDB_NATGW_NODES.

Update unit tests and documentation.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-tests: NAT gateway slave-only changes
Martin Schwenke [Fri, 22 Jan 2016 00:04:22 +0000 (11:04 +1100)]
ctdb-tests: NAT gateway slave-only changes

Handle the "slave-only" option in the unit test setup.  Reindent
function while touching it.

Also drop a test that no longer makes sense.  Specifying both "master"
and "slave-only' is now much more obvious, since they need to be on
the same line, and is now punishable by undefined behaviour.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-scripts: New function ctdb_natgw_slave_only()
Martin Schwenke [Tue, 5 Jan 2016 02:09:05 +0000 (13:09 +1100)]
ctdb-scripts: New function ctdb_natgw_slave_only()

This allows future changes to be more self-contained.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-tests: Test ctdb CLI tool via a stub
Martin Schwenke [Mon, 14 Dec 2015 10:08:03 +0000 (21:08 +1100)]
ctdb-tests: Test ctdb CLI tool via a stub

Some features, such NAT gateway and LVS support, can be implemented
without daemon and (internal) ctdb CLI tool support.  These are
non-core features that don't need incredible performance and they
don't need to be in the core code.  They can easily be reimplemented
in scripts, along with some configuration changes.

For continuity, the ctdb CLI tool code will call out to helper scripts
so that the current status information can still be provided.  Those
helper scripts may then reinvoke the ctdb CLI tool to gather
information.

So, redo the tool testing using a "ctdb" stub command.  This will
swallow standard input and feed it to the test program each time the
"ctdb" stub is called.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-tools: Add standalone ctdb_natgw tool script
Martin Schwenke [Mon, 14 Dec 2015 00:34:41 +0000 (11:34 +1100)]
ctdb-tools: Add standalone ctdb_natgw tool script

This is intended to replace the use of "ctdb natgwlist" in 11.natgw
and provide different views of the NAT gateway status.

It replaces the use of CTDB_NATGW_SLAVE_ONLY=yes with a "slave-only"
keyword in the NAT gateway nodes file.  This means the nodes file must
be consistent on all nodes in a NAT gateway group.

Note that this script is not yet integrated, so there are no behaviour
or documentation changes.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-scripts: Tests for monitoring of CTDB_NATGW_PUBLIC_IFACE
Martin Schwenke [Fri, 18 Dec 2015 05:23:04 +0000 (16:23 +1100)]
ctdb-scripts: Tests for monitoring of CTDB_NATGW_PUBLIC_IFACE

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-scripts: Move monitoring of CTDB_NATGW_PUBLIC_IFACE to 11.natgw
Martin Schwenke [Fri, 18 Dec 2015 05:22:14 +0000 (16:22 +1100)]
ctdb-scripts: Move monitoring of CTDB_NATGW_PUBLIC_IFACE to 11.natgw

The NAT gateway code should be self-contained.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-scripts: CTDB_PARTIALLY_ONLINE_INTERFACES incompatible with NAT gateway
Martin Schwenke [Wed, 20 Jan 2016 08:14:15 +0000 (19:14 +1100)]
ctdb-scripts: CTDB_PARTIALLY_ONLINE_INTERFACES incompatible with NAT gateway

This has always been the case.  Now it is documented and enforced.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-scripts: Rename variable: fail -> down_interfaces_found
Martin Schwenke [Fri, 15 Jan 2016 10:22:16 +0000 (21:22 +1100)]
ctdb-scripts: Rename variable: fail -> down_interfaces_found

Now its name describes its usage and the code reads better.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-scripts: Drop functions mark_up() and mark_down()
Martin Schwenke [Fri, 15 Jan 2016 10:20:26 +0000 (21:20 +1100)]
ctdb-scripts: Drop functions mark_up() and mark_down()

Each is now used in only one place and the logic is more obvious
without them.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-scripts: Move interface monitoring code to functions file
Martin Schwenke [Fri, 18 Dec 2015 04:43:33 +0000 (15:43 +1100)]
ctdb-scripts: Move interface monitoring code to functions file

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-scripts: Rename get_real_iface() -> interface_get_real()
Martin Schwenke [Fri, 18 Dec 2015 04:37:31 +0000 (15:37 +1100)]
ctdb-scripts: Rename get_real_iface() -> interface_get_real()

Now suitably named for move to functions file.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-scripts: Refactor function interface_monitor() to monitor one interface
Martin Schwenke [Fri, 18 Dec 2015 04:30:18 +0000 (15:30 +1100)]
ctdb-scripts: Refactor function interface_monitor() to monitor one interface

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agos4:torture: add SMB2 test for directory creation initial allocation size
Ralph Boehme [Wed, 20 Jan 2016 16:46:38 +0000 (17:46 +0100)]
s4:torture: add SMB2 test for directory creation initial allocation size

Test that directory creation with an initial allocation size > 0
succeeds.

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

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): Sun Jan 24 01:20:52 CET 2016 on sn-devel-144

8 years agos3:smbd: Ignore initial allocation size for directory creation
Ralph Boehme [Wed, 25 Nov 2015 14:23:26 +0000 (15:23 +0100)]
s3:smbd: Ignore initial allocation size for directory creation

We reject directory creation with an initial allocation size > 0 with
NT_STATUS_ACCESS_DENIED. Windows servers ignore the initial allocation
size on directories.

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

Pair-Programmed-With: Volker Lendecke <vl@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agos3:smb2_sesssetup: implement SMB3 session bind (disabled)
Michael Adam [Thu, 21 Jan 2016 17:59:34 +0000 (18:59 +0100)]
s3:smb2_sesssetup: implement SMB3 session bind (disabled)

This is disabled for now. It will be possible to enabled it
via a config switch once the underpinnings are complete.

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

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Sat Jan 23 03:22:18 CET 2016 on sn-devel-144

8 years agos3:smb2_sesssetup: treat BINDING in smbd_smb2_session_setup_auth_return
Stefan Metzmacher [Wed, 29 Jul 2015 15:05:52 +0000 (17:05 +0200)]
s3:smb2_sesssetup: treat BINDING in smbd_smb2_session_setup_auth_return

This adds smbd_smb2_bind_auth_return(), a
variant of auth_return for session binding.

Pair-Programmed-With: Michael Adam <obnox@samba.org>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3:smb2_negprot: announce multi channel support (disabled)
Michael Adam [Wed, 20 Jan 2016 23:16:33 +0000 (00:16 +0100)]
s3:smb2_negprot: announce multi channel support (disabled)

This disabled for now. Will be enabled by config setting
once underpinnings are ready.

Pair-Programmed-With: Guenther Deschner <gd@samba.org>

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agosmbXsrv: introduce bool smbXsrv_client->server_multi_channel_enabled
Michael Adam [Fri, 22 Jan 2016 11:51:15 +0000 (12:51 +0100)]
smbXsrv: introduce bool smbXsrv_client->server_multi_channel_enabled

defaulting to false.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>