summaryrefslogtreecommitdiff
path: root/source3/locking/brlock.c
AgeCommit message (Collapse)AuthorFilesLines
2013-09-12smbd: Properly protect against invalid lock dataVolker Lendecke1-0/+6
If someone messes with brlock.tdb and inserts an invalid record length, this will lead to memcpy overwriting a few bytes behind malloc'ed data. 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 Sep 12 03:26:45 CEST 2013 on sn-devel-104
2013-09-11smbd: Convert br_lck->lock_data to tallocVolker Lendecke1-26/+29
Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Wed Sep 11 10:15:38 CEST 2013 on sn-devel-104
2013-09-11smbd: Move "struct byte_range_lock" definition to brlock.cVolker Lendecke1-0/+10
2013-09-11smbd: Add brl_fsp access functionVolker Lendecke1-0/+5
2013-09-11smbd: Add brl_num_locks access functionVolker Lendecke1-0/+5
2013-09-11smbd: Use ZERO_STRUCT instead of memsetVolker Lendecke1-1/+1
2013-09-11smbd: Make brl_lock_failed staticVolker Lendecke1-1/+3
2013-09-11smbd: Make brl_same_context staticVolker Lendecke1-1/+1
2013-09-11smbd: Fix blank line endingsVolker Lendecke1-19/+19
2013-04-18s3:locking:brlock: add function brl_cleanup_disconnected()Gregor Beck1-0/+73
For a given file, clean up brl entries belonging to a given persistent file id. Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-04-18s3:locking:brlock: explain the lockdb_clean semantic better in ↵Michael Adam1-1/+5
brl_reconnect_disconnected() Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-04-18s3:locking:brlock: let validate_lock_entries keep entries for disconnected ↵Gregor Beck1-8/+23
servers in traverses We should not remove locks of disconnected opens just like that. When getting the byte range lock record for a newly connected file handle, we still do the clean up, because in that situation, disconnected entries are not valid any more. Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-04-18s3:locking:brlock: improve the comment for the brl self cleaning codeMichael Adam1-3/+6
Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-04-18s3:locking:brlock: use serverids_exist to validate_lock_entriesGregor Beck1-3/+34
...instead of checking each server-id separately which can be expensive in a cluster. Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-18brlock.c: Fix typo in comment.Karolin Seeger1-1/+1
redundent -> redundant Signed-off-by: Karolin Seeger <kseeger@samba.org>
2012-09-08s3:locking: add brl_mark_disconnected() and brl_reconnect_disconnected()Stefan Metzmacher1-0/+125
Pair-Programmed-With: Michael Adam <obnox@samba.org>
2012-09-05s3:locking: fix trailing space in brl_close_fnum()Michael Adam1-1/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-08-16s3:brlock: give traverse_fn a proper nameChristian Ambach1-2/+2
2012-06-28s3:brlock: s/int/uint64_t for fnumStefan Metzmacher1-1/+1
fsp->fnum and lock->fnum are uint64_t already and we should not truncate the value here. Currently this doesn't matter as we only use 16-bit. But as 'int' is int32_t and we later compare fnum with lock->fnum == fnum, the cast from int32_t to uint64_t goes via int64_t instead of uint32_t. This means even if fsp->fnum just uses 32-bit of the uint64_t we'll get the wrong result, as the implicit cast from a negative int32_t value to uint64_t adds 0xFFFFFFFF00000000. metze
2012-06-28s3:brlock: add some const to print_lock_struct()Stefan Metzmacher1-1/+1
metze
2012-06-21s3:util: rename procid_equal() to serverid_equal()Michael Adam1-4/+4
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-15s3:locking: change brlock.c to use fsp_fnum_dbg() for fsp->fnum logging.Michael Adam1-4/+4
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-06s3:include: change lock_struct->fnum to uint64_tMichael Adam1-2/+2
Note: this changes the format of brlock.tdb! Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Wed Jun 6 23:22:00 CEST 2012 on sn-devel-104
2012-06-06s3:include: change connection_struct->cnum to uint32_tMichael Adam1-1/+1
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
2012-01-18s3: Add a "lock_order" argument to db_openVolker Lendecke1-1/+2
This will be used to enforce a lock hierarchy between the databases. We have seen deadlocks between locking.tdb, brlock.tdb, serverid.tdb and notify*.tdb. These should be fixed by refusing a dbwrap_fetch_locked that does not follow a defined lock hierarchy.
2011-12-16s3:locking: avoid using sconn_server_id()Stefan Metzmacher1-1/+1
metze
2011-12-14s3:smbd: remove brl_register_msgs()Stefan Metzmacher1-11/+5
metze
2011-12-12vfs: Make function pointer names consistent. They all end in _fnRichard Sharpe1-4/+5
Autobuild-User: Richard Sharpe <sharpe@samba.org> Autobuild-Date: Mon Dec 12 04:58:40 CET 2011 on sn-devel-104
2011-10-11s3:locking: convert brlock to only use dbwrap wrapper functionsMichael Adam1-15/+28
Avoid direct use of the db_record and db_context structs.
2011-07-29s3:dbwrap: move all .c and .h files of dbwrap to lib/dbwrap/Michael Adam1-1/+1
Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Fri Jul 29 13:34:22 CEST 2011 on sn-devel-104
2011-07-29s3:dbwrap: move db_open() to a file dbwrap_open.c of its own.Michael Adam1-0/+1
Also start new folder lib/dbwrap/ where dbwrap_open.c is stored and make the fallbacke implementation functoins non-static and create a dbwrap_private.h header file that contains their prototypes.
2011-07-16Fix bug #8307 - brl_close_fnum does not call SMB_VFS_BRL_UNLOCK_WINDOWS on ↵Jeremy Allison1-122/+23
all locks Reported by herb@samba.org. Remove the (premature) optimization on file close. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sat Jul 16 02:32:02 CEST 2011 on sn-devel-104
2011-06-20tdb_compat: Higher level API fixes.Rusty Russell1-1/+1
My previous patches fixed up all direct TDB callers, but there are a few utility functions and the db_context functions which are still using the old -1 / 0 return codes. It's clearer to fix up all the callers of these too, so everywhere is consistent: non-zero means an error. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-09lib/util Bring procid_str() into lib/util as server_id_string()Andrew Bartlett1-1/+1
This is needed for OpenChange, which prints Samba struct server_id values in debug messages. Andrew Bartlett
2011-06-09s3-talloc Change TALLOC_MEMDUP() to talloc_memdup()Andrew Bartlett1-1/+1
Using the standard macro makes it easier to move code into common, as TALLOC_MEMDUP isn't standard talloc.
2011-06-09s3-talloc Change TALLOC_ZERO_P() to talloc_zero()Andrew Bartlett1-1/+1
Using the standard macro makes it easier to move code into common, as TALLOC_ZERO_P isn't standard talloc.
2011-06-09s3-talloc Change TALLOC_P() to talloc()Andrew Bartlett1-1/+1
Using the standard macro makes it easier to move code into common, as TALLOC_P isn't standard talloc.
2011-05-28s3: Fix some nonempty blank linesVolker Lendecke1-6/+6
2011-05-05More simple const fixes.Jeremy Allison1-2/+2
2011-03-30s3-messages: make ndr_messaging.h part of messages.h.Günther Deschner1-1/+0
Guenther
2011-03-30s3-messages: only include messages.h where needed.Günther Deschner1-0/+1
Guenther
2011-03-30s3-locking: move locking prototypes out of proto.h.Günther Deschner1-0/+1
Will later become part of locking.h Guenther
2011-03-30s3-includes: only include system/filesys.h when needed.Günther Deschner1-0/+1
Guenther
2011-03-18s3:locking: simplify the non cluster case of brl_get_locks_readonly()Stefan Metzmacher1-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
2011-03-18s3:locking: brl_get_locks_internal() should not expose a write lock if the ↵Stefan Metzmacher1-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
2011-03-02s3-server_id: only include server_id where needed.Günther Deschner1-0/+1
Guenther
2010-09-27Change to using TDB_INCOMPATIBLE_HASH (the jenkins hash) on allJeremy Allison1-1/+1
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.
2010-08-26s3-build: use dbwrap.h only where needed.Günther Deschner1-0/+1
Guenther
2010-07-05s3: Remove procid_self() from brl_close_fnum()Volker Lendecke1-1/+2
2010-05-07This patch looks bigger than it is. It does 2 things. 1). Renames smbpid -> ↵Jeremy Allison1-26/+26
smblctx in our locking code. 2). Widens smblctx to 64-bits internally. Preparing to use the SMB2 handle as the locking context. Jeremy.