* cygheap.cc (cygheap_root::cygheap_rot): Remove constructor.
(cygheap_root::~cygheap_root): Remove destructor. (cygheap_root::operator =): Remove. (cygheap_root::set): New method. * cygheap.h (cygheap_root): Reflect above changes. Store root info in mount-like structure. (cygheap_root:posix_ok): New method. (cygheap_root::ischroot_native): Ditto. (cygheap_root::unchroot): Ditto. (cygheap_root::exists): Ditto. (cygheap_root::posix_length): Ditto. (cygheap_root::posix_path): Ditto. (cygheap_root::native_length): Ditto. (cygheap_root::native_path): Ditto. * dir.cc (opendir): Remove special chroot test. * path.cc (path_prefix_p): Remove front end. (normalize_posix_path): Reorganize chroot tests to accomodate new convention of allowing paths using posix chroot prefix. (path_conv::check): Pass a "already ran normalize" option to conv_to_win32_path. Return if there is an error from this function. (mount_info::conv_to_win32_path): Add extra argument. Don't call normalize_posix_path if caller has already done so. Substitute chroot setting, if any, for root translation. Add chroot checking to final output step. * shared_info (mount_info): Accomodate additional argument to conv_to_win32_path. * syscalls.cc (chroot): Store both normalized posix path and native path in chroot.
This commit is contained in:
@@ -78,8 +78,7 @@ opendir (const char *dirname)
|
||||
goto failed;
|
||||
}
|
||||
|
||||
if (stat (cygheap->root.length () ? dirname : real_dirname.get_win32 (),
|
||||
&statbuf) == -1)
|
||||
if (stat (real_dirname, &statbuf) == -1)
|
||||
goto failed;
|
||||
|
||||
if (!(statbuf.st_mode & S_IFDIR))
|
||||
@@ -88,7 +87,7 @@ opendir (const char *dirname)
|
||||
goto failed;
|
||||
}
|
||||
|
||||
len = strlen (real_dirname.get_win32 ());
|
||||
len = strlen (real_dirname);
|
||||
if (len > MAX_PATH - 3)
|
||||
{
|
||||
set_errno (ENAMETOOLONG);
|
||||
|
Reference in New Issue
Block a user