From 8eca5362726ea2c0a83ca1e9d64086f2e58c22f5 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 30 Nov 2006 10:17:24 +0000 Subject: * 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/path.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'winsup/cygwin/path.h') diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h index 4097053c7..e011575f2 100644 --- a/winsup/cygwin/path.h +++ b/winsup/cygwin/path.h @@ -305,7 +305,7 @@ has_exec_chars (const char *buf, int len) int pathmatch (const char *path1, const char *path2) __attribute__ ((regparm (2))); int pathnmatch (const char *path1, const char *path2, int len) __attribute__ ((regparm (2))); -bool has_dot_last_component (const char *dir) __attribute__ ((regparm (1))); +bool has_dot_last_component (const char *dir, bool test_dot_dot) __attribute__ ((regparm (2))); bool fnunmunge (char *, const char *) __attribute__ ((regparm (2))); -- cgit v1.2.3