summaryrefslogtreecommitdiffstats
path: root/source3/locking
Commit message (Collapse)AuthorAgeFilesLines
* s3-includes: only include system/filesys.h when needed.Günther Deschner2011-03-303-0/+3
| | | | Guenther
* s3:locking: simplify the non cluster case of brl_get_locks_readonly()Stefan Metzmacher2011-03-181-21/+2
| | | | | | | | | Pair-Programmed-With: Michael Adam <obnox@samba.org> metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Fri Mar 18 13:00:51 CET 2011 on sn-devel-104
* s3:locking: brl_get_locks_internal() should not expose a write lock if the ↵Stefan Metzmacher2011-03-181-7/+24
| | | | | | | | | | caller wants read_only This triggered deadlocks in the cluster case of brl_get_locks_readonly(). Pair-Programmed-With: Michael Adam <obnox@samba.org> metze
* Nulling out the op_mid is never the right thing to do. We depend onJeremy Allison2011-03-171-1/+0
| | | | | | | | | this value when searching for specific share mode entries. Jeremy. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu Mar 17 19:59:51 CET 2011 on sn-devel-104
* s3-server_id: only include server_id where needed.Günther Deschner2011-03-022-0/+2
| | | | Guenther
* s3-auth struct security_unix_token replaces UNIX_USER_TOKENAndrew Bartlett2011-03-011-11/+11
|
* Missed one debug printf of name_hash. Ensure always use %x.Jeremy Allison2011-01-261-2/+2
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Wed Jan 26 00:46:28 CET 2011 on sn-devel-104
* Fix bug #7863 - Unlink may unlink wrong file when hardlinks are involved.Jeremy Allison2011-01-251-93/+239
| | | | | | Do this by keeping a linked list of delete on close tokens, one for each filename that identifies a path to the dev/inode. Use the jenkins hash of the pathname to identify the correct token.
* Add uint32_t name_hash argument (currently unused) to get_file_infos().Jeremy Allison2011-01-251-0/+1
| | | | Will be used when we store more than one delete on close token.
* Add name_hash into the share mode entry struct (as yet only use for renames ↵Jeremy Allison2011-01-251-2/+15
| | | | to identify a specific path).
* libcli/security Provide a common, top level libcli/security/security.hAndrew Bartlett2010-10-121-0/+1
| | | | | | | | | | | | | | This will reduce the noise from merges of the rest of the libcli/security code, without this commit changing what code is actually used. This includes (along with other security headers) dom_sid.h and security_token.h Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Tue Oct 12 05:54:10 UTC 2010 on sn-devel-104
* Change to using TDB_INCOMPATIBLE_HASH (the jenkins hash) on allJeremy Allison2010-09-272-2/+2
| | | | | | | | | | TDB_CLEAR_IF_FIRST tdb's. For tdb's like gencache where we open without CLEAR_IF_FIRST and then with CLEAR_IF_FIRST if corrupt this is still safe to use as if opening an existing tdb the new hash will be ignored - it's only used on creating a new tdb not opening an old one. Jeremy.
* s3-build: use dbwrap.h only where needed.Günther Deschner2010-08-263-0/+3
| | | | Guenther
* s3: Remove smbd_messaging_context() from send_stat_cache_delete_message()Volker Lendecke2010-08-071-1/+2
|
* s3: Remove procid_self() from brl_close_fnum()Volker Lendecke2010-07-051-1/+2
|
* s3: Remove procid_self() from fill_deferred_open_entry()Volker Lendecke2010-07-051-6/+9
|
* s3: Remove procid_self() from do_lock_cancel()Volker Lendecke2010-07-051-1/+1
|
* s3: Remove procid_self() from do_unlock()Volker Lendecke2010-07-051-1/+1
|
* s3: Remove procid_self() from do_lock()Volker Lendecke2010-07-051-1/+1
|
* s3: Remove procid_self() from query_lock()Volker Lendecke2010-07-051-1/+1
|
* s3: Remove procid_self() from fill_share_mode_entry()Volker Lendecke2010-07-051-1/+1
|
* s3: Remove procid_self() from init_strict_lock_struct()Volker Lendecke2010-07-051-1/+2
|
* This patch looks bigger than it is. It does 2 things. 1). Renames smbpid -> ↵Jeremy Allison2010-05-072-41/+41
| | | | | | smblctx in our locking code. 2). Widens smblctx to 64-bits internally. Preparing to use the SMB2 handle as the locking context. Jeremy.
* Make us pass all SMB2 lock tests except MULTIPLE-UNLOCK and CONTEXT. Them ↵Jeremy Allison2010-05-071-2/+3
| | | | | | next :-). Jeremy.
* Fix SMB2 lock tests up to cancel-by-close.Jeremy Allison2010-05-061-0/+4
| | | | Jeremy.
* Move to MS-FSA algorithm when checking for invalid lock range.Jeremy Allison2010-05-051-7/+6
| | | | | | Satisfies SMB and SMB2. Jeremy.
* s3: only include gen_ndr headers where needed.Günther Deschner2010-05-062-0/+2
| | | | | | | | | | | | | | | | | This shrinks include/includes.h.gch by the size of 7 MB and reduces build time as follows: ccache build w/o patch real 4m21.529s ccache build with patch real 3m6.402s pch build w/o patch real 4m26.318s pch build with patch real 3m6.932s Guenther
* smbd: move printfile_offset() within write_file()Simo Sorce2010-04-301-0/+6
|
* Move to using 64-bit mid values in our internal open file database.Jeremy Allison2010-04-121-7/+8
| | | | | | | This will allow us to share logic much easier between SMB1 and SMB2 servers. Jeremy
* We don't need to treat the token differently in the conn->admin_user case, ↵Jeremy Allison2010-03-151-11/+0
| | | | | | it should already be pointing to a token with uid == 0. Jeremy.
* Rever e80ceb1d7355c8c46a2ed90d5721cf367640f4e8 "Remove more uses of "extern ↵Jeremy Allison2010-03-151-0/+10
| | | | | | | | struct current_user current_user;"." As requested by Volker, split this into smaller commits. Jeremy.
* Remove more uses of "extern struct current_user current_user;".Jeremy Allison2010-03-121-10/+0
| | | | | | | | | | | | | Use accessor functions to get to this value. Tidies up much of the user context code. Volker, please look at the changes in smbd/uid.c to familiarize yourself with these changes as I think they make the logic in there cleaner. Cause smbd/posix_acls.c code to look at current user context, not stored context on the conn struct - allows correct use of these function calls under a become_root()/unbecome_root() pair. Jeremy.
* s3: Fix a long-standing problem with recycled PIDsVolker Lendecke2010-03-102-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a samba server process dies hard, it has no chance to clean up its entries in locking.tdb, brlock.tdb, connections.tdb and sessionid.tdb. For locking.tdb and brlock.tdb Samba is robust by checking every time we read an entry from the database if the corresponding process still exists. If it does not exist anymore, the entry is deleted. This is not 100% failsafe though: On systems with a limited PID space there is a non-zero chance that between the smbd's death and the fresh access, the PID is recycled by another long-running process. This renders all files that had been locked by the killed smbd potentially unusable until the new process also dies. This patch is supposed to fix the problem the following way: Every process ID in every database is augmented by a random 64-bit number that is stored in a serverid.tdb. Whenever we need to check if a process still exists we know its PID and the 64-bit number. We look up the PID in serverid.tdb and compare the 64-bit number. If it's the same, the process still is a valid smbd holding the lock. If it is different, a new smbd has taken over. I believe this is safe against an smbd that has died hard and the PID has been taken over by a non-samba process. This process would not have registered itself with a fresh 64-bit number in serverid.tdb, so the old one still exists in serverid.tdb. We protect against this case by the parent smbd taking care of deregistering PIDs from serverid.tdb and the fact that serverid.tdb is CLEAR_IF_FIRST. CLEAR_IF_FIRST does not work in a cluster, so the automatic cleanup does not work when all smbds are restarted. For this, "net serverid wipe" has to be run before smbd starts up. As a convenience, "net serverid wipedbs" also cleans up sessionid.tdb and connections.tdb. While there, this also cleans up overloading connections.tdb with all the process entries just for messaging_send_all(). Volker
* s3-locking: convert brlock to TYPESAFE_QSORT()Andrew Tridgell2010-02-141-3/+2
|
* s3-locking: update to use DLIST_ADD_AFTER()Andrew Tridgell2010-02-101-5/+1
| | | | (cherry picked from commit 6c6df527e14514027cbcaa6deac25adf04363926)
* Fix bug #6876 - Delete of an object whose parent folder does not have delete ↵Jeremy Allison2010-01-121-0/+3
| | | | | | | | | | rights fails even if the delete right is set on the object. Final fix for the vfs_acl_xattr and vfs_acl_tdb code. Ensure we can delete a file even if the underlying POSIX permissions don't allow it, if the Windows permissions do. Jeremy.
* Make Samba3 pass the RAW-LOCK test as Windows.Jeremy Allison2009-12-041-0/+5
| | | | | | | Implement the win7 NT_STATUS_INVALID_LOCK_RANGE. Make smbd behave as Windows does in canceling locks. Jeremy.
* Remove unneeded argument from can_set_delete_on_close(). EnsureJeremy Allison2009-12-021-9/+2
| | | | | | can_set_delete_on_close() is correctly called before any setting of the disposition bit (clean up the do_unlink() call). Jeremy.
* s3: Remove a pointless memsetVolker Lendecke2009-11-211-1/+0
| | | | | We are assigning the complete structure now (we used to assign individual fields), so this is obsolete.
* s3: Cache brlock.tdb entries for the fast read&write strict locking code pathVolker Lendecke2009-11-212-15/+65
| | | | | For a netbench run this gains around 2% user-space CPU, fetching a 100MB file takes around 4% less.
* s3: Remove debug_ctx()Volker Lendecke2009-11-032-7/+7
| | | | | | | | smbd just crashed on me: In a debug message I called a routine preparing a string that itself used debug_ctx. The outer routine also used it after the inner routine had returned. It was still referencing the talloc context that the outer debug_ctx() had given us, which the inner DEBUG had already freed.
* Fix bug 6776 - Running overlapping Byte Lock test will core dump Samba daemon.Jeremy Allison2009-10-051-148/+219
| | | | | Re-write core of POSIX locking logic. Jeremy.
* s3:smbd: Add the ntstatus to the smb_panic in share_mode_lock_destructorVolker Lendecke2009-09-071-2/+18
| | | | This might help finding why bug 6518 happens
* Make the smbd VFS typesafeVolker Lendecke2009-07-242-0/+46
|
* s3: Change fsp->fsp_name to be an smb_filename struct!Tim Prouty2009-07-203-29/+41
|
* s3: Change the share_mode_lock struct to store a base_name and stream_nameTim Prouty2009-07-081-29/+64
|
* s3: Make some arguments to (parse|unparse)_share_modes() constTim Prouty2009-07-081-2/+2
|
* s3: Remove unnecessary const qualifiersTim Prouty2009-07-071-2/+1
|
* s3 sticky write time: Removed unused args and tighten up a function by ↵Tim Prouty2009-07-061-1/+2
| | | | making an arg const
* Fix Coverity ID 897: REVERSE_INULLVolker Lendecke2009-05-061-1/+1
|