summaryrefslogtreecommitdiff
path: root/source3/smbd/close.c
AgeCommit message (Collapse)AuthorFilesLines
2013-10-24smbd: Use remove_oplock() in close_normal_fileVolker Lendecke1-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>
2013-07-11smbd: Fix a 100% loop at shutdown timeVolker Lendecke1-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
2013-06-25s3:smbd/close remove filesystem lock before removing sharemodeChristian Ambach1-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
2013-06-25s3:smbd/close use common exit pathChristian Ambach1-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>
2013-06-11smbd: Remove unused codeVolker Lendecke1-7/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-26smbd: We don't use DEFERRED_OPEN_ENTRY anymoreVolker Lendecke1-85/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-26smbd: Obsolete MSG_SMB_OPEN_RETRYVolker Lendecke1-9/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-26smbd: Remove unused reply_to_oplock_break_requestsVolker Lendecke1-1/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-18s3:smbd: call scavenger_schedule_disconnected() from close normal file for ↵Gregor Beck1-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>
2013-04-17smbd: Convert rmdir_internals to synthetic_smb_fnameVolker Lendecke1-7/+4
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17smbd: Convert recursive_rmdir to synthetic_smb_fnameVolker Lendecke1-5/+4
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17smbd: Convert delete_all_streams to synthetic_smb_fnameVolker Lendecke1-5/+5
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-02-19s3:smbd:smb2: fix segfault (access after free) in durable disconnect codeMichael Adam1-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
2013-02-18s3:smbd: add debugging to close code (regarding disconnect of a durable)Michael Adam1-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
2013-02-18s3:smbd: use smbXsrv_open_close() instead of smbXsrv_open_update()Stefan Metzmacher1-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>
2012-10-01s3: make recursive_rmdir function non-staticBjörn Baumbach1-4/+4
2012-09-08s3:smbd: initial durable handle support: special treatment of durable ↵Michael Adam1-0/+44
handles in close Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
2012-09-08s3: Fix a panic when shutting downVolker Lendecke1-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
2012-07-24Fix unused variable.Jeremy Allison1-1/+0
2012-07-19s3-aio: Panic if we try to close a fsp with outstanding aio requestsVolker Lendecke1-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
2012-07-18s3: Properly handle shutdown with the _send/_recv based aioVolker Lendecke1-10/+1
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-07-18loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.Rusty Russell1-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>
2012-06-21s3:util: rename procid_equal() to serverid_equal()Michael Adam1-3/+3
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-03s3:smbd/close: call del_share_mode() directly before TALLOC_FREE(lck)Stefan Metzmacher1-5/+15
metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Sun Jun 3 21:08:19 CEST 2012 on sn-devel-104
2012-06-03s3:smbd/close: remove unused goto out from close_directory()Stefan Metzmacher1-3/+1
metze
2012-06-03s3:smbd/close: do an early return in close_directory()Stefan Metzmacher1-2/+1
metze
2012-06-03s3: Fix an assert to trigger in close_remove_share_modeStefan Metzmacher1-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>
2012-06-03s3: Do an early return in close_remove_share_modeVolker Lendecke1-2/+1
Without "lck" we don't have much to clean up Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-03s3: Make close_remove_share_mode a bit more readableVolker Lendecke1-2/+4
by introducing a variable simplifying a boolean expression Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-03s3: Slightly simplify close_remove_share_modeVolker Lendecke1-10/+15
Remove a level of indentation by more use of "continue;" Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-03s3:smbd/close: avoid procid_is_me()Stefan Metzmacher1-1/+2
metze
2012-05-25s3: Check for serverid_exists in close_directoryVolker Lendecke1-0/+3
Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-25s3: Check for serverid_exists in close_remove_share_modeVolker Lendecke1-0/+3
Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-25s3: Check for serverid_exists in notify_deferred_opensVolker Lendecke1-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>
2012-05-25s3:smbd: pass smbd_server_connection to should_notify_deferred_opens()Stefan Metzmacher1-1/+1
metze
2012-05-19Move the set_write_time() call to after get_existing_share_mode_lock() ↵Jeremy Allison1-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
2012-05-18s3: Revert the serverid changes, they need more workVolker Lendecke1-14/+2
Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Fri May 18 13:12:14 CEST 2012 on sn-devel-104
2012-05-17s3: Check for serverid_exists in close_directoryVolker Lendecke1-0/+3
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-05-17s3: Check for serverid_exists in close_remove_share_modeVolker Lendecke1-0/+3
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-05-17s3: Check for serverid_exists in notify_deferred_opensVolker Lendecke1-2/+8
We will remove the check in parse_share_modes soon Signed-off-by: Jeremy Allison <jra@samba.org>
2012-04-12Remove cancel_aio_by_fsp(). It can never work and could lead to memory ↵Jeremy Allison1-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.
2012-04-06build: Remove SMB_OFF_T, replace with off_tAndrew Bartlett1-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
2012-04-05Third part of fix for bug #8837 - smbd crashes when deleting directory and ↵Jeremy Allison1-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
2012-04-04Second part of bugfix for bug #8837 - smbd crashes when deleting directory ↵Jeremy Allison1-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.
2012-02-24Fix const warnings.Jeremy Allison1-2/+2
Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Fri Feb 24 23:10:56 CET 2012 on sn-devel-104
2012-02-19s3: get_share_mode_lock->get_existing_share_mode_lockVolker Lendecke1-3/+3
2012-01-31s3: Delete streams on directoriesVolker Lendecke1-0/+11
2012-01-12s3: Put an indirection layer into share_mode_lockVolker Lendecke1-10/+10
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-01-12s3: Introduce get_share_mode_lock_fresh()Volker Lendecke1-7/+3
This slightly simplifies the code path for all callers which assume that a share mode exists already. Only the callers in open_file_ntcreate and open_directory will ever create new share modes. Signed-off-by: Jeremy Allison <jra@samba.org>
2011-12-14s3: Fix raw.mux after UNUSED_SHARE_MODE_ENTRY was removedVolker Lendecke1-5/+55
See the large comment in notify_deferred_opens for an explanation Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Wed Dec 14 19:08:30 CET 2011 on sn-devel-104