summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* tdb: increase readability of read_record_on_left()Michael Adam2014-06-261-27/+41
| | | | | | | | by using early returns and better variable names, and reducing indentation. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* tdb: factor read_record_on_left() out of tdb_free()Michael Adam2014-06-261-30/+49
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* torture4: Add a little test that truncate actually works :-)Volker Lendecke2014-06-251-0/+13
| | | | | | | | 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 Jun 25 13:37:24 CEST 2014 on sn-devel-104
* 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>
* s4: torture: Add regression test case for #10671 - Samba file corruption as ↵Jeremy Allison2014-06-251-0/+73
| | | | | | | | | | | | | | | | | | a result of failed lock check. Adds a new test to raw.open. Opens a file with SHARE_NONE, writes 1 byte at offset 1023, attempts a second open with r/w access+truncate disposition, then checks that open fails with SHARING_VIOLATION, and the file is not truncated (is still size 1024). Correctly detects the bug and fixed smbd for me. 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 - 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>
* ctdb-build: Instead of default test_wrap, install fixed test_wrapAmitay Isaacs2014-06-241-1/+14
| | | | | | | | | | | tests/scripts/test_wrap script is updated based on the configured paths. This should be installed instead of the stock version in the source. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Tue Jun 24 09:37:39 CEST 2014 on sn-devel-104
* ctdb-build: Fix sed expression to protect '\'Amitay Isaacs2014-06-241-1/+1
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-build: Use correct path variables for ctdb_run_tests.shAmitay Isaacs2014-06-241-1/+1
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-build: Use CTDB_ETCDIR instead of ETCDIR/ctdbAmitay Isaacs2014-06-244-6/+8
| | | | | | | This avoids hardcoding path components in source. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-build: Use CTDB_RUNDIR instead of VARDIR/run/ctdbAmitay Isaacs2014-06-242-5/+6
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-build: Add special target to get build versionAmitay Isaacs2014-06-242-1/+7
| | | | | | | This avoids the need to build a tarball to get version information. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-build: Allow waf to build rpms without configure firstAmitay Isaacs2014-06-241-1/+2
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* torture: Remove confusing reference to (1 sec == 0.25)Andrew Bartlett2014-06-241-46/+46
| | | | | | | | | | | | | The write should never update the time, so the fraction of the write time delay we use is not important. Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Jun 24 01:44:06 CEST 2014 on sn-devel-104
* torture: tidy up whitespace for clarityAndrew Bartlett2014-06-231-2/+2
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* selftest: Run base.delaywrite against plugin_s4_dc only, and with kerberos ↵Andrew Bartlett2014-06-232-8/+7
| | | | | | | for faster connections Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture-base.delaywrite: assert the for a delayed write, that it just takes ↵Andrew Bartlett2014-06-231-29/+24
| | | | | | | | | | | | longer than our configured delay This removes the hardcoded TIMEDELAY_SECS that was then made variable by the confusing "secs" variable Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: Only error if the write time was updated is less than the expected ↵Andrew Bartlett2014-06-231-19/+19
| | | | | | | | | | | | | | delay The previous test was far, far too tight, it was in seconds 1/4 of the fraction of the normal delay we had configured Samba to use so (1/4) * (500 000 / 2000 000) = 1/16 (sec). This margin appears to just be too tight for our loaded test server. Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: Store writetimeupdatedelay in a double to allow easier comparisonAndrew Bartlett2014-06-231-16/+16
| | | | | | | | | | In particular, this avoids a comparison with double diff = timeval_elapsed() being promoted to an integer. Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: convert raw.mux to use torture_comment() macros instead of printf()Andrew Bartlett2014-06-231-28/+28
| | | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: convert raw.mux to use torture_assert() macrosAndrew Bartlett2014-06-231-27/+17
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: convert CHECK_STATUS into torture_assert_ntstatus_equal in raw.mux ↵Andrew Bartlett2014-06-231-33/+26
| | | | | | | | tests Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* selftest: Only run samba4.rpc.samr.passwords.{lockout,badpwdcount} onceAndrew Bartlett2014-06-231-1/+1
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: Use torture_assert() macros in rpc.samr testAndrew Bartlett2014-06-231-18/+3
| | | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Kamen Mazdrashki <kamenim@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: Make smb2cli_create 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>
* torture: add FSRVP share snapshot ACL testDavid Disseldorp2014-06-211-2/+194
| | | | | | | | | | | The new test_fsrvp_share_sd test sets a unique ACL on the base share, and then confirms that snapshot shares carry the same ACL. 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): Sat Jun 21 15:10:12 CEST 2014 on sn-devel-104
* torture: add FSRVP message sequence timeout testDavid Disseldorp2014-06-211-0/+25
| | | | | | | | | Sleep at various points in the FSRVP snapshot creation state machine, and confirm that the state timeout is reflected in subsequent server responses. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* torture: add timeout sleeps to fsrvp create helperDavid Disseldorp2014-06-211-6/+92
| | | | | | | | | | | | Attempt to trip message sequence timeouts at various points in the FSRVP shadow-copy creation state machine. The default timeout-injection sleep durations correspond to those documented in MS-FSRVP (+500ms). They can also be manually set using the "fss: sequence timeout" parameter. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* torture: validate FSCTL_SRV_ENUMERATE_SNAPSHOTS responseDavid Disseldorp2014-06-211-0/+10
| | | | | | | | | | Check the NumberOfSnapShotsReturned and SnapShotArraySize fields in the FSCTL_SRV_ENUMERATE_SNAPSHOTS response match expected values. This is a regression test for bso#10549. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* nss_wrapper: Fix some "discarding const" warningsVolker Lendecke2014-06-211-6/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* nss_wrapper: Align indentation with the rest of SambaVolker Lendecke2014-06-211-16/+16
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* autobuild: fix ctdb build of samba-ctdb target after switch to waf.Michael Adam2014-06-211-2/+1
| | | | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Sat Jun 21 02:05:38 CEST 2014 on sn-devel-104
* ctdb: update configure.rpm with builtin and bundled library argumentsMichael Adam2014-06-201-0/+2
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>