* 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,3 +1,12 @@ | ||||
| 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> | ||||
|  | ||||
| 	* syscalls.cc (setuid): Allow switching user context after | ||||
|   | ||||
| @@ -1427,8 +1427,8 @@ fhandler_pipe::lseek (off_t offset, int whence) | ||||
|   return -1; | ||||
| } | ||||
|  | ||||
| void __stdcall | ||||
| set_inheritance (HANDLE &h, int not_inheriting, const char *name) | ||||
| void | ||||
| fhandler_base::set_inheritance (HANDLE &h, int not_inheriting, const char *name) | ||||
| { | ||||
|   HANDLE newh; | ||||
|  | ||||
| @@ -1438,16 +1438,17 @@ set_inheritance (HANDLE &h, int not_inheriting, const char *name) | ||||
| #ifndef DEBUGGING | ||||
|   else | ||||
|     { | ||||
|       CloseHandle (h); | ||||
|       hclose (h); | ||||
|       h = newh; | ||||
|     } | ||||
| #else | ||||
|   else if (!name) | ||||
|     { | ||||
|       CloseHandle (h); | ||||
|       hclose (h); | ||||
|       h = newh; | ||||
|     } | ||||
|   else | ||||
|   /* FIXME: This won't work with sockets */ | ||||
|     { | ||||
|       ForceCloseHandle2 (h, name); | ||||
|       h = newh; | ||||
|   | ||||
| @@ -235,6 +235,8 @@ public: | ||||
|   const char *get_win32_name () { return win32_path_name_; } | ||||
|   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 */ | ||||
|   void fork_fixup (HANDLE parent, HANDLE &h, const char *name); | ||||
| @@ -315,6 +317,7 @@ public: | ||||
|   int ioctl (unsigned int cmd, void *); | ||||
|   off_t lseek (off_t, int) { return 0; } | ||||
|   int close (); | ||||
|   void hclose (HANDLE) {close ();} | ||||
|  | ||||
|   select_record *select_read (select_record *s); | ||||
|   select_record *select_write (select_record *s); | ||||
| @@ -810,6 +813,4 @@ public: | ||||
| uid_t __stdcall get_file_owner (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_ */ | ||||
|   | ||||
| @@ -619,6 +619,8 @@ normalize_posix_path (const char *cwd, const char *src, char *dst) | ||||
| 	  ++src; | ||||
| 	} | ||||
|     } | ||||
|   if (dst > (dst_start + 1) && dst[-1] == '.' && SLASH_P (dst[-2])) | ||||
|     dst -= 2; | ||||
|   *dst = 0; | ||||
|   debug_printf ("%s = normalize_posix_path (%s)", dst_start, src_start); | ||||
|   return 0; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user