summaryrefslogtreecommitdiffstats
path: root/source3
Commit message (Collapse)AuthorAgeFilesLines
...
* smbd: Simplify validate_lock_entriesVolker Lendecke2014-06-301-10/+11
| | | | | | | ... saves >100 bytes object code :-) Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture3: Add some brlock entries in cleanup2Volker Lendecke2014-06-301-2/+26
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbstatus: Fix an uninitialized variableVolker Lendecke2014-06-301-0/+1
| | | | | | | | | | We only print valid share mode entries, stale ones don't count. In traverse, let the callback decide about staleness. https://bugzilla.samba.org/show_bug.cgi?id=10680 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli: Make cli_smb2_close_fnum asyncVolker Lendecke2014-06-302-23/+92
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Align nt_time_to_unix_timespec with unix_timespec_to_nt_timeVolker Lendecke2014-06-303-6/+6
| | | | | | | Both take and return values now Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Align unix_timespec_to_nt_time with nt_time_to_unix_timespecVolker Lendecke2014-06-304-11/+11
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli: Make smb2cli_create return blobsVolker Lendecke2014-06-302-17/+17
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_snapper: use a talloc hierarchy for arraysDavid Disseldorp2014-06-301-27/+5
| | | | | | | | | | | Currently the config and snapshot array entries are freed individually. A talloc hierarchy can be used to avoid this behaviour. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Jun 30 21:41:13 CEST 2014 on sn-devel-104
* vfs_snapper: don't redefine GMT_FORMAT macroDavid Disseldorp2014-06-301-2/+1
| | | | | | | Use existing header definition. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs: add previous file version support for vfs_snapperDavid Disseldorp2014-06-301-0/+1215
| | | | | | | | | | | | | | Windows attempts to access previous file versions by first issuing an FSCTL_SRV_ENUMERATE_SNAPSHOTS request, and then using the corresponding snapshot timestamps in subsequent path based requests. This change sees vfs_snapper provide snapshot enumeration data via the get_shadow_copy_data VFS hook. Path based operations are also intercepted, with @GMT-$time components converted to snapper .snapshot/# paths. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs: add vfs_snapper moduleDavid Disseldorp2014-06-303-0/+844
| | | | | | | | | Provides an interface for accessing snapshots exposed by Snapper. The module communicates with snapperd on the local machine using the D-Bus interface. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Make messaging_send_to_children staticChristof Schmitt2014-06-302-4/+2
| | | | | | | | | | This function is only used in server.c Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Jun 30 17:20:00 CEST 2014 on sn-devel-104
* smbd: Use common function for FORCE_DIS and KILL_CLIENT_IP in parentChristof Schmitt2014-06-301-22/+11
| | | | | | | | | The parent smbd process only forwards the message to the child processes. Use a common function instead of two separate ones that do the same thing. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: SMB2 : Fix leak of blocking lock records in the database.Jeremy Allison2014-06-301-0/+1
| | | | | | | | | | | | | | | | | | Based on a fix from Hemanth Thummala <hemanth.thummala@gmail.com> Bug #10673 - Increasing response times for byte range unlock requests. The previous refactoring makes it obvious we need to call remove_pending_lock() in all places where we are returning from the SMB2 blocking lock call. https://bugzilla.samba.org/show_bug.cgi?id=10673 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ira Cooper <ira@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Jun 30 14:59:16 CEST 2014 on sn-devel-104
* s3: smb2: Simplify logic in reprocess_blocked_smb2_lock().Jeremy Allison2014-06-301-30/+25
| | | | | | | | | SMB2 blocking locks can only have one lock per request, so there can never be any other locks to wait for. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ira Cooper <ira@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: smb2: Remove unused code from remove_pending_lock().Jeremy Allison2014-06-301-13/+0
| | | | | | | | | SMB2 blocking locks can only have one lock per request, so there can never be any previous locks to remove. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ira Cooper <ira@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3-shadow-copy2: Protect against already converted namesVolker Lendecke2014-06-271-0/+28
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Fri Jun 27 09:03:53 CEST 2014 on sn-devel-104
* s3-shadow-copy2: Add more debugsVolker Lendecke2014-06-271-0/+9
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* s3-shadow-copy2: Fix incorrect case submountsVolker Lendecke2014-06-271-10/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* s3-shadow-copy2: Remove TODO and fix commentsChristof Schmitt2014-06-271-7/+8
| | | | | | | | | The patch "s3-shadow-copy2: Fix dir/@GMT-2012.10.15-13.48.43 form of paths" takes care of a case marked as TODO, remove it and adjust the comments accordingly. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3-shadow-copy2: Fix dir/@GMT-2012.10.15-13.48.43 form of pathsVolker Lendecke2014-06-271-2/+2
| | | | | | | | | | The previous clause in shadow_copy2_strip_snapshot would only handle @GMT- at the end of a pathname if it was the *only* pathname component. XP seems to send @GMT- at the end under certain circumstances even with a path prefix. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* s3-shadow-copy2: Add extreme debug output to shadow_copy2_strip_snapshotVolker Lendecke2014-06-271-0/+8
| | | | | | | This is sooo hairy to debug when things go wrong :-( Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* dbwrap: Print wait times with full precisionVolker Lendecke2014-06-271-3/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* smbd: Remove 2 indentation levelsVolker Lendecke2014-06-251-11/+11
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* s3: smbd - Prevent file truncation on an open that fails with share mode ↵Jeremy Allison2014-06-251-2/+20
| | | | | | | | | | | | | | | | | violation. Fix from Volker, really - just tidied up a little. The S_ISFIFO check may not be strictly neccessary, but doesn't hurt (might make the code a bit more complex than it needs to be). Fixes bug #10671 - Samba file corruption as a result of failed lock check. https://bugzilla.samba.org/show_bug.cgi?id=10671 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* s3: smbd - fix processing of packets with invalid DOS charset conversions.Jeremy Allison2014-06-253-13/+21
| | | | | | | | | | | | | | | CVE-2014-3493 Bug 10654 - Segmentation fault in smbd_marshall_dir_entry()'s SMB_FIND_FILE_UNIX handler https://bugzilla.samba.org/show_bug.cgi?id=10654 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jun 25 03:47:55 CEST 2014 on sn-devel-104
* s3: nmbd: Fix bug 10633 - nmbd denial of serviceJeremy Allison2014-06-251-5/+2
| | | | | | | | | | | | | | | | | The Linux kernel has a bug in that it can give spurious wakeups on a non-blocking UDP socket for a non-deliverable packet. When nmbd was changed to use non-blocking sockets it became vulnerable to a spurious wakeup from poll/epoll. Fix sys_recvfile() to return on EWOULDBLOCK/EAGAIN. CVE-2014-0244 https://bugzilla.samba.org/show_bug.cgi?id=10633 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* selftest: Run base.delaywrite against plugin_s4_dc only, and with kerberos ↵Andrew Bartlett2014-06-231-2/+1
| | | | | | | for faster connections Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: Fix fsctl_validate_neg_info to pass MS compliance suite.Ira Cooper2014-06-231-11/+17
| | | | | | | | | | | | | It turns out that all the client and server need to agree on is what protocol should have been negotiated. If they disagree, they should disconnect. The contents of the list of protocols used during negotiate and during FSCTL_VALIDATE_NEGOTIATE_INFO do not need to match. Signed-off-by: Ira Cooper <ira@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Mon Jun 23 14:28:25 CEST 2014 on sn-devel-104
* s3: Refactor smbd_smb2_request_process_negprotIra Cooper2014-06-232-63/+80
| | | | | | | | Breakout smb2_protocol_dialect_match to support future work in fsctl_validate_neg_info. Signed-off-by: Ira Cooper <ira@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* torture3: Reproducer for bug 10593Volker Lendecke2014-06-215-0/+168
| | | | | | | | | | We panic if we get an oplock break response for a cancelled create request Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Sat Jun 21 23:05:47 CEST 2014 on sn-devel-104
* smbd: Fix bug 10593Volker Lendecke2014-06-211-1/+1
| | | | | | | | | | | | | Bug 10593 is a panic that happens if we get an oplock break reply via dbwrap_watch for which we can't find the SMB request anymore. This error condition can legally happen when a client cancels the create request before the oplock break response comes in. This patch drops the dbwrap_watch_send request waiting for the oplock break when the request is cancelled. Yet another talloc hierarchy problem, but if done right, talloc hierarchies can make rundown of state easy :-) Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: First watch, then deferVolker Lendecke2014-06-211-5/+6
| | | | | | | | We exit if any of these if-statement fails, so a simple swap should not make a difference. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Store "struct deferred_open_record" instead of anonymous data on pmlVolker Lendecke2014-06-215-52/+48
| | | | | | | | The main point is to get a talloc parent that will go away when the request is cancelled Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Make cli_ntcreate cancellableVolker Lendecke2014-06-211-0/+13
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Make cli_ntcreate1 cancellableVolker Lendecke2014-06-211-0/+13
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Make cli_smb2_create_fnum cancellableVolker Lendecke2014-06-211-0/+13
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Enable oplocks for smb2 cli_ntcreateVolker Lendecke2014-06-211-0/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Align cli_ntcreate with other sync wrappersVolker Lendecke2014-06-211-8/+3
| | | | | | | ... saves 5 lines :-) Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: remove smb2 switch from cli_ntcreateVolker Lendecke2014-06-211-13/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Replace async cli_ntcreate by cli_createVolker Lendecke2014-06-212-62/+49
| | | | | | | | | | | Done by rename cli_ntcreate_send/recv to cli_ntcreate1_send/recv and cli_create_send/recv to cli_ntcreate_send/recv Possibly cli_create might be the better name, but I am sooo used to cli_ntcreate() that I don't really want to rename this ;-) Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Add cli_create_send/recvVolker Lendecke2014-06-212-0/+97
| | | | | | | Async wrapper around smb1 and smb2 create Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Make cli_smb2_create_fnum asyncVolker Lendecke2014-06-212-37/+139
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging3: Make messaging_dgm_init return 0/errnoVolker Lendecke2014-06-183-23/+22
| | | | | | | | 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 Jun 18 21:17:57 CEST 2014 on sn-devel-104
* messaging3: Use "goto fail_nomem" where appropriateVolker Lendecke2014-06-181-4/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging3: simplify messaging_dgm_lockfile_removeVolker Lendecke2014-06-181-14/+11
| | | | | | | full_path_tos() isn't really required here, this is not a hot code path Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging3: Make messaging_dgm_wipe return 0/errnoVolker Lendecke2014-06-184-17/+17
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging3: Make messaging_dgm_cleanup return 0/errnoVolker Lendecke2014-06-184-20/+22
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging3: Make the _send function return 0/errnoVolker Lendecke2014-06-184-28/+38
| | | | | | | This is to eventually make messaging_dgm usable in ctdb Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging3: Remove two uses of talloc_tos()Volker Lendecke2014-06-181-4/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>