Fix memory and handle leaks due to fdopendir:
* dir.cc (closedir): Call global close instead of just releasing the fhandler. * fhandler_disk_file.cc (fhandler_disk_file::closedir): Don't close fhandler handle here, rely on global closedir doing the right thing. * fhandler_registry.cc (fhandler_registry::readdir): Also delete d_hash when closing registry key. (fhandler_registry::rewinddir): Ditto. Avoid infinite recursion in VirtualStore under UAC: * fhandler_registry.cc (VIRT_CLASSES_KEY_PREFIX): Define. (VIRT_CLASSES_KEY_SUFFIX): Ditto. (VIRT_CLASSES_KEY): Ditto. (VIRT_CLASSES_LINKTGT): Ditto. (fhandler_registry::exists): Return virt_symlink as file type if this is a Classes key under the VirtualStore. (fhandler_registry::fstat): Handle virt_symlink. (fhandler_registry::readdir): Return DT_LNK as d_type if this is a Classes key under the VirtualStore. (fhandler_registry::fill_filebuf): Handle Classes symlink. Handle user impersonation in /proc/registry access: * autoload.cc (RegOpenUserClassesRoot): Define. (RegOpenCurrentUser): Define. * fhandler_registry.cc (RegOpenUserClassesRoot): Declare function missing in w32api. (RegOpenCurrentUser): Ditto. (fetch_hkey): New function. (fhandler_registry::open): Call fetch_hkey to get root registry key. (open_key): Ditto.
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
/* autoload.cc: all dynamic load stuff.
|
||||
|
||||
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
|
||||
2009, 2010, 2011 Red Hat, Inc.
|
||||
2009, 2010, 2011, 2012 Red Hat, Inc.
|
||||
|
||||
This file is part of Cygwin.
|
||||
|
||||
@ -367,6 +367,8 @@ LoadDLLfunc (LsaOpenPolicy, 16, advapi32)
|
||||
LoadDLLfunc (LsaQueryInformationPolicy, 12, advapi32)
|
||||
LoadDLLfunc (LsaRetrievePrivateData, 12, advapi32)
|
||||
LoadDLLfunc (LsaStorePrivateData, 12, advapi32)
|
||||
LoadDLLfunc (RegOpenUserClassesRoot, 16, advapi32)
|
||||
LoadDLLfunc (RegOpenCurrentUser, 8, advapi32)
|
||||
LoadDLLfunc (RegCloseKey, 4, advapi32)
|
||||
LoadDLLfunc (RegCreateKeyExW, 36, advapi32)
|
||||
LoadDLLfunc (RegEnumKeyExW, 32, advapi32)
|
||||
|
Reference in New Issue
Block a user