* fhandler.h (fhandler_base::hclose): New virtual method.
(fhandler_base::set_inheritance): Make this a method so that we can use the appropriate close methods. * fhandler.cc (fhandler_base::set_inheritance): Ditto. * path.cc (normalize_posix_path): Eliminate /. trailing path component.
This commit is contained in:
		| @@ -1,15 +1,24 @@ | |||||||
|  | Thu Apr 20 00:32:03 2000  Christopher Faylor <cgf@cygnus.com> | ||||||
|  |  | ||||||
|  | 	* fhandler.h (fhandler_base::hclose): New virtual method. | ||||||
|  | 	(fhandler_base::set_inheritance): Make this a method so that we can use | ||||||
|  | 	the appropriate close methods. | ||||||
|  | 	* fhandler.cc (fhandler_base::set_inheritance): Ditto. | ||||||
|  | 	* path.cc (normalize_posix_path): Eliminate /.  trailing path | ||||||
|  | 	component. | ||||||
|  |  | ||||||
| Wed Apr 20  0:19:00 2000  Corinna Vinschen <corinna@vinschen.de> | Wed Apr 20  0:19:00 2000  Corinna Vinschen <corinna@vinschen.de> | ||||||
|  |  | ||||||
|         * syscalls.cc (setuid): Allow switching user context after | 	* syscalls.cc (setuid): Allow switching user context after | ||||||
|         successful call to ImpersonateLogedOnUser (NT only). | 	successful call to ImpersonateLogedOnUser (NT only). | ||||||
|         (setgid): Ditto. | 	(setgid): Ditto. | ||||||
|         (seteuid): Call setuid. | 	(seteuid): Call setuid. | ||||||
|         (setegid): Call setgid. | 	(setegid): Call setgid. | ||||||
|  |  | ||||||
| Wed Apr 19 22:00:00 2000  Corinna Vinschen <corinna@vinschen.de> | Wed Apr 19 22:00:00 2000  Corinna Vinschen <corinna@vinschen.de> | ||||||
|  |  | ||||||
|         * uinfo.cc (internal_getlogin): Use NetGetDCName() instead | 	* uinfo.cc (internal_getlogin): Use NetGetDCName() instead | ||||||
|         of NetGetAnyDCName(). | 	of NetGetAnyDCName(). | ||||||
|  |  | ||||||
| Mon Apr 17 12:08:47 2000  Kazuhiro Fujieda  <fujieda@jaist.ac.jp> | Mon Apr 17 12:08:47 2000  Kazuhiro Fujieda  <fujieda@jaist.ac.jp> | ||||||
|  |  | ||||||
| @@ -55,12 +64,12 @@ Thu Apr 13  8:48:00 2000  Corinna Vinschen <corinna@vinschen.de> | |||||||
|  |  | ||||||
| 	* path.cc (conv_to_win32_path): Detect a win32 path | 	* path.cc (conv_to_win32_path): Detect a win32 path | ||||||
| 	if path contains backslashes. | 	if path contains backslashes. | ||||||
|         * cygwin.din: Add symbol for `lacl'. | 	* cygwin.din: Add symbol for `lacl'. | ||||||
|         * security.cc (ReadSD): Add debug output. | 	* security.cc (ReadSD): Add debug output. | ||||||
|         (acl_worker):  New static function. | 	(acl_worker):  New static function. | ||||||
|         (acl): Call acl_worker now. | 	(acl): Call acl_worker now. | ||||||
|         (lacl): New function. | 	(lacl): New function. | ||||||
|         (facl): Call acl_worker now. | 	(facl): Call acl_worker now. | ||||||
| 	* include/cygwin/acl.h: Add prototype for `lacl'. | 	* include/cygwin/acl.h: Add prototype for `lacl'. | ||||||
|  |  | ||||||
| Wed Apr 12 18:48:33 2000  Christopher Faylor <cgf@cygnus.com> | Wed Apr 12 18:48:33 2000  Christopher Faylor <cgf@cygnus.com> | ||||||
| @@ -386,7 +395,7 @@ Fri Feb 25 19:26:42 2000  Christopher Faylor <cgf@cygnus.com> | |||||||
| 2000-02-25  DJ Delorie  <dj@cygnus.com> | 2000-02-25  DJ Delorie  <dj@cygnus.com> | ||||||
|  |  | ||||||
| 	* Makefile.in: fix "make check" support and cygrun. | 	* Makefile.in: fix "make check" support and cygrun. | ||||||
| 	 |  | ||||||
| Thu Feb 24 15:56:00 2000  Christopher Faylor <cgf@cygnus.com> | Thu Feb 24 15:56:00 2000  Christopher Faylor <cgf@cygnus.com> | ||||||
|  |  | ||||||
| 	* syscalls.c (_read): Clear errno before doing any read operation. | 	* syscalls.c (_read): Clear errno before doing any read operation. | ||||||
|   | |||||||
| @@ -1427,8 +1427,8 @@ fhandler_pipe::lseek (off_t offset, int whence) | |||||||
|   return -1; |   return -1; | ||||||
| } | } | ||||||
|  |  | ||||||
| void __stdcall | void | ||||||
| set_inheritance (HANDLE &h, int not_inheriting, const char *name) | fhandler_base::set_inheritance (HANDLE &h, int not_inheriting, const char *name) | ||||||
| { | { | ||||||
|   HANDLE newh; |   HANDLE newh; | ||||||
|  |  | ||||||
| @@ -1438,16 +1438,17 @@ set_inheritance (HANDLE &h, int not_inheriting, const char *name) | |||||||
| #ifndef DEBUGGING | #ifndef DEBUGGING | ||||||
|   else |   else | ||||||
|     { |     { | ||||||
|       CloseHandle (h); |       hclose (h); | ||||||
|       h = newh; |       h = newh; | ||||||
|     } |     } | ||||||
| #else | #else | ||||||
|   else if (!name) |   else if (!name) | ||||||
|     { |     { | ||||||
|       CloseHandle (h); |       hclose (h); | ||||||
|       h = newh; |       h = newh; | ||||||
|     } |     } | ||||||
|   else |   else | ||||||
|  |   /* FIXME: This won't work with sockets */ | ||||||
|     { |     { | ||||||
|       ForceCloseHandle2 (h, name); |       ForceCloseHandle2 (h, name); | ||||||
|       h = newh; |       h = newh; | ||||||
|   | |||||||
| @@ -235,6 +235,8 @@ public: | |||||||
|   const char *get_win32_name () { return win32_path_name_; } |   const char *get_win32_name () { return win32_path_name_; } | ||||||
|   unsigned long get_namehash () { return namehash_; } |   unsigned long get_namehash () { return namehash_; } | ||||||
|  |  | ||||||
|  |   virtual void hclose (HANDLE h) {CloseHandle (h);} | ||||||
|  |   virtual void set_inheritance (HANDLE &h, int not_inheriting, const char *name = NULL); | ||||||
|  |  | ||||||
|   /* fixup fd possibly non-inherited handles after fork */ |   /* fixup fd possibly non-inherited handles after fork */ | ||||||
|   void fork_fixup (HANDLE parent, HANDLE &h, const char *name); |   void fork_fixup (HANDLE parent, HANDLE &h, const char *name); | ||||||
| @@ -315,6 +317,7 @@ public: | |||||||
|   int ioctl (unsigned int cmd, void *); |   int ioctl (unsigned int cmd, void *); | ||||||
|   off_t lseek (off_t, int) { return 0; } |   off_t lseek (off_t, int) { return 0; } | ||||||
|   int close (); |   int close (); | ||||||
|  |   void hclose (HANDLE) {close ();} | ||||||
|  |  | ||||||
|   select_record *select_read (select_record *s); |   select_record *select_read (select_record *s); | ||||||
|   select_record *select_write (select_record *s); |   select_record *select_write (select_record *s); | ||||||
| @@ -810,6 +813,4 @@ public: | |||||||
| uid_t __stdcall get_file_owner (int, const char *); | uid_t __stdcall get_file_owner (int, const char *); | ||||||
| gid_t __stdcall get_file_group (int, const char *); | gid_t __stdcall get_file_group (int, const char *); | ||||||
|  |  | ||||||
| void __stdcall set_inheritance (HANDLE &h, int val, const char *name = NULL); |  | ||||||
|  |  | ||||||
| #endif /* _FHANDLER_H_ */ | #endif /* _FHANDLER_H_ */ | ||||||
|   | |||||||
| @@ -549,7 +549,7 @@ normalize_posix_path (const char *cwd, const char *src, char *dst) | |||||||
|   const char *src_start = src; |   const char *src_start = src; | ||||||
|   char *dst_start = dst; |   char *dst_start = dst; | ||||||
|  |  | ||||||
|   if (! SLASH_P (src[0])) |   if (!SLASH_P (src[0])) | ||||||
|     { |     { | ||||||
|       if (strlen (cwd) + 1 + strlen (src) >= MAX_PATH) |       if (strlen (cwd) + 1 + strlen (src) >= MAX_PATH) | ||||||
| 	{ | 	{ | ||||||
| @@ -619,6 +619,8 @@ normalize_posix_path (const char *cwd, const char *src, char *dst) | |||||||
| 	  ++src; | 	  ++src; | ||||||
| 	} | 	} | ||||||
|     } |     } | ||||||
|  |   if (dst > (dst_start + 1) && dst[-1] == '.' && SLASH_P (dst[-2])) | ||||||
|  |     dst -= 2; | ||||||
|   *dst = 0; |   *dst = 0; | ||||||
|   debug_printf ("%s = normalize_posix_path (%s)", dst_start, src_start); |   debug_printf ("%s = normalize_posix_path (%s)", dst_start, src_start); | ||||||
|   return 0; |   return 0; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user