summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* s4:torture/local: add more torture_assert() checksStefan Metzmacher2015-04-091-110/+145
| | | | | | | | | | We need to make sure we return when torture_assert_passwd_equal() or torture_assert_group_equal() fails. Bug: https://bugzilla.samba.org/show_bug.cgi?id=11183 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* selftest/Samba4: use 'testallowed account' instead of 'test allowed'Stefan Metzmacher2015-04-092-8/+11
| | | | | | | | local.nss test might print lines starting with 'test allowed:...' and that confused the subunit parser. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* selftest/knownfail: remove unused ↵Stefan Metzmacher2015-04-091-1/+0
| | | | | | | ^samba4.winbind.struct.show_sequence\(ad_dc\) line Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* rpcclient: Fix the timeout commandAndreas Schneider2015-04-091-16/+8
| | | | | | | | | | https://bugzilla.samba.org/show_bug.cgi?id=11199 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu Apr 9 16:57:15 CEST 2015 on sn-devel-104
* fss: Fix CID 1293354 Wrong operator usedVolker Lendecke2015-04-081-1/+1
| | | | | | | | | | Not used right now, but prevent future confusion. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Wed Apr 8 19:36:36 CEST 2015 on sn-devel-104
* waf: Fix systemd detectionAndreas Schneider2015-04-084-34/+29
| | | | | | | | | | https://bugzilla.samba.org/show_bug.cgi?id=11200 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 Apr 8 15:06:26 CEST 2015 on sn-devel-104
* ctdb-tests: Use ctdb_node_list_to_map() in tool stubsMartin Schwenke2015-04-071-46/+3
| | | | | | | | | | Drop copy of old ctdb_control_nodemap(). 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): Tue Apr 7 10:20:41 CEST 2015 on sn-devel-104
* ctdb-common: Move ctdb_node_list_to_map() to utilitiesMartin Schwenke2015-04-073-27/+30
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Factor out new function ctdb_node_list_to_map()Martin Schwenke2015-04-071-16/+32
| | | | | | | Change ctdb_control_getnodemap() to use this. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Drop the recovery from "reloadnodes"Martin Schwenke2015-04-071-3/+0
| | | | | | | | | | A recovery is not required: when deleting a node it should already be disconnected and when adding a node it will also be disconnected. The new sanity checks in "reloadnodes" ensure that these assumptions are met. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Don't delay reloading the nodes fileMartin Schwenke2015-04-071-16/+6
| | | | | | | | | | | | | | | | Presumably this was done to minimise the chance of a recovery occurring while the nodemaps are inconsistent across nodes. Another potential theory is that the forced recovery in the ctdb.c:control_reload_nodes_file() stops another recovery occurring for ReRecoveryTimeout seconds, so this delay causes the reloads to occur during that period. This is no longer necessary because recoveries are now explicitly disabled while node files are reloaded. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-recoverd: Avoid nodemap-related checks when recoveries are disabledMartin Schwenke2015-04-071-0/+8
| | | | | | | | | | The potential resulting recovery won't run anyway. Also recoveries may have been disabled by "reloadnodes" and if the nodemaps are inconsistent between nodes then avoid triggering an unnecessary recovery. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tool: Update "reloadnodes" to disable recoveriesMartin Schwenke2015-04-071-0/+13
| | | | | | | | If a recovery occurs when some nodes have reloaded and others haven't then the nodemaps with be inconsistent so bad things will happen. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-recoverd: New message ID CTDB_SRVID_DISABLE_RECOVERIESMartin Schwenke2015-04-073-0/+19
| | | | | | | Also add test stub support. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-recoverd: Simplify disable_ip_check_handler() using ctdb_op_disable()Martin Schwenke2015-04-071-17/+4
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-recoverd: Add slightly more abstraction for disabling takeover runsMartin Schwenke2015-04-071-6/+14
| | | | | | | | Factor out new function srvid_disable_and_reply(), which can be re-used. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-recoverd: Reimplement ReRecoveryTimeout using ctdb_op_disable()Martin Schwenke2015-04-071-6/+14
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-recoverd: Use a goto for do_recovery() failuresMartin Schwenke2015-04-071-21/+24
| | | | | | | This will allow extra things to be done on failure. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-recoverd: Reimplement disabling takeover runs using ctdb_op_disable()Martin Schwenke2015-04-071-62/+11
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-recoverd: Add a new abstraction ctdb_op_disable()Martin Schwenke2015-04-071-0/+97
| | | | | | | | | | | | This can be used to disable and re-enable an operation, and do all the relevant sanity checking. Most of this is from existing functions disable_takeover_runs_handler(), clear_takeover_runs_disable() and reenable_takeover_runs(). Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Pass on consistent flag information to recovery daemonMartin Schwenke2015-04-071-0/+1
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add "ctdb reloadnodes" test for "node remains deleted"Martin Schwenke2015-04-071-0/+30
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Fix spurious messages about deleted nodes being disconnectedMartin Schwenke2015-04-071-5/+12
| | | | | | | | | The code was too "clever". The 4 different cases should be separate. The "node remains deleted" case doesn't need the IP address comparison (always 0.0.0.0) or the disconnected check. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* rpc_server: Coverity fix for CID 1273079Rajesh Joseph2015-04-021-1/+13
| | | | | | | | | | | | | | leaked_storage: Variable pk going out of scope leaks the storage it points to. On failure get_pk_from_raw_keypair_params function should free up the private key (pk) it allocates internally. Signed-off-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Guenther Deschner <gd@samba.org> Reviewed-by: Ira Cooper <ira@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Thu Apr 2 19:38:22 CEST 2015 on sn-devel-104
* build:wafsamba: fix a typoMichael Adam2015-04-021-3/+3
| | | | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Ira Cooper <ira@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Thu Apr 2 16:39:01 CEST 2015 on sn-devel-104
* vfs_ceph: add empty ACL callbacksYan, Zheng2015-04-021-0/+48
| | | | | | | | | | | | | If a vfs module has no ACL callbacks, smbd will use its default ACL callbacks. These default ACL callbacks operate on local filesytem, it's clearly wrong for ceph case. libcephfs does not support ACL yet, so this patch adds ACL callbacks that do nothing. Signed-off-by: Yan, Zheng <zyan@redhat.com> Reviewed-by: Ira Cooper <ira@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* vfs_ceph: use 'file descriptor' version xattr functions when possibleYan, Zheng2015-04-021-0/+22
| | | | | | | | | | libcephfs version 0.94 adds 'file descriptor' version xattr functions. This patch makes corresponding samba VFS callbacks use these new functions. Signed-off-by: Yan, Zheng <zyan@redhat.com> Reviewed-by: Ira Cooper <ira@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb: check for talloc_asprintf() failureDavid Disseldorp2015-04-011-0/+5
| | | | | | | | Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Wed Apr 1 15:36:03 CEST 2015 on sn-devel-104
* ctdb: Coverity fix for CID 1291643Rajesh Joseph2015-04-011-1/+6
| | | | | | | | | | | CID 1291643: Resource leak: leaked_handle: Handle variable lock_fd going out of scope leaks the handle. Fix: on failure case release handle variable lock_fd Signed-off-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* s3-passdb: Fix 'force user' with winbind default domainAndreas Schneider2015-03-311-0/+24
| | | | | | | | | | | | | | If we set 'winbind use default domain' and specify 'force user = user' without a domain name we fail to log in. In this case we need to try a lookup with the domain name. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11185 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): Tue Mar 31 21:17:23 CEST 2015 on sn-devel-104
* selftest: run the FSRVP test suite against s3fsDavid Disseldorp2015-03-313-1/+2
| | | | | | | | With FSRVP server support now present along with suitable mock-up test infrastructure, run the FSRVP test suite against s3fs. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* selftest: add snapshot share configurationDavid Disseldorp2015-03-312-0/+19
| | | | | | | | | | | | | Define a share that uses both vfs_shell_snap and fake_snap.pl to create, delete and expose fake snapshots in response to FSRVP requests. Additionally test snapshot enumeration and access via the shadow_copy2 module. Allow for simple testing of FSRVP message sequence timeouts, by specifying an artificially small interval. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* doc: add vfs_shell_snap manpageDavid Disseldorp2015-03-312-0/+156
| | | | | | | | Document usage of the shell_snap VFS module, explaining when and how each of the shell script commands are called. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs: add vfs_shell_snap moduleDavid Disseldorp2015-03-313-1/+210
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The shell_snap VFS module plumbs into the snapshot (aka shadow-copy) management paths used by Samba's File Server Remote VSS Protocol (FSRVP) server. The following shell callouts may be configured in smb.conf: shell_snap: check path command - Called when an FSRVP client wishes to check whether a given share supports snapshot create/delete requests. - The command is called with a single <share path> argument. - The command must return 0 if <share path> is capable of being snapshotted. shell_snap: create command - Called when an FSRVP client wishes to create a snapshot. - The command is called with a single <share path> argument. - The command must return 0 status if the snapshot was successfully taken. - The command must output the path of the newly created snapshot to stdout. shell_snap: delete command - Called when an FSRVP client wishes to delete a snapshot. - The command is called with <base share path> and <snapshot share path> arguments. - The command must return 0 status if the snapshot was successfully removed. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* doc: explain vfs_btrfs remote snapshot configurationDavid Disseldorp2015-03-311-3/+51
| | | | | | | | This extends the vfs_btrfs man page to also cover FSRVP remote snapshot behaviour and configuration. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* doc: explain vfs_snapper remote snapshot configurationDavid Disseldorp2015-03-311-1/+32
| | | | | | | | | | | This extends the vfs_snapper man page to also cover FSRVP remote snapshot behaviour and configuration. The permissions section is also extended to describe specific Samba and Snapper requirements for remote snapshot creation and deletion using DiskShadow.exe. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* doc: "prune stale" and "sequence timeout" fssd parametersDavid Disseldorp2015-03-314-4/+37
| | | | | | | | This change adds smb.conf documentation for the "fss: prune stale" and "fss: sequence timeout" parameters accepted by Samba's FSRVP server. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* fsrvp: prune shadow copies if associated path doesn't existNoel Power2015-03-313-29/+208
| | | | | | | | | | | | | | This patch implements some simple FSRVP server housekeeping. On startup the server scans the cached entries, any entries where the underlying system paths associated with shadow copies no longer exist are removed from the cache and from the registry. This behaviour is disabled by default, but can be enabled via the new "fss: prune stale" smb.conf parameter. Signed-off-by: Noel Power <noel.power@suse.com> Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* fsrvp: add remote snapshot RPC serverDavid Disseldorp2015-03-318-4/+1856
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Samba fss_agent RPC server is an implementation of the File Server Remote VSS (Volume Shadow Copy Service) Protocol, or FSRVP for short. FSRVP is new with Windows Server 2012, and allows authenticated clients to remotely request the creation, exposure and deletion of share snapshots. The fss_agent RPC server processes requests on the FssAgentRpc named pipe, and dispatches relevant snapshot creation and deletion requests through to the VFS. The registry smb.conf back-end is used to expose snapshot shares, with configuration parameters and share ACLs cloned from the base share. There are three FSRVP client implementations that I'm aware of: - Samba rpcclient includes fss_X commands. - Windows Server 2012 includes diskshadow.exe. - System Center 2012. FSRVP operations are only processed for users with: - Built-in Administrators group membership, or - Built-in Backup Operators group membership, or - Backup Operator privileges, or - Security token matches the initial process UID MS-FSRVP specifies that server state should be stored persistently during operation and retrieved on startup. Use the existing fss_srv.tdb FSRVP state storage back-end to satisfy this requirement. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_snapper: create/delete snapshot supportDavid Disseldorp2015-03-311-0/+586
| | | | | | | | Extend vfs_snapper to support the new remote snapshot creation and deletion hooks added for FSRVP. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_btrfs: add snapshot create/delete callsDavid Disseldorp2015-03-312-1/+322
| | | | | | | | | | | | | | | The "btrfs: manipulate snapshots" smb.conf parameter is disabled by default, to encourage use of, and pass requests through to, the vfs_snapper module. When enabled, issue BTRFS_IOC_SNAP_CREATE_V2 and BTRFS_IOC_SNAP_DESTROY ioctls accordingly. The ioctls are issued as root, so rely on permission checks in the calling FSRVP server process. Base share paths must exist as btrfs subvolumes in order to be supported for snapshot operations. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* replace: check for dirname() and basename()David Disseldorp2015-03-311-1/+2
| | | | | | | These functions are provided by libgen.h, and conform to POSIX.1-2001. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs: add snapshot create/delete hooksDavid Disseldorp2015-03-319-3/+303
| | | | | | | | | | | | | | | | | | | | | | | This change adds three new VFS hooks covering snapshot manipulation: - snap_check_path Check whether a path supports snapshots. - snap_create Request the creation of a snapshot of the provided path. - snap_delete Request the deletion of a snapshot. These VFS call-outs will be used in future by Samba's File Server Remote VSS Protocol (FSRVP) server. MS-FSVRP states: At any given time, Windows servers allow only one shadow copy set to be going through the creation process. Therefore, only provide synchronous hooks for now, which can be converted to asynchronous _send/_recv functions when the corresponding DCE/RPC server infrastructure is in place. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: add local FSRVP server state testsDavid Disseldorp2015-03-313-2/+498
| | | | | | | | Test the storage and retrieval of FSRVP server state, with varying shadow-copy set, shadow copy and share map hierarchies. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* fsrvp: add server state storage back-endDavid Disseldorp2015-03-313-0/+794
| | | | | | | | | | | | | | | | | | | | | | | | | MS-FSRVP specifies: the server MUST persist all state information into an implementation- specific configuration store. This change adds a fss_srv TDB database to preserve FSRVP server state, with the following keys used to track shadow copy state and hierarchy: - sc_set/<shadow copy set GUID> A shadow copy set tracks a collection of zero or more shadow copies, as initiated by a StartShadowCopySet FSRVP client request. - sc_set/<shadow copy set GUID>/sc/<shadow copy GUID> A shadow copy defines information about a snapshot base volume, the snapshot path, and a collection of share maps. It is initiated by an AddToShadowCopySet client request. - sc_set/<shadow copy set GUID>/sc/<shadow copy GUID>/smap/<smap GUID> A share map tracks new shares that are created to expose shadow copies. All structures are marshalled into on-disk format using the previously added fsrvp_state IDL library. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* librpc: add FSRVP server state idlDavid Disseldorp2015-03-313-1/+43
| | | | | | | | | | FSRVP server state must be retained persistently. This change adds IDL definitions for the share map, shadow-copy and shadow-copy set types, which will be used for marshalling and unmarshalling state alongside database storage or retrieval. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* waf: Remove 'linkflags.remove(x)' line added in error.Jeremy Allison2015-03-311-1/+0
| | | | | | | | | | | | Fixes bug #11165 - Bug in configure scripts when system-mitkrb5 is used https://bugzilla.samba.org/show_bug.cgi?id=11165 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Tue Mar 31 04:32:52 CEST 2015 on sn-devel-104
* tdb: Do not build test binaries if it's not a standalone buildAmitay Isaacs2015-03-311-11/+12
| | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Mar 31 01:56:02 CEST 2015 on sn-devel-104
* s4-torture: add test to verify nbt_name with "." ending handling.Günther Deschner2015-03-301-0/+55
| | | | | | | | | | | | | | | Windows uses a username of 'domain.example.com.' and we need to return it that way in the NETLOGON_SAM_LOGON_RESPONSE_EX. See e6e2ec0001fe3c010445e26cc0efddbc1f73416b for further details. Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Mon Mar 30 16:18:04 CEST 2015 on sn-devel-104
* s4-torture: use torture_comment instead of printf in raw notify test.Günther Deschner2015-03-301-59/+59
| | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>