From 1b4153db7433184f220941a0954a521bbb01ec04 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sat, 21 Oct 2006 11:05:32 +0000 Subject: * fhandler.cc (fhandler_base::fhaccess): Call check_registry_access for registry keys/values if ntsec is on. * security.cc (check_access): New static function derived from check_file_access, but object type agnostic. (check_file_access): Only do file specific stuff. Call check_access. (check_registry_access): New access check function for registry keys/ values. * security.h (check_registry_access): Declare. --- winsup/cygwin/fhandler.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'winsup/cygwin/fhandler.cc') diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 672b434e5..2933a1712 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -388,6 +388,12 @@ fhandler_base::fhaccess (int flags) res = check_file_access (get_win32_name (), flags); goto done; } + else if (get_device () == FH_REGISTRY && allow_ntsec && open (O_RDONLY, 0)) + { + res = check_registry_access (get_handle (), flags); + close (); + return res; + } struct __stat64 st; if (fstat (&st)) -- cgit v1.2.3