summaryrefslogtreecommitdiff
path: root/source3
Commit message (Collapse)AuthorAgeFilesLines
* s3: SMB2 : Fix leak of blocking lock records in the database.Jeremy Allison2014-07-191-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 (cherry picked from commit cee1531e551e5ccd5ccd4a55de226ad686919486)
* s3: smb2: Simplify logic in reprocess_blocked_smb2_lock().Jeremy Allison2014-07-191-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> (cherry picked from commit 1a02a1e6aa15c028a848585d66cecbbdda8015b3)
* s3: smb2: Remove unused code from remove_pending_lock().Jeremy Allison2014-07-191-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> (cherry picked from commit 508c09c6a019458bb0290fbf284e73c24feddb0e)
* smbd: Remove 2 indentation levelsVolker Lendecke2014-07-171-11/+11
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> (cherry picked from commit 1dc5c20c8f7d8aa96fa0601bf5bf6dc69fb79d9f)
* s3: smbd - Prevent file truncation on an open that fails with share mode ↵Jeremy Allison2014-07-171-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> (cherry picked from commit 31b3427a417217e5e869baafdf63e633efc39d12) [ddiss@samba.org: 4.1 backport]
* dsdb: Always store and return the userParameters as a array of LE 16-bit valuesAndrew Bartlett2014-07-151-5/+26
| | | | | | | | | | | | | | | | This is not allowed to be odd length, as otherwise we can not send it over the SAMR transport correctly. Allocating one byte less memory than required causes malloc() heap corruption and then a crash or lockup of the SAMR server. Andrew Bartlett Bug: https://bugzilla.samba.org/show_bug.cgi?id=10130 Change-Id: I5c0c531c1d660141e07f884a4789ebe11c1716f6 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit d7b4d10aba90f4a1acf01d1d5ab62161862f62f7)
* s3: smbd: Locking - re-add pending lock records if we fail to acquire a lock ↵Jeremy Allison2014-07-151-17/+80
| | | | | | | | | | | | | | | | | | | (and the lock hasn't timed out). Keep the blocking lock record and the pending lock records consistent if we are dealing with multiple blocking lock requests in one SMB1 LockingX request. Ensure we re-add the records under the record lock, to avoid race conditions. Bug #10684 - SMB1 blocking locks can fail notification on unlock, causing client timeout. https://bugzilla.samba.org/show_bug.cgi?id=10684 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE> (cherry picked from commit 954401f8b2b16b3e2ef9655e8ce94d657becce36)
* s3: smbd: Locking - treat lock timeout the same as any other error.Jeremy Allison2014-07-151-53/+38
| | | | | | | | | | | | | Allows the special case in process_blocking_lock_queue() that talks back to the client to be removed. Bug #10684 - SMB1 blocking locks can fail notification on unlock, causing client timeout. https://bugzilla.samba.org/show_bug.cgi?id=10684 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE> (cherry picked from commit cc9de6eb091159a84228b988c49261c46c301233)
* s3: smbd: Locking - add and use utility function lock_timed_out().Jeremy Allison2014-07-151-3/+21
| | | | | | | | | | Bug #10684 - SMB1 blocking locks can fail notification on unlock, causing client timeout. https://bugzilla.samba.org/show_bug.cgi?id=10684 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE> (cherry picked from commit 12be57ef3b2d1b670be7a83f29cd580938030015)
* s3: smbd: Locking - convert to using utility macro used elsewhere.Jeremy Allison2014-07-151-2/+1
| | | | | | | | | | Bug #10684 - SMB1 blocking locks can fail notification on unlock, causing client timeout. https://bugzilla.samba.org/show_bug.cgi?id=10684 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE> (cherry picked from commit 517fa80bd385c6adcfee03ea6b25599013ad88f5)
* s3:smb2_read: let smb2_sendfile_send_data() behave like send_file_readX()Stefan Metzmacher2014-07-151-16/+53
| | | | | | | | | | | | | | | We now pass the header to SMB_VFS_SENDFILE(), so we have to handle that also in the fallback code. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10706 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Jul 11 22:57:17 CEST 2014 on sn-devel-104 (cherry picked from commit 7c5ea400ad1f280f5c338c31a0a893154340fdb3)
* pysmbd: improve the return of error codes in the python smbd bindingsGarming Sam2014-07-151-31/+27
| | | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> (cherry picked from commit ad773cc01435e65fa5d8e84758b0642069e96c40)
* passdb: Do not routinely clear the global memory returned by ↵Andrew Bartlett2014-07-152-15/+41
| | | | | | | | | | | | | | | | get_global_sam_sid() This avoids use-after-free errors and tdb database churn. Andrew Bartlett Change-Id: If7ab2e24556d9dffc7ad22c0489d665dd75a0cab Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Kamen Mazdrashki <kamenim@samba.org> (cherry picked from commit cda32d4e47aa3efb040eb60f1a0332ea8dd58417) The last 9 patches address bug #10701 - backport dsdb related crash fixes and build fixes.
* torture3: Fix bug 10687Volker Lendecke2014-07-151-1/+1
| | | | | | | 'RW2' smbtorture test fails when -N <numprocs> is set to 2 due to the invalid status check in the second client. Signed-off-by: Volker Lendecke <vl@samba.org>
* libsmb: Provide a talloc_stackframe() to external users of libsmb_setget.cAndrew Bartlett2014-07-151-2/+15
| | | | | | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit bc5bd4010e8fedf19047ed6f7a793cd373f9f14f) The last 3 patches address bug #8449 (simple use case results in "no talloc stackframe around, leaking memory" error).
* libsmbclient: Wrap more function calls in talloc_stackframe() to protect ↵Andrew Bartlett2014-07-151-0/+17
| | | | | | | | | | | | | | against talloc_tos() calls BUG: https://bugzilla.samba.org/show_bug.cgi?id=8449 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): Wed Apr 2 02:36:08 CEST 2014 on sn-devel-104 (cherry picked from commit 014342746f5af1aaaf1c2f8b44098c3a944e4f0a)
* pam_smbpass: Wrap calls in talloc_stackframe() to avoid warnings about ↵Andrew Bartlett2014-07-153-1/+31
| | | | | | | | | | | | | leaking memory Any code in source3 is permitted to use talloc_tos() at any point, so we must protect all the library interfaces against memory leaks this way. Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 8f3a516acb8c95cd6d88bf80abd495ac0cafaae3)
* smbd: Avoid double-free in get_print_db_bynameVolker Lendecke2014-07-151-2/+2
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Bug: https://bugzilla.samba.org/show_bug.cgi?id=10699
* s3: smbd: Locking, fix off-by one calculation in brl_pending_overlap().Jeremy Allison2014-07-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Consider: lock = start=110,size=10 pend_lock = 100, size=10 Should not overlap. However, (lock->start <= pend_lock->start + pend_lock->size) 110 100 10 is true, so it returns true (overlap). lock->start <= pend_lock->start + pend_lock->size should be: lock->start < pend_lock->start + pend_lock->size https://bugzilla.samba.org/show_bug.cgi?id=10685 Signed-off-by: Jeremy Allison <jra@samba.org>
* smbstatus: Fix an uninitialized variableVolker Lendecke2014-07-151-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> (cherry picked from commit 9f2e90754bcb7bf5f7159d07f0bc5fe754e71bf5)
* s3: fix missing braces in nfs4_acls.cAbhidnya Joshi2014-07-151-1/+2
| | | | | | | | | | | Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Aug 28 20:25:56 CEST 2013 on sn-devel-104 Bug: https://bugzilla.samba.org/show_bug.cgi?id=10688 (missing braces in nfs4_acls.c)
* s3:winbindd - fix bad bugfix for bug #10280 - winbind panic if AD server is ↵Jeremy Allison2014-07-151-2/+2
| | | | | | | | | | down. Previous bug fix reversed the sense of the test for out of memory. https://bugzilla.samba.org/show_bug.cgi?id=10280 Signed-off-by: Jeremy Allison <jra@samba.org>
* s3/s4: smbd, rpc, ldap, cldap, kdc services.Jeremy Allison2014-07-151-6/+10
| | | | | | | | | | | | | | | | | | | | Allow us to start if we bind to *either* :: or 0.0.0.0. Allows us to cope with systems configured as only IPv4 or only IPv6. Bug #10653 - Samba won't start on a machine configured with only IPv4. https://bugzilla.samba.org/show_bug.cgi?id=10653 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-By: Amitay Isaacs <amitay@gmail.com> Reviewed-By: Alexander Bokovoy <ab@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Jun 7 01:01:44 CEST 2014 on sn-devel-104 (cherry picked from commit 463311422ca1caad2e228deb630e9d12e212fae1)
* msg_channel: Fix a 100% CPU loopVolker Lendecke2014-07-151-0/+12
| | | | | | | | | | | | | | | | | | In a ctdb setup, msg_read_got_ctdb did not set channel->pending_req to NULL. In smbXsrv_session_close_loop in any error condition this leads to a 100% loop. smbXsrv_session_close_loop continously retries, but because close_channel->pending_req is != NULL, msg_read_send will always return EBUSY, making smbXsrv_session_close_loop retry infinitely. This patch makes sure that msg_read_got_ctdb correctly NULLs out pending_req. msg_channel.c does not exist in master anymore, so this patch is 4.1 only. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Bug: https://bugzilla.samba.org/show_bug.cgi?id=10663 100% smbd cpu loop in ctdb setups
* smbd: Fix bug 10593Volker Lendecke2014-07-151-1/+8
| | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10593 PANIC: assert failed at ../source3/smbd/open.c(1582): ret
* Merge tag 'samba-4.1.9' into v4-1-testKarolin Seeger2014-06-234-18/+23
|\ | | | | | | samba: tag release samba-4.1.9
| * s3: smbd - fix processing of packets with invalid DOS charset conversions.Jeremy Allison2014-06-223-13/+21
| | | | | | | | | | | | | | | | | | | | 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> CVE-2014-3493
| * s3: nmbd: Fix bug 10633 - nmbd denial of serviceJeremy Allison2014-06-221-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 Signed-off-by: Jeremy Allison <jra@samba.org>
* | winbindd: Ensure we do not look at rid_array before checking if it was returnedAndrew Bartlett2014-06-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We no longer return early if there are no members, we just return an empty array. Fixes bug #10627 - rid_array used before status checked - segmentation fault due to null pointer dereference https://bugzilla.samba.org/show_bug.cgi?id=10627 Change-Id: I7b0949e0c0b9277426a8007514a8658615f6c709 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-1-test): Tue Jun 10 13:08:54 CEST 2014 on sn-devel-104
* | s3: libsmbclient: Work around bugs in SLES cifsd and Apple smbx SMB1 servers.Jeremy Allison2014-06-101-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SLES's cifsd and Apple's smbx do not correctly handle FILE_NON_DIRECTORY_FILE which prevents recursive copies in gvfs from working correctly [1] since GVFS tries to open the directory, expecting ENOTDIR, but it suceeds and appears as a zero byte file. This fix adds code to the cli_open() open code that checks if CreateOptions was requested with FILE_NON_DIRECTORY_FILE set, and if the attributes returned include FILE_ATTRIBUTE_DIRECTORY we synchronously close the file handle just opened, and return NT_STATUS_FILE_IS_A_DIRECTORY to the caller. Depends on the previous API update to cli_ntcreate() to add returned attributes. Fixes bug #10587 - Opening directories on SLES's cifsd and Apple's smbx succeeds. https://bugzilla.samba.org/show_bug.cgi?id=10587 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit b2ce2441a35ed68c39791168217d159352b5143c)
* | s3: client : correctly fill in the struct smb_create_returns from ↵Jeremy Allison2014-06-101-5/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | cli_ntcreate(), cli_ntcreate_recv(), cli_nttrans_create() and cli_nttrans_create_recv(). This completes the update of the create API to return all the data returned by the server on open. We can now use this data to detect buggy servers without an extra round trip. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 3d8ba9b34e34c1f3e0c1c231d6b772994b45eeaf)
* | s3: client : Add extra return parameter to all client open calls.Jeremy Allison2014-06-1022-113/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a return parameter of struct smb_create_returns *cr to cli_ntcreate() cli_ntcreate_recv() cli_nttrans_create() cli_nttrans_create_recv() Always pass in NULL for now. This fixes the create API to always fully return the data the server has given back to us on the open file to the caller. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 69e24b4e8bc607806453ab137efda6d6bf74fb12)
* | s3: client - rename 'struct smb2_create_returns' to 'struct ↵Jeremy Allison2014-06-102-3/+3
|/ | | | | | | | smb_create_returns' so we can use this in SMB1 create returns as well. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 2900dfa5b928ef237e72ac4e15481e083d61750a)
* printing: fix purge of all print jobsDavid Disseldorp2014-06-021-4/+19
| | | | | | | | | | | | | | | The incorrect (system) jobid is currently passed to the job deletion function. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10612 Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com> Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit efb4684a3fc0b32a71eab013000f730e6b144a67) Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-1-test): Mon Jun 2 19:06:43 CEST 2014 on sn-devel-104
* s3: smb2: Move from using SBVAL to put NTTIMEs on the wire to ↵Jeremy Allison2014-05-271-42/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | put_long_date_timespec. put_long_date_timespec() correctly calls round_timespec() on the time parameters, and is the correct function to use when writing *any* file-based NTTIME on the wire. Move from using NTTIME variables internally in the server to struct timespec variables, which is what all the other server code uses. Only map to NTTIME as the last step of marshalling the output data. The previous SMB2 create code missed the round_timespec() call before marshalling. Bug 3124 - xcopy /d with samba shares works not as aspected https://bugzilla.samba.org/show_bug.cgi?id=3124 which is a regression from a long-ago bug with SMB1. Signed-off-by: Jeremy Allison <jra@samba.org>
* s3: smb2: Move from using SBVAL to put NTTIMEs on the wire to ↵Jeremy Allison2014-05-271-70/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | put_long_date_timespec. put_long_date_timespec() correctly calls round_timespec() on the time parameters, and is the correct function to use when writing *any* file-based NTTIME on the wire. The smb2_close() code being modified already did this by hand, and so this doesn't change any of the functionality, only makes the SMB2 code match all of the other server code in Samba. Move from using NTTIME variables internally in the server to struct timespec variables, which is what all the other server code uses. Only map to NTTIME as the last step of marshalling the output data. Not following the put_long_date_timespec() convention in the SMB2 create code caused the round_timespec() step to have been missed in that code - thus bug: Bug 3124 - xcopy /d with samba shares works not as aspected https://bugzilla.samba.org/show_bug.cgi?id=3124 which is a regression from a long-ago bug with SMB1. Signed-off-by: Jeremy Allison <jra@samba.org>
* lib-util: rename memdup to smb_memdup and fix all callers (bug #10556)Björn Baumbach2014-05-208-11/+11
| | | | | | | | | | | Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit fae7e5d771d1c69bded1189b23335647023fa0f7) Conflicts: ctdb/lib/util/util.h Also renamed memdup() in source3/locking/brlock.c
* winbindd: use exit_daemon() to pass startup status to systemdAlexander Bokovoy2014-05-201-9/+4
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=10517 Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> (cherry picked from commit 91013315c9fa946bf85c85df0ccd40a803f3dc6f)
* nmbd: use exit_daemon() to report status to systemdAlexander Bokovoy2014-05-201-25/+14
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=10517 Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> (cherry picked from commit a54e94559b5ebabbb8c5c938fdf159efceff39e6)
* smbd: use exit_daemon() to support reporting to systemd from smbdAlexander Bokovoy2014-05-201-25/+19
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=10517 Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* add systemd integrationAlexander Bokovoy2014-05-203-0/+13
| | | | | | | | | | | | | | | | | Add --with-systemd / --without-systemd options to check whether libsystemd-daemon library is available and use it to report service startup status to systemd for smbd/winbindd/nmbd and AD DC. The problem it solves is correct reporting of the Samba services at the point when they are ready to serve clients, important for high availability software integration. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10517 Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> (cherry picked from commit 54b5d9a7384ae27b2a26586ff909128427c05abe)
* FSCTL_GET_SHADOW_COPY_DATA: Don't return 4 extra bytes at endChristof Schmitt2014-05-191-2/+2
| | | | | | | | | | | | | | | | | | | | labels_data_count already accounts for the unicode null character at the end of the array. There is no need in adding space for it again. Signed-off-by: Christof Schmitt <christof.schmitt@us.ibm.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Aug 6 04:03:17 CEST 2013 on sn-devel-104 (cherry picked from commit eb50fb8f3bf670bd7d1cf8fd4368ef4a73083696) The last 2 patches address bug #10549 - CVE-2014-0178: Malformed FSCTL_SRV_ENUMERATE_SNAPSHOTS response. Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-1-test): Mon May 19 14:52:47 CEST 2014 on sn-devel-104
* FSCTL_GET_SHADOW_COPY_DATA: Initialize output array to zeroChristof Schmitt2014-05-191-1/+1
| | | | | | | | | | Otherwise num_volumes and the end marker can return uninitialized data to the client. Signed-off-by: Christof Schmitt <christof.schmitt@us.ibm.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org> (cherry picked from commit 30e724cbff1ecd90e5a676831902d1e41ec1b347)
* s3: smbd : Fix wildcard unlink to fail if we get an error rather than trying ↵Jeremy Allison2014-05-191-1/+2
| | | | | | | | | | | | to continue. This can break smbd if we end up leaving a SHARING_VIOLATION retry record on the queue. Signed-off-by: Jeremy Allison <jra@samba.org> Fix bug #10577 - SMB1 wildcard unlink fail can leave a retry record on the open retry queue.
* s3: smbd: Remove open_file_fchmod().Jeremy Allison2014-05-192-36/+0
| | | | | | | | | | | | | | No longer used (hurrah!). Bug 10564 - Lock order violation and file lost https://bugzilla.samba.org/show_bug.cgi?id=10564 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri May 2 23:47:38 CEST 2014 on sn-devel-104
* s3: smbd: change file_set_dosmode() to use get_file_handle_for_metadata() ↵Jeremy Allison2014-05-191-12/+92
| | | | | | | | | | | | | | | | | | instead of open_file_fchmod(). get_file_handle_for_metadata() is a new function that finds an existing open handle (fsp->fh->fd != -1) for a given dev/ino if there is one available, and uses INTERNAL_OPEN_ONLY with WRITE_DATA access if not. Allows open_file_fchmod() to be removed next. Bug 10564 - Lock order violation and file lost https://bugzilla.samba.org/show_bug.cgi?id=10564 Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org>
* s3: smbd : Ensure file_new doesn't call into smbXsrv_open_create() for ↵Jeremy Allison2014-05-192-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | INTERNAL_OPEN_ONLY. This causes deadlocks which cause smbd to crash if the locking database has already been locked for a compound operation we need to be atomic (as in the file rename case). Ensure INTERNAL_OPEN_ONLY opens are synonymous with req==NULL. INTERNAL_OPEN_ONLY opens leave a NO_OPLOCK record in the share mode database, so they can be detected by other processes for share mode violation purposes (because they're doing an operation on the file that may include reads or writes they need to have real state inside the locking database) but have an fnum of FNUM_FIELD_INVALID and a local share_file_id of zero, as they will never be seen on the wire. Ensure validate_my_share_entries() ignores INTERNAL_OPEN_ONLY records (share_file_id == 0). Bug 10564 - Lock order violation and file lost https://bugzilla.samba.org/show_bug.cgi?id=10564 Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org>
* s3 : smbd : Protect all possible code paths from fsp->op == NULL.Jeremy Allison2014-05-195-2/+41
| | | | | | | | | | | | | In changes to come this will be possible for an INTERNAL_OPEN_ONLY. The protection was already in place for some code paths, this makes the coverage compete. Bug 10564 - Lock order violation and file lost https://bugzilla.samba.org/show_bug.cgi?id=10564 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* Minor typo fix in source3/wscript.Jose A. Rivera2014-05-191-1/+1
| | | | | | | | | | | | Signed-off-by: Jose A. Rivera <jarrpa@redhat.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon May 5 22:41:19 CEST 2014 on sn-devel-104 Fix bug #10151 - Extra ':' in msg for Waf Cross Compile Build System with Cross-answers command.
* s3: smbd - smb1 - fix read of deleted memory in reply_writeclose().Noel Power2014-05-061-11/+13
| | | | | | | | | | | | | | | | | | | | While running smbtorture test raw.write under valgrind an "Invalid read" was reported in methid reply_writeclose, it seems after closing a file sometime later we try to access it again. Signed-off-by: Noel Power <noel.power@suse.com> Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Mar 3 20:42:40 CET 2014 on sn-devel-104 (cherry picked from commit 04e434661fa6b5f13776f925b0a7cbadb6b6d006) Fix bug #10554 - request backport for 'smb1 - fix read of deleted memory in reply_writeclose()'. Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-1-test): Tue May 6 13:28:35 CEST 2014 on sn-devel-104