diff options
author | Volker Lendecke <vlendec@samba.org> | 2005-06-15 21:03:43 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:18:14 -0500 |
commit | 9105bf4054b8ebac0c73b504bf38d49f81661176 (patch) | |
tree | 468be097a0d5647b224821249d42c11c9ce067d2 | |
parent | 4864c329c4633de2ccbefa7890651a92a5db0d4c (diff) | |
download | samba-9105bf4054b8ebac0c73b504bf38d49f81661176.tar.gz samba-9105bf4054b8ebac0c73b504bf38d49f81661176.tar.bz2 samba-9105bf4054b8ebac0c73b504bf38d49f81661176.zip |
r7621: Trivial reformatting while trying to understand share modes. Still survives
smbtorture *DENY* .
Volker
(This used to be commit da78ed1a4d1f7966d8013278436a710d258879e1)
-rw-r--r-- | source4/ntvfs/common/opendb.c | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/source4/ntvfs/common/opendb.c b/source4/ntvfs/common/opendb.c index 008f15d078..72e9fff1c6 100644 --- a/source4/ntvfs/common/opendb.c +++ b/source4/ntvfs/common/opendb.c @@ -156,8 +156,6 @@ struct odb_lock *odb_lock(TALLOC_CTX *mem_ctx, */ static BOOL share_conflict(struct odb_entry *e1, struct odb_entry *e2) { -#define CHECK_MASK(am, sa, right, share) if (((am) & (right)) && !((sa) & (share))) return True - if (e1->pending || e2->pending) return False; /* if either open involves no read.write or delete access then @@ -184,26 +182,23 @@ static BOOL share_conflict(struct odb_entry *e1, struct odb_entry *e2) return False; } - CHECK_MASK(e1->access_mask, e2->share_access, - SEC_FILE_WRITE_DATA | SEC_FILE_APPEND_DATA, - NTCREATEX_SHARE_ACCESS_WRITE); - CHECK_MASK(e2->access_mask, e1->share_access, - SEC_FILE_WRITE_DATA | SEC_FILE_APPEND_DATA, - NTCREATEX_SHARE_ACCESS_WRITE); +#define CHECK_MASK(am, right, sa, share) \ + if (((am) & (right)) && !((sa) & (share))) return True + + CHECK_MASK(e1->access_mask, SEC_FILE_WRITE_DATA | SEC_FILE_APPEND_DATA, + e2->share_access, NTCREATEX_SHARE_ACCESS_WRITE); + CHECK_MASK(e2->access_mask, SEC_FILE_WRITE_DATA | SEC_FILE_APPEND_DATA, + e1->share_access, NTCREATEX_SHARE_ACCESS_WRITE); - CHECK_MASK(e1->access_mask, e2->share_access, - SEC_FILE_READ_DATA | SEC_FILE_EXECUTE, - NTCREATEX_SHARE_ACCESS_READ); - CHECK_MASK(e2->access_mask, e1->share_access, - SEC_FILE_READ_DATA | SEC_FILE_EXECUTE, - NTCREATEX_SHARE_ACCESS_READ); - - CHECK_MASK(e1->access_mask, e2->share_access, - SEC_STD_DELETE, - NTCREATEX_SHARE_ACCESS_DELETE); - CHECK_MASK(e2->access_mask, e1->share_access, - SEC_STD_DELETE, - NTCREATEX_SHARE_ACCESS_DELETE); + CHECK_MASK(e1->access_mask, SEC_FILE_READ_DATA | SEC_FILE_EXECUTE, + e2->share_access, NTCREATEX_SHARE_ACCESS_READ); + CHECK_MASK(e2->access_mask, SEC_FILE_READ_DATA | SEC_FILE_EXECUTE, + e1->share_access, NTCREATEX_SHARE_ACCESS_READ); + + CHECK_MASK(e1->access_mask, SEC_STD_DELETE, + e2->share_access, NTCREATEX_SHARE_ACCESS_DELETE); + CHECK_MASK(e2->access_mask, SEC_STD_DELETE, + e1->share_access, NTCREATEX_SHARE_ACCESS_DELETE); /* if a delete is pending then a second open is not allowed */ if ((e1->create_options & NTCREATEX_OPTIONS_DELETE_ON_CLOSE) || |