From af8a691db11a5072865f8b03fd1cbd3aab5cb6d7 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 8 Jul 2005 04:51:27 +0000 Subject: r8219: Merge the new open code from HEAD to 3.0. Haven't yet run the torture tests on this as it's very late NY time (just wanted to get this work into the tree). I'll test this over the weekend.... Jerry - in looking at the difference between the two trees there seem to be some printing/ntprinting.c and registry changes we might want to examine to try keep in sync. Jeremy. (This used to be commit c7fe18761e2c753afbffd3a78abff46472a9b8eb) --- source3/lib/util.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'source3/lib') diff --git a/source3/lib/util.c b/source3/lib/util.c index 42cbc7288f..de366c604f 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -2735,3 +2735,25 @@ int _Insure_trap_error(int a1, int a2, int a3, int a4, int a5, int a6) return ret; } #endif + +uint32 map_share_mode_to_deny_mode(uint32 share_access, uint32 private_options) +{ + switch (share_access) { + case FILE_SHARE_NONE: + return DENY_ALL; + case FILE_SHARE_READ: + return DENY_WRITE; + case FILE_SHARE_WRITE: + return DENY_READ; + case FILE_SHARE_READ|FILE_SHARE_WRITE: + case FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE: + return DENY_NONE; + } + if (private_options & NTCREATEX_OPTIONS_PRIVATE_DENY_DOS) { + return DENY_DOS; + } else if (private_options & NTCREATEX_OPTIONS_PRIVATE_DENY_FCB) { + return DENY_FCB; + } + + return (uint32)-1; +} -- cgit