summaryrefslogtreecommitdiffstats
path: root/source3/smbd/close.c
Commit message (Collapse)AuthorAgeFilesLines
* param: rename lp function and variable from "magicscript" to "magic_script"Garming Sam2014-02-071-2/+2
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* param: rename lp function and variable from "magicoutput" to "magic_output"Garming Sam2014-02-071-2/+2
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* param: rename lp function and variable from "recursive_veto_delete" to ↵Garming Sam2014-02-071-1/+1
| | | | | | | | "delete_veto_files" Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Rename the profile enums with a SAMBA_ prefix to avoid conflict with system ↵Jeremy Allison2013-11-221-1/+1
| | | | | | | | | files. WRITE_FLUSH is defined in fs.h in Linux. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* smbd: Use remove_oplock() in close_normal_fileVolker Lendecke2013-10-241-1/+1
| | | | | | | | | | | remove_oplock is a wrapper around release_file_oplock. This streamlines the exports of oplock.c a bit. Reason for this patch: In a later patch I will add functionality to remove_oplock that is required in close_normal_file as well. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* smbd: Fix a 100% loop at shutdown timeVolker Lendecke2013-07-111-2/+5
| | | | | | | | | | | In the destructor of fsp->aio_requests[0] we put another request into fsp->aio_requests[0]. Don't overwrite that with TALLOC_FREE. 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): Thu Jul 11 20:56:42 CEST 2013 on sn-devel-104
* s3:smbd/close remove filesystem lock before removing sharemodeChristian Ambach2013-06-251-0/+9
| | | | | | | | | | | | | | | | | | | | otherwise we are open for a race condition: opener 1 opens file and closes it - during the close, the share mode entry will be removed from locking.tdb, but share mode in the file system will be dropped later after delete_on_close and write time updates have been done opener 2 requests open of same file with file overwrite - locking.tdb does not list original entry, but file system share mode is still around - VFS_FTRUNCATE will fail and error was converted to STATUS_ACCESS_DENIED Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Christian Ambach <ambi@samba.org> Autobuild-Date(master): Tue Jun 25 14:48:44 CEST 2013 on sn-devel-104
* s3:smbd/close use common exit pathChristian Ambach2013-06-251-9/+2
| | | | | | | | do not return early here, but use the common exit path that will remove the share mode from the record Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* smbd: Remove unused codeVolker Lendecke2013-06-111-7/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: We don't use DEFERRED_OPEN_ENTRY anymoreVolker Lendecke2013-04-261-85/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Obsolete MSG_SMB_OPEN_RETRYVolker Lendecke2013-04-261-9/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Remove unused reply_to_oplock_break_requestsVolker Lendecke2013-04-261-1/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: call scavenger_schedule_disconnected() from close normal file for ↵Gregor Beck2013-04-181-0/+2
| | | | | | | | durable handles Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: Convert rmdir_internals to synthetic_smb_fnameVolker Lendecke2013-04-171-7/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Convert recursive_rmdir to synthetic_smb_fnameVolker Lendecke2013-04-171-5/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Convert delete_all_streams to synthetic_smb_fnameVolker Lendecke2013-04-171-5/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd:smb2: fix segfault (access after free) in durable disconnect codeMichael Adam2013-02-191-0/+1
| | | | | | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Tue Feb 19 11:12:01 CET 2013 on sn-devel-104
* s3:smbd: add debugging to close code (regarding disconnect of a durable)Michael Adam2013-02-181-0/+14
| | | | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Mon Feb 18 17:42:45 CET 2013 on sn-devel-104
* s3:smbd: use smbXsrv_open_close() instead of smbXsrv_open_update()Stefan Metzmacher2013-02-181-1/+11
| | | | | | | | This makes sure we store the correct disconnect_time for disconnected durable handles. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3: make recursive_rmdir function non-staticBjörn Baumbach2012-10-011-4/+4
|
* s3:smbd: initial durable handle support: special treatment of durable ↵Michael Adam2012-09-081-0/+44
| | | | | | handles in close Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
* s3: Fix a panic when shutting downVolker Lendecke2012-09-081-10/+32
| | | | | | | | | | | | | | | When a client disconnects while we have aio open, there is no close request that cleans up. We can't send out the replies anymore, so just drop the aio requests that are pending. Found using the new python lib writing multiple files simultaneously TODO: check tdis and logoff Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Sat Sep 8 01:27:34 CEST 2012 on sn-devel-104
* Fix unused variable.Jeremy Allison2012-07-241-1/+0
|
* s3-aio: Panic if we try to close a fsp with outstanding aio requestsVolker Lendecke2012-07-191-1/+15
| | | | | | | | | | | The core smbd must have taken care of this. If we don't do this properly, we have a race of the close(2) against a pwrite(2). We might end up writing to the wrong file. Signed-off-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Jul 19 03:40:17 CEST 2012 on sn-devel-104
* s3: Properly handle shutdown with the _send/_recv based aioVolker Lendecke2012-07-181-10/+1
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.Rusty Russell2012-07-181-5/+5
| | | | | | | | | | They use talloc_tos() internally: hoist that up to the callers, some of whom don't want to us talloc_tos(). A simple patch, but hits a lot of files. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* s3:util: rename procid_equal() to serverid_equal()Michael Adam2012-06-211-3/+3
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3:smbd/close: call del_share_mode() directly before TALLOC_FREE(lck)Stefan Metzmacher2012-06-031-5/+15
| | | | | | | metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Sun Jun 3 21:08:19 CEST 2012 on sn-devel-104
* s3:smbd/close: remove unused goto out from close_directory()Stefan Metzmacher2012-06-031-3/+1
| | | | metze
* s3:smbd/close: do an early return in close_directory()Stefan Metzmacher2012-06-031-2/+1
| | | | metze
* s3: Fix an assert to trigger in close_remove_share_modeStefan Metzmacher2012-06-031-6/+17
| | | | | | | | | | | | | | | | | | | | | In case we have a left-over entry in the share mode entry array, the SMB_ASSERT(got_tokens) is likely to kick in. It happens when we are about to delete a file with initial delete on close. We don't have a delete on close token set in the locking.tdb record. We see the fsp->initial_delete_on_close set, add the delete_on_close token to lck. Then "delete_file" is being set to true. Then later on we do the notify_deferred_opens. This walks the list, also checking for share_mode_stale_pid. We have already deleted our own share mode entry, share_mode_stale_pid() sees the left-over entry. It not also deletes that one but also the delete on close token. This leads to a different view of "delete_file" a.k.a. "got_tokens" further down in close_remove_share_mode, leading the SMB_ASSERT to fire. This patch attempts to fix the issue by keeping around our own share mode entry for almost the whole routine, preventing share_mode_stale_pid() from removing the delete tokens. Pair-Programmed-With: Volker Lendecke <vl@samba.org>
* s3: Do an early return in close_remove_share_modeVolker Lendecke2012-06-031-2/+1
| | | | | | Without "lck" we don't have much to clean up Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3: Make close_remove_share_mode a bit more readableVolker Lendecke2012-06-031-2/+4
| | | | | | by introducing a variable simplifying a boolean expression Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3: Slightly simplify close_remove_share_modeVolker Lendecke2012-06-031-10/+15
| | | | | | Remove a level of indentation by more use of "continue;" Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3:smbd/close: avoid procid_is_me()Stefan Metzmacher2012-06-031-1/+2
| | | | metze
* s3: Check for serverid_exists in close_directoryVolker Lendecke2012-05-251-0/+3
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3: Check for serverid_exists in close_remove_share_modeVolker Lendecke2012-05-251-0/+3
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3: Check for serverid_exists in notify_deferred_opensVolker Lendecke2012-05-251-2/+8
| | | | | | | We will remove the check in parse_share_modes soon Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3:smbd: pass smbd_server_connection to should_notify_deferred_opens()Stefan Metzmacher2012-05-251-1/+1
| | | | metze
* Move the set_write_time() call to after get_existing_share_mode_lock() ↵Jeremy Allison2012-05-191-3/+15
| | | | | | | | | | | | | | | | | | | | | | returns with a share mode. get_existing_share_mode_lock() isn't really the right call here, as we're being called after close_remove_share_mode() inside close_normal_file() so it's quite normal to not have an existing share mode here. However, get_share_mode_lock() doesn't work because that will create a new share mode if one doesn't exist - so stick with this call (just ignore any error we get if the share mode doesn't exist. The previous commit raised the error message debug level inside get_share_mode_lock_internal() so we don't always get a level 1 error message if get_existing_share_mode_lock() fails. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sat May 19 06:26:33 CEST 2012 on sn-devel-104
* s3: Revert the serverid changes, they need more workVolker Lendecke2012-05-181-14/+2
| | | | | Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Fri May 18 13:12:14 CEST 2012 on sn-devel-104
* s3: Check for serverid_exists in close_directoryVolker Lendecke2012-05-171-0/+3
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s3: Check for serverid_exists in close_remove_share_modeVolker Lendecke2012-05-171-0/+3
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s3: Check for serverid_exists in notify_deferred_opensVolker Lendecke2012-05-171-2/+8
| | | | | | We will remove the check in parse_share_modes soon Signed-off-by: Jeremy Allison <jra@samba.org>
* Remove cancel_aio_by_fsp(). It can never work and could lead to memory ↵Jeremy Allison2012-04-121-12/+9
| | | | | | | corruption as outstanding IO's complete. Also we never have any aio's on a call to close_normal_file() with close_type ERROR_CLOSE.
* build: Remove SMB_OFF_T, replace with off_tAndrew Bartlett2012-04-061-1/+1
| | | | | | | | | Now that we always require a 64 bit off_t, we no longer need SMB_OFF_T. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Fri Apr 6 01:47:43 CEST 2012 on sn-devel-104
* Third part of fix for bug #8837 - smbd crashes when deleting directory and ↵Jeremy Allison2012-04-051-1/+1
| | | | | | | | | | veto files are enabled. Use correct check to see if veto files has been enabled. Even if not set lp_veto_files() returns a valid string address (to a '\0' character). Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu Apr 5 01:36:04 CEST 2012 on sn-devel-104
* Second part of bugfix for bug #8837 - smbd crashes when deleting directory ↵Jeremy Allison2012-04-041-8/+15
| | | | | | | and veto files are enabled. Store the 'struct security_token' as well as the 'struct security_unix_token' inside the locking db when setting a delete on close.
* Fix const warnings.Jeremy Allison2012-02-241-2/+2
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Fri Feb 24 23:10:56 CET 2012 on sn-devel-104
* s3: get_share_mode_lock->get_existing_share_mode_lockVolker Lendecke2012-02-191-3/+3
|