summaryrefslogtreecommitdiff
path: root/source3/locking
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 Lendecke2-0/+6
2013-09-11smbd: Add brl_num_locks access functionVolker Lendecke2-0/+7
2013-09-11smbd: Use ZERO_STRUCT instead of memsetVolker Lendecke1-1/+1
2013-09-11smbd: Fix a typoVolker Lendecke1-1/+1
2013-09-11smbd: Make brl_lock_failed staticVolker Lendecke2-2/+3
2013-09-11smbd: Make brl_same_context staticVolker Lendecke2-3/+1
2013-09-11smbd: Fix blank line endingsVolker Lendecke1-19/+19
2013-09-06smbd: Apply some const to find_share_mode_entryVolker Lendecke1-2/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-09-06smbd: Apply some const to share_modes_identicalVolker Lendecke1-2/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-09-06smbd: Simplify find_share_mode_entryVolker Lendecke1-2/+5
There's no point checking the validity of the "entry" argument more than once Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-09-03smbd: Fix flawed share_mode_stale_pid APIVolker Lendecke2-9/+50
The comment for this routine said: > Modifies d->num_share_modes, watch out in routines iterating over > that array. Well, it turns out that *every* caller of this API got it wrong. So I think it's better to change the routine. This leaves the array untouched while iterating but filters out the deleted ones while saving them back to disk. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-09-03smbd: Rename parameter "i" to "idx"Volker Lendecke2-7/+7
We'll need "i" in a later checkin ... :-) Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-04-26smbd: We don't use DEFERRED_OPEN_ENTRY anymoreVolker Lendecke2-67/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-26smbd: Use dbwrap_record_watch_send for defer_openVolker Lendecke1-0/+3
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-19s3:locking add NDR debug in share_mode_forallChristian Ambach1-0/+4
Reviewed-by: Volker Lendecke <vl@samba.org> Signed-off-by: Christian Ambach <ambi@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Fri Apr 19 15:06:33 CEST 2013 on sn-devel-104
2013-04-18s3:locking: add function share_mode_cleanup_disconnected()Gregor Beck2-0/+102
For a given file, clean share mode entries for a given persistent file id. Pair-Programmed-With: Michael Adam <obnox@samba.org> Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Gregor Beck <gbeck@sernet.de> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
2013-04-18s3:locking: improve debug output of parse_share_modes()Gregor Beck1-1/+2
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: no need to make a file_id passed by value a constantGregor Beck2-13/+10
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: add function brl_cleanup_disconnected()Gregor Beck2-0/+74
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-11-28s3: Use dbwrap_parse_record in fetch_share_mode_unlockedVolker Lendecke1-13/+14
Reviewed-by: Andreas Schneider <asn@samba.org>
2012-09-08s3:locking: add brl_mark_disconnected() and brl_reconnect_disconnected()Stefan Metzmacher2-0/+127
Pair-Programmed-With: Michael Adam <obnox@samba.org>
2012-09-08s3:locking: add mark_share_mode_disconnected()Stefan Metzmacher2-0/+40
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-09-04s3: Fix a typoVolker Lendecke1-1/+1
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-08-16s3:brlock: give traverse_fn a proper nameChristian Ambach1-2/+2
2012-07-03Move copy_unix_token() from locking/locking.c to lib/util.c.Jeremy Allison1-29/+0
Make public.
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-22s3: Remove reduce_windows_lock_ref_count, used only onceVolker Lendecke1-8/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-22s3: Make reduce_windows_lock_ref_count staticVolker Lendecke2-2/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-22s3: Use dbwrap_util for windows_lock_ref_countVolker Lendecke1-94/+21
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-21s3:util: rename procid_equal() to serverid_equal()Michael Adam3-8/+8
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-21s3: Remove a user of procid_is_meVolker Lendecke1-1/+2
Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-15s3:locking: change locking.c to use fsp_fnum_dbg() for fsp->fnum logging.Michael Adam1-8/+8
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-14s3: Fix a commentVolker Lendecke1-15/+13
The fd count is implicit Signed-off-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Jun 14 01:53:17 CEST 2012 on sn-devel-104
2012-06-06s3:include: change lock_struct->fnum to uint64_tMichael Adam3-5/+6
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-06-03s3: Simplify get_delete_on_close_token moreVolker Lendecke1-6/+2
All remaining callers actually want the token Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-03s3: Simplify get_delete_on_close_token slightlyVolker Lendecke1-19/+32
Introduce find_delete_on_close_token. Thus is_delete_on_close_set does not have to call get_delete_on_close_token anymore. Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-01s3: Avoid a lot of calls to serverid_exists()Volker Lendecke1-1/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Fri Jun 1 18:58:30 CEST 2012 on sn-devel-104
2012-05-25s3: Do not check the PIDs is parse_share_modesVolker Lendecke1-42/+0
We do that when conflicts arise Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>