summaryrefslogtreecommitdiff
path: root/source3
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* messaging3: Remove use of full_path_tos()Volker Lendecke2014-06-181-8/+6
| | | | | | | | This is not performance critical, and this removes source3 specific code Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* unix_msg: Lift sockaddr_un handling from unix_msg_sendVolker Lendecke2014-06-185-33/+24
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* unix_msg: Lift sockaddr_un handling from unix_msg_initVolker Lendecke2014-06-185-43/+43
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* unix_msg: Lift sockaddr_un handling from unix_dgram_sendVolker Lendecke2014-06-181-19/+17
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* unix_msg: Lift sockaddr_un handling from unix_dgram_send_queue_initVolker Lendecke2014-06-181-13/+7
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* unix_msg: Lift sockaddr_un handling from unix_dgram_initVolker Lendecke2014-06-181-16/+23
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: smb2 - strictly obey file name restrictions w.r.t. the SMB2 protocol spec.Jeremy Allison2014-06-181-0/+16
| | | | | | | | | | | | | MS-SMB2: 3.3.5.9 - Receiving an SMB2 CREATE Request If the file name length is greater than zero and the first character is a path separator character, the server MUST fail the request with STATUS_INVALID_PARAMETER. Found and fix confirmed by Microsoft test tool. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* s3: smb2 - Check supplied impersonation level on SMB2_CREATE.Jeremy Allison2014-06-181-0/+18
| | | | | | | | | | | | | | | MS-SMB2: 2.2.13 SMB2 CREATE Request ImpersonationLevel ... MUST contain one of the following values. The server MUST validate this field, but otherwise ignore it. NB. source4/torture/smb2/durable_open.c shows that this check is only done on real opens, not on durable handle reopens. Found and fix confirmed by Microsoft test tool. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* s3: smb2 - Negprot should return INVALID_PARAMETER if flags2 signed bit is set.Jeremy Allison2014-06-181-2/+17
| | | | | | | | | | | | | MS-SMB2: 3.3.5.2.4 Verifying the Signature. If the SMB2 header of the SMB2 NEGOTIATE request has the SMB2_FLAGS_SIGNED bit set in the Flags field, the server MUST fail the request with STATUS_INVALID_PARAMETER. Found and fix confirmed by Microsoft test tool. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* s3: auth: Fix winbindd_pam_auth_pac_send() to create a new info3 and merge ↵Jeremy Allison2014-06-181-2/+22
| | | | | | | | | | | | | in resource groups from a trusted PAC. Based on a patch from Richard Sharpe <realrichardsharpe@gmail.com>. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com> Reviewed-by: Simo Sorce <idra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jun 18 03:30:36 CEST 2014 on sn-devel-104
* s3: auth: Change auth3_generate_session_info_pac() to use a copy of the ↵Jeremy Allison2014-06-181-2/+9
| | | | | | | | | | | info3 struct from the struct PAC_LOGON_INFO. Call create_info3_from_pac_logon_info() to add in any resource SIDs from the struct PAC_LOGON_INFO to the info3. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com> Reviewed-by: Simo Sorce <idra@samba.org>
* s3: auth: Add create_info3_from_pac_logon_info() to create a new info3 and ↵Jeremy Allison2014-06-182-0/+80
| | | | | | | | | | merge resource group SIDs into it. Originally written by Richard Sharpe Richard Sharpe <realrichardsharpe@gmail.com>. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com> Reviewed-by: Simo Sorce <idra@samba.org>
* s3: auth: Change make_server_info_info3() to take a const struct ↵Jeremy Allison2014-06-183-6/+6
| | | | | | | | | | netr_SamInfo3 pointer instead of a struct PAC_LOGON_INFO. make_server_info_info3() only reads from the info3 pointer. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com> Reviewed-by: Simo Sorce <idra@samba.org>
* s3: auth: Add some const to the struct netr_SamInfo3 * arguments of ↵Jeremy Allison2014-06-183-4/+4
| | | | | | | | | | copy_netr_SamInfo3() and make_server_info_info3() Both functions only read from the struct netr_SamInfo3 * argument. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com> Reviewed-by: Simo Sorce <idra@samba.org>