summaryrefslogtreecommitdiff
path: root/source3
Commit message (Collapse)AuthorAgeFilesLines
* shadow_copy2: Fix error handling in shadow_copy2_get_shadow_copy_dataRajesh Joseph2016-07-281-18/+16
| | | | | | | | | | | Memory was freed in most of the failure cases. It is always better to free the memory at the end of the function so that all exit path of the function will free the memory. Otherwise chances are that you might miss some cleanup. Signed-off-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Uri Simchoni <uri@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* shadow_copy2: Add test case for snapprefix and delimiterRajesh Joseph2016-07-281-1/+7
| | | | | | | | | Add test case for the newly addded option shadow:snapprefix and shadow:delimiter Signed-off-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Uri Simchoni <uri@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* shadow_copy2: allow configurable prefix for snapshot nameRajesh Joseph2016-07-281-7/+303
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | With growing number of snapshots file-systems need some mechanism to differentiate one set of snapshots from other, e.g. monthly, weekly, manual, special events, etc. Therefore these file-systems provide different ways to tag snapshots, e.g. provide a configurable way to name snapshots, which is not just based on time. With only shadow:format it is very difficult to filter these snapshots. As part of this change added two new options, shadow:snapprefix and shadow:delimiter, in shadow_copy2 config. This option will accept regular expression (BRE) as input. With this optional parameter, one can specify a variable prefix component for names of the snapshot directories in the file-system. If this parameter is set, together with the shadow:format and shadow:delimiter parameters it determines the possible names of snapshot directories in the file-system. e.g. shadow:snapprefix = [a-z]*[0-9] When this option is provided then shadow:format option should always start with <delimiter> string. This delimiter is configurable via a new option, i.e. shadow:delimiter. Default value for this is "_GMT", e.g. _GMT-%Y.%m.%d-%H.%M.%S Signed-off-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Uri Simchoni <uri@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* shadow_copy2: create structure to store module specific informationRajesh Joseph2016-07-281-23/+57
| | | | | | | | | | | | | Create a separate structure to store module specific information. Currently only config values are saved. As of now there is no cleaner way to store run-time information or other module specific information in shadow_copy2 module. Therefore created a new structure to store all module specific information including config. Signed-off-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Uri Simchoni <uri@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* shadow_copy2: Add test cases to cover shadow:formatRajesh Joseph2016-07-281-0/+35
| | | | | | | | | Added test cases which will filter snapshot names based on shadow:format option in smb.conf Signed-off-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Uri Simchoni <uri@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* shadow_copy2: Fix shadow_copy2_posix_gmt_string return typeRajesh Joseph2016-07-281-6/+6
| | | | | | | | | This function returns -1 on error but the return type is size_t which is unsigned. Signed-off-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Uri Simchoni <uri@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* fss_agent: Fix a signed/unsigned mixupVolker Lendecke2016-07-281-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* lib: Move "message_send_all" to serverid.cVolker Lendecke2016-07-288-117/+117
| | | | | | | | | Trying to trim down messages.c a bit: Sending to all processes that are registered in serverid.tdb and filtering to me is not really logic of general messaging but more of the serverid code. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3/notifyd: add async send/recv functionsRalph Boehme2016-07-281-3/+108
| | | | | | | | | | | | | | | Previously, without this patch, if notifyd died for whatever reason, it would be restarted from smbd. However, if its initialization failed and it exitted again, there would be no child entry in smbd for it and it wouldn't be attempted to restart it again. This patch adds async send/recv methods for starting cleanupd that will reschedule restart attempt every second in case initilisation failed. Bug: https://bugzilla.samba.org/show_bug.cgi?id=12022 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3/cleanupd: use smbd_cleanupd.tdbRalph Boehme2016-07-282-39/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using messaging to send individual cleanup events, it works this way: o parent smbd stores cleanup events (ie exitted children) in smbd_cleanup.tdb o it sends cleanupd an empty MSG_SMB_NOTIFY_CLEANUP message o cleanupd does a traverse on the smbd_cleanupd.tdb and collects all childs in a list o after the traverse cleanupd walks the list and does the real work It would have been possible to optimize for the common case by passing info about exitted childs with the message (as was done before this patch), adding a new message type for triggering a db traverse that would be used when cleanupd had to be restarted and cleanup events may have been accumulated in cleanup.tdb. But this could be subject to subtle race conditions and could loose events if cleanupd dies randomly. Bug: https://bugzilla.samba.org/show_bug.cgi?id=12022 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3/smbd: add cleanupd_init_send()/recv()Ralph Boehme2016-07-281-3/+105
| | | | | | | | | | | | | | | Previously, without this patch, if cleanupd died for whatever reason, it would be restarted from smbd. However, if cleanupd initialization failed and it exitted again, there would be no child entry in smbd for it and it wouldn't be attempted to restart it again. This patch adds async send/recv methods for starting cleanupd that will reschedule restart attempt every second in case initilisation failed. Bug: https://bugzilla.samba.org/show_bug.cgi?id=12022 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3/lib: add smbd_cleanupd.tdbRalph Boehme2016-07-283-1/+202
| | | | | | | | | | This will be used between cleanupd and smbd for passing information about exitted smbd childs. Bug: https://bugzilla.samba.org/show_bug.cgi?id=12022 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* dbwrap_ctdb: Remove setting of database priority from sambaAmitay Isaacs2016-07-251-16/+0
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* AddressSanitizer: Initialize for vfs_fruit.cGarming Sam2016-07-251-1/+1
| | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Volker Lendecke <vl@samba.org>
* AddressSanitizer: Initialize for smbd/oplock.cGarming Sam2016-07-251-1/+1
| | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Volker Lendecke <vl@samba.org>
* vfs_gpfs: Retry getacl with DAC capability if necessaryChristof Schmitt2016-07-251-2/+28
| | | | | | | | | | | | | | Samba always tries to read the ACL of a file and checks it internally. If the READ_ACL permission is missing in GPFS, then then reading the ACL for Samba internal evaluation will be denied and opening the file or directory fails. Change this by retrying reading the ACL with the DAC capability if access was denied. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Christof Schmitt <cs@samba.org> Autobuild-Date(master): Mon Jul 25 10:30:02 CEST 2016 on sn-devel-144
* s3: vfs: ceph: Add posix acl supportYan, Zheng2016-07-242-47/+9
| | | | | | | | | Signed-off-by: Yan, Zheng <zyan@redhat.com> Signed-off-by: Ira Cooper <ira@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Ira Cooper <ira@samba.org> Autobuild-Date(master): Sun Jul 24 04:08:23 CEST 2016 on sn-devel-144
* s3: vfs: generalize functions that set/get posix acl through xattrYan, Zheng2016-07-244-517/+559
| | | | | | | | Move posix acl related code in vfs_glusterfs.c to a seperate module. Signed-off-by: Yan, Zheng <zyan@redhat.com> Signed-off-by: Ira Cooper <ira@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4: messaging: Remove bool auto_remove parameter from imessaging_init().Jeremy Allison2016-07-232-4/+3
| | | | | | | | | With modern messaging this doesn't do anything (it's an empty destructor). Clean up so we can add a proper destructor in future. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3: smbd: vfs: Remove any stale xattr values during file/directory create in ↵Jeremy Allison2016-07-231-0/+101
| | | | | | | | vfs_xattr_tdb() Pair-programmed-with: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* docs-xml:smbdotconf: default "ntlm auth" to "no"Stefan Metzmacher2016-07-221-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:selftest: run smbclient_auth with a few more combinationsStefan Metzmacher2016-07-221-4/+5
| | | | | | | E.g. we try lanman, ntlmv1 and ntlmv2 authentication. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:tests: add 'as user' to the test names in test_smbclient_auth.shStefan Metzmacher2016-07-221-9/+9
| | | | | | | | We already have 'as anon', having an indication for each case makes it easier to mark some as knownfail. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:ntlm_auth: call fault_setup() in order to get usefull backtracesStefan Metzmacher2016-07-221-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* smbd: Enable leases by defaultVolker Lendecke2016-07-221-1/+1
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:libnet_dssync_keytab: ignore empty supplementalCredentialsBlob structuresStefan Metzmacher2016-07-201-2/+2
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11441 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* notifyd: Move BlockSignals calls to server.cVolker Lendecke2016-07-202-4/+4
| | | | | | | | | | | | | notifyd_send() is called as part of smbd initialization both in normal daemon mode after a fork, but also in interactive mode. In interactive mode, notifyd should not modify the global signal state with BlockSignals(). This patch moves the signal blocking to the place where we know that notifyd is a child daemon. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jul 20 09:04:00 CEST 2016 on sn-devel-144
* smbd: Re-register notify requestsVolker Lendecke2016-07-204-0/+71
| | | | | | | | When notifyd is restarted, the parent will broadcast that fact to all workers. They will then re-register their notify requests. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Restart notifydVolker Lendecke2016-07-201-0/+12
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Store notify filters in fsp->notifyVolker Lendecke2016-07-201-5/+12
| | | | | | | | When notifyd crashes, it will be restarted. We need to restore the filters with notifyd Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Log which notifyd was foundVolker Lendecke2016-07-201-0/+6
| | | | | | | Just a debugging aid Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Remember notifyd's serveridVolker Lendecke2016-07-201-2/+8
| | | | | | | Similarly to cleanupd, this is necessary to restart notifyd Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* notify_msg: Deregister handler upon talloc_freeVolker Lendecke2016-07-201-0/+12
| | | | | | | So far, we haven't TALLOC_FREE'ed the notify context. This will change. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Remove "listel" from notify_msgVolker Lendecke2016-07-201-37/+1
| | | | | | | | | | | | We have all information that was kept in "notify_list" in other parts of smbd as well. The only possible downside of this patch is that we possibly have a lot more fsp's than fsp's with notifies, so notify_callback() might be a bit slower in this situation. If this turns out to be a problem, I'd rather put some more smarts into the notifyd protocol to enable a better indexed notify_callback(). For now, this avoids data to be kept in two places. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Protect notify_callback from stray pointersVolker Lendecke2016-07-201-3/+24
| | | | | | | | This protection right now lives in notify_msg.c with the notify_list, but that will go. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Pass "sconn" via notify to notify_callback()Volker Lendecke2016-07-205-9/+21
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: There's only one notify_callbackVolker Lendecke2016-07-205-26/+29
| | | | | | | | We do not have different callbacks per notify, put the callback function into the notify context Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Make notify_callback() publicVolker Lendecke2016-07-202-2/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: "path" is no longer needed in notify_listVolker Lendecke2016-07-201-4/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Add "path" to notify_removeVolker Lendecke2016-07-203-7/+21
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Avoid a talloc_asprintfVolker Lendecke2016-07-201-13/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Add fsp_fullbasepathVolker Lendecke2016-07-202-0/+12
| | | | | | | | Okay, this is similar to full_path_tos, but with variable arrays now and much simpler :-) Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Factor out notify_initVolker Lendecke2016-07-201-7/+30
| | | | | | | | | Before this patch, failure of notify_init was ignored. Also, no proper error handling of a messaging_register failure was done. Fix those, also adding some debug messages. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: sconn->sys_notify_ctx is not usedVolker Lendecke2016-07-202-5/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Don't stop sending to children when one send failsVolker Lendecke2016-07-201-1/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: torture: Regression test case to specify exactly how UNIX extensions ↵Jeremy Allison2016-07-202-1/+148
| | | | | | | | | | | | | | | should act on files with streams. If a stream is open, refuse the unlink. Ensure UNIX unlink request can remove a file containing streams. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12021 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Wed Jul 20 05:20:29 CEST 2016 on sn-devel-144
* s3: smbd: Fix delete operations enumerating streams inside a file. This must ↵Jeremy Allison2016-07-202-2/+4
| | | | | | | | | | | | | | | | | | | always be done as a Windows operation. When using UNIX extensions to delete a file containing streams, the open for delete and close operations need to enumerate the contained streams and do CREATE and UNLINK operations on the stream names. These must always be done as Windows operations (remove the SMB_FILENAME_POSIX_PATH flag) as the stream names are Windows paths. Without this the create operation under the unlink will recurse and cause the client to time out (or a server crash). BUG: https://bugzilla.samba.org/show_bug.cgi?id=12021 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* param: Correct the defaults for "dcerpc endpoint services"Andrew Bartlett2016-07-191-1/+1
| | | | | | | | | | | | We must not list any services that we skip building, as otherwise all RPC services fail to start. We now build without the source4 spoolss server in non-developer builds This fixes commit 0b4c741b9c03d147ee5f56d027bacda75c1b5282 BUG: https://bugzilla.samba.org/show_bug.cgi?id=12025 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* vfs_acl_xattr: objects without NT ACL xattrRalph Boehme2016-07-191-39/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even with "ignore system acls" set to "yes", for objects without NT ACL xattr we use the underlying filesystem permissions to construct an NT ACL. This can result in *very* unexpected permissions, eg: - a directory with the following ACL: $ ./bin/smbcacls -Uslow%pass //localhost/normal "" REVISION:1 CONTROL:SR|DP OWNER:SLOW\slow GROUP:Unix Group\root ACL:SLOW\slow:ALLOWED/0x0/FULL So only one non-inheritable(!) ACE. - creating a subdirectory: $ ./bin/smbclient -Uslow%pass //localhost/normal -c "mkdir dir1" - checking whether there's an ACL xattr: $ getfattr -m "" /Volumes/normal/dir1 getfattr: Removing leading '/' from absolute path names system.posix_acl_access system.posix_acl_default user.DOSATTRIB So there isn't an ACL xattr, because there where no inheritable ACEs on the parent folder. - reading the new subdirectories ACL: $ ./bin/smbcacls -Uslow%pass //localhost/normal "dir1" REVISION:1 CONTROL:SR|DP OWNER:SLOW\slow GROUP:Unix Group\slow ACL:SLOW\slow:ALLOWED/0x0/FULL ACL:Unix Group\slow:ALLOWED/0x0/READ ACL:Everyone:ALLOWED/0x0/READ ACL:NT Authority\SYSTEM:ALLOWED/0x0/FULL The ACES for "SLOW\slow", "Unix Group\slow" and "Everyone" are coming from the underlying filesystem. This is the problem. - Windows assigns the following ACL in this situation: $ ./bin/smbcacls -UAdministrator%Passw0rd //10.10.10.14/data "dir" REVISION:1 CONTROL:SR|PD|DI|DP OWNER:VORDEFINIERT\Administratoren GROUP:WIN2008R2\Domänen-Benutzer ACL:WIN2008R2\Administrator:ALLOWED/0x0/FULL $ ./bin/smbclient -UAdministrator%Passw0rd //10.10.10.14/data -c "mkdir dir\dir1" $ ./bin/smbcacls -UAdministrator%Passw0rd //10.10.10.14/data "dir\dir1" REVISION:1 CONTROL:SR|DI|DP OWNER:VORDEFINIERT\Administratoren GROUP:WIN2008R2\Domänen-Benutzer ACL:VORDEFINIERT\Administratoren:ALLOWED/0x0/FULL ACL:NT-AUTORITÄT\SYSTEM:ALLOWED/0x0/FULL By changing make_default_filesystem_acl() to only adds user and system ACE to the ACL of objects that lack an ACL xattr, we match Windows behaviour: $ ./bin/smbclient -Uslow%pass //localhost/normal -c "mkdir dir2" $ ./bin/smbcacls -Uslow%pass //localhost/normal "dir2" REVISION:1 CONTROL:SR|DP OWNER:SLOW\slow GROUP:Unix Group\slow ACL:SLOW\slow:ALLOWED/0x0/FULL ACL:NT Authority\SYSTEM:ALLOWED/0x0/FULL Bug: https://bugzilla.samba.org/show_bug.cgi?id=12028 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): Tue Jul 19 10:22:05 CEST 2016 on sn-devel-144
* s3/smbd: move make_default_filesystem_acl() to vfs_acl_common.cRalph Boehme2016-07-193-114/+108
| | | | | | | | | | This function is only used in vfs_acl_common.c and will be modified in the next commit. Bug: https://bugzilla.samba.org/show_bug.cgi?id=12028 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>