OSDN Git Service

* dir.cc (mkdir): Check last path component for "..".
authorcorinna <corinna>
Thu, 30 Nov 2006 10:17:24 +0000 (10:17 +0000)
committercorinna <corinna>
Thu, 30 Nov 2006 10:17:24 +0000 (10:17 +0000)
commit5c9f0c362a460bb686a9d848f9469e24349a1558
tree5c98fd17aa85ba68e55715e006269fb2516579ae
parentaf648c0817ce7a8b90224e2e396ff9501d587a2b
* dir.cc (mkdir): Check last path component for "..".
(rmdir): Don't check last path component for "..".
* fhandler_disk_file.cc (fhandler_disk_file::rmdir): Drop kludge
which tries to allow deleting the current working directory.
* path.cc (has_dot_last_component): Add parameter to indicate testing
for "..".  Take trailing slash into account.
(symlink_info::posixify): Rely on cygheap->cwd.win32 having a
useful value.
(cwdstuff::init): Initialize cygheap->cwd with current working
directory.  Change to windows_system_directory afterwards.
(cwdstuff::set): Never call SetCurrentDirectory here.  Just check
if changing into target directory would be allowed.  Add comment to
explain why.
* path.h (has_dot_last_component): Declare with second parameter.
* pinfo.cc (pinfo::zap_cwd): Remove.
(pinfo::exit): Drop call to zap_cwd.
* pinfo.h (class pinfo): Remove declaration of zap_cwd.
* spawn.cc (spawn_guts): Set current working directory for non-Cygwin
child applications.  Drop call to zap_cwd.
winsup/cygwin/ChangeLog
winsup/cygwin/dir.cc
winsup/cygwin/fhandler_disk_file.cc
winsup/cygwin/path.cc
winsup/cygwin/path.h
winsup/cygwin/pinfo.cc
winsup/cygwin/pinfo.h
winsup/cygwin/spawn.cc