Commit Graph

2890 Commits

Author SHA1 Message Date
Corinna Vinschen 451c738bef * environ.cc (conv_envvars): Remove LD_LIBRARY_PATH entirely.
It doesn't belong here.
2005-05-16 15:48:36 +00:00
Corinna Vinschen 1f7b9e8bc6 * environ.cc (conv_envvars): Treat LD_LIBRARY_PATH as path list. 2005-05-15 12:04:13 +00:00
Corinna Vinschen dad546a5eb * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Check
return code from GetFileSize and set file size to 0 if necessary.
	* fhandler_netdrive.cc (fhandler_netdrive::fstat): Set permissions
	to read/execute for all.
2005-05-14 21:12:10 +00:00
Christopher Faylor 84778b9d8c really fix typo. 2005-05-13 22:40:19 +00:00
Christopher Faylor 9156326733 fix typo 2005-05-13 22:09:32 +00:00
Christopher Faylor 17e5c6a8f0 * path.cc (normalize_posix_path): Do normalization on . and .. after a '//'. 2005-05-13 21:05:46 +00:00
Corinna Vinschen 50361e07d1 * fhandler.h (fhandler_netdrive::readdir): Remove useless comment. 2005-05-13 20:29:31 +00:00
Corinna Vinschen e01eac68ed * autoload.cc (WNetGetResourceParentA): Import.
(WNetOpenEnumA): Import.
	(WNetEnumResourceA): Import.
	(WNetCloseEnum): Import.
	* fhandler.h (fhandler_netdrive::telldir): Add declaration.
	(fhandler_netdrive::seekdir): Ditto.
	(fhandler_netdrive::closedir): Ditto.
	* fhandler_netdrive.cc: Drop explicit including windows.h.  Include
	winnetwk.h instead of shlwapi.h.  Include dirent.h.
	(fhandler_netdrive::readdir): Implement.
	(fhandler_netdrive::telldir): New method.
	(fhandler_netdrive::seekdir): New method.
	(fhandler_netdrive::closedir): Ditto.
2005-05-13 20:20:02 +00:00
Christopher Faylor 063f1df2aa Remove PC_FULL from path_conv usage throughout.
* path.h (enum pathconv_arg): Change PC_FULL to PC_NOUILL.
* path.cc (path_conv::check): Test for PC_NOFULL rather than !PC_FULL.
(cygwin_conv_to_win32_path): Use PC_NOFULL to force non-absolute path.
2005-05-13 15:46:07 +00:00
Christopher Faylor eb6cd95fec * fhandler_netdrive.cc (fhandler_netdrive::exists): Assert that "//" exists. 2005-05-13 13:23:38 +00:00
Christopher Faylor 66582dd6e7 * cygtls.cc (_cygtls::remove): Eliminate compiler warning.
* dir.cc (mkdir): Check path for writability.
(rmdir): Ditto.  Remove check for special directories.
* path.cc (path_conv::check): Set PATH_RO for virtual devices.  Set error if
read-only and asked for writability.
* path.h (pathconv_arg): Add PC_WRITABLE.
(path_types): Add PATH_RO.
(path_conv::isro): Add (currently unused) check for read-only filesystem.
Return "ENOSHARE" when we know a share doesn't exist.
* include/sys/mount.h: Add MOUNT_RO flag.
* autoload.cc (WNetGetResourceInformationA): Import.
* fhandler_netdrive.cc (fhandler_netdrive::exists): Detect actual existence of
remote system rather than always assuming that it exists.
2005-05-13 03:21:39 +00:00
Christopher Faylor 3ac78fd612 * dcrt0.cc (do_global_dtors): Don't call dll_global_dtors here.
(__main): Reinstate atexit of do_global_dtors.
(cygwin_exit): Call dll_global_dtors here.
(do_exit): And here.
2005-05-11 21:53:54 +00:00
Christopher Faylor 8ad65ff049 * cygtls.cc (_cygtls::remove): Clear exitsock after close.
* fhandler_console.cc (fhandler_console::write_normal): Store character in a
local variable for potential future inspection.
2005-05-11 03:33:38 +00:00
Corinna Vinschen 13505ca8fc * Makefile.in (DLL_OFILES): Add fhandler_mailslot.o.
* devices.h (FH_KMSG): Define new device.
	* devices.in: Add "/dev/kmsg" entry.
	* devices.cc: Regenerate.
	* dtable.cc (build_fh_pc): Handle case FH_KMSG.
	* fhandler.h (class fhandler_mailslot): New class.
	(class select_stuff): Add device_specific_mailslot pointer.
	* fhandler_mailslot.cc: New file.
	* select.cc (peek_mailslot): New function.
	(verify_mailslot): Ditto.
	(struct mailslotinf): New stuct to handle select on mailslots.
	(thread_mailslot): New function.
	(start_thread_mailslot): Ditto.
	(mailslot_cleanup): Ditto.
	(fhandler_mailslot::select_read): New method.
	* syslog.cc (klog_guard): New muto.
	(dev_kmsg): Local mailslot for kernel message device.
	(vklog): New function.
	(klog): Ditto.
	* winsup.h (vklog): Declare.
	(klog): Ditto.
	* include/sys/syslog.h: Define _PATH_KLOG.
2005-05-10 20:56:07 +00:00
Christopher Faylor a586e5b6ae * dcrt0.cc (dll_crt0_1): Call cygwin_exit to ensure that destructors are
handled correctly.
2005-05-10 16:08:46 +00:00
Corinna Vinschen 94fed6a1f3 * path.cc (path_conv::check): Set correct file attributes for socket
files.
2005-05-10 09:08:20 +00:00
Pierre Humblet adef8db0ae 2005-05-09 Pierre Humblet <pierre.humblet@ieee.org>
* fhandler.h (class fhandler_netdrive): New class.
        * fhandler_netdrive.cc (fhandler_netdrive::fhandler_netdrive): New constructor.
        (fhandler_netdrive::exists): New method.
        (fhandler_netdrive::fstat): Ditto.
        (fhandler_netdrive::readdir): Ditto.
        (fhandler_netdrive::open): Ditto.
        * dtable.cc (build_fh_pc): Handle case FH_NETDRIVE.
        * path.cc (isvirtual_dev): Add FH_NETDRIVE.
        (mount_info::conv_to_win32_path): Detect netdrive device and bypass mount
        search for network paths.
2005-05-09 02:39:34 +00:00
Christopher Faylor 1cd8ccec87 * dcrt0.cc (get_cygwin_startup_info): New function pulled from dll_crt0_0.
(dll_crt0_0): Use get_cygwin_startup_info to retrieve cygwin-specific startup
pointer.
* external.cc (cygwin_internal): Implement CW_ARGV and CW_ENVP.
* include/sys/cygwin.h: Implement CW_ARGV and CW_ENVP.
2005-05-09 01:19:38 +00:00
Christopher Faylor 3f6494e216 * path.cc (normalize_posix_path): Don't treat '//' specially since newer
versions of bash now get this right.
2005-05-07 21:06:08 +00:00
Christopher Faylor bbb3381289 * devices.cc: Regenerate with correct name for dev_netdrive_storage. 2005-05-07 20:20:51 +00:00
Christopher Faylor 8cdcc8803a * Makefile.in (DLL_O_FILES): Add fhandler_netdrive.o.
* fhandler_netdrive.cc: Placeholder file for future development.
* devices.h (FH_NETDRIVE): Define new virtual device type.
(netdrive_dev): Define.
* devices.in (dev_netdrive_storage): Define.
* devices.cc: Regenerate.
2005-05-06 04:06:17 +00:00
Corinna Vinschen 56f235345d * cygerrno.h (__set_errno): Remove useless parentheses. 2005-05-04 11:05:11 +00:00
Corinna Vinschen 5d4750a996 * cygerrno.h (__set_errno): Define as inline function here.
(set_errno): Always define as call to __set_errno.
	* debug.cc (__set_errno): Move to cygerrno.h.
2005-05-04 11:00:22 +00:00
Christopher Faylor 782e53ca69 * shared.cc (user_shared_initialize): Rework locking so that nothing is checked
until cb is non-zero.
2005-05-04 01:14:47 +00:00
Corinna Vinschen 21b9fe3e33 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Don't treat
inability to open file as failure if only SetFileAttributes is
	going to be called.  Only call set_file_attribute if really necessary.
2005-05-03 19:03:20 +00:00
Corinna Vinschen 2ba719de27 * fhandler_socket.cc (get_inet_addr): Add missing __seterrno call. 2005-05-03 14:07:19 +00:00
Christopher Faylor b9b1b38358 * fhandler_tty.cc (fhandler_tty_slave::read): Actually read input when vmin ==
vtime == 0.
2005-05-02 00:17:45 +00:00
Christopher Faylor f0b14f146e * environ.cc (spenv::force_into_environment): Rename from add_always.
(spenv::add_if_exists): Rename from force.
(build_env): Accommodate name changes.  Make sure that stuff that is always
supposed to be in the environment is actually added to the environment.
* shared.cc (open_shared): Restore VirtualFree eliminated by 2005-04-28 change.
2005-04-30 17:07:05 +00:00
Christopher Faylor 06e0dc9a46 * errno.cc (errmap): Sort table. 2005-04-30 04:10:39 +00:00
Christopher Faylor 7b076c36fc * errno.cc (errmap): Map ERROR_NETNAME_DELETED to ENOSHARE. 2005-04-30 03:40:26 +00:00
Christopher Faylor c4ffa3c427 * shared_info.h (cygwin_shared_address): Bump to a higher value to avoid
collision with large data areas.
* fhandler_console.cc (fhandler_console::get_tty_stuff): Accommodate changes to
open_shared arguments.
* fhandler_tape.cc (mtinfo_init): Ditto.
* pinfo.cc (pinfo::init): Use open_shared rather than win32 mmap calls.
* shared.cc (user_shared_initialize): Ditto.
(memory_init): Ditto.
(open_shared): Change to allow use a smore general mmap handler.
* shared_info.h (shared_locations): Add SH_JUSTCREATE, SH_JUSTOPEN.
(open_shared): Change declaration to match new usage.
* autoload.cc (LoadDLLfuncEx2): Define in terms of LoadDLLfuncEx3.
(LoadDLLfuncEx3): New macro.
2005-04-28 23:59:44 +00:00
Christopher Faylor faae8c50a5 * fhandler.cc (fhandler_base::open_9x): Remove (broken) check for
O_CREAT|O_EXCL.
* syscalls.cc (open): Do O_CREAT|O_EXCL check here first.
2005-04-28 03:33:19 +00:00
Christopher Faylor dd991a7572 * environ.cc (build_env): Ensure that win32 array is properly filled in when a
missing value has to be generated.
2005-04-27 03:09:59 +00:00
Christopher Faylor 0aedc5e99a * include/cygwin/version.h: Bump DLL minor number to 17. 2005-04-26 17:27:40 +00:00
Joshua Daniel Franklin 46bf13ffc0 * how-to-debug-cygwin.txt: Fix typo. 2005-04-25 05:03:53 +00:00
Christopher Faylor bc79d16453 * shared.cc (user_shared_initialize): Implement locking similar to shared_info
when initializing shared region.
2005-04-23 03:24:21 +00:00
Christopher Faylor 098a429002 * fhandler.h (dev_console::set_color): Define new function.
(dev_console::set_default_attr): Ditto, moved from fhandler_console.
(dev_console::fillin_info): Ditto.  Accommodate this change throughout this
file.
(fhandler_console::get_win32_attr): Eliminate.
* fhandler_console.cc (fhandler_console::get_tty_stuff): Properly set default
attributes on initialization.
(fhandler_console::open): Set current attributes rather than default color on
open.
(fhandler_console::get_win32_attr): Eliminate.
(dev_console::set_color): New function.  Move get_win32_attr stuff here.
(dev_console::set_default_attr): New function, moved from fhandler_console.
(dev_console::fillin_info): Ditto.
(fhandler_console::char_command): Call set_color to set screen characteristics.
2005-04-22 17:03:38 +00:00
Christopher Faylor fb201f9270 * fhandler.cc (fhandler_base::read): Remove unused signal state tweaks.
* fhandler.h (fhandler_pipe::create_selectable): Declare.
(fhandler_fifo::close_one_end): Declare.
* fhandler_fifo.cc (fhandler_fifo::close_one_end): Define.
(fhandler_fifo::open_not_mine): Use close_one_end to close appropriate end of
pipe.
* pinfo.cc (_pinfo::commune_recv): Ditto.
* pipe.cc (fhandler_pipe::create_selectable): Rename from
create_selectable_pipe.  Reorganize.
(fhandler_pipe::create): Use create_selectable.
2005-04-22 13:58:09 +00:00
Christopher Faylor b13aa00489 * shared.cc (shared_info::initialize): Test previous version of shared memory
magic rather than current version when determining if there has been a shared
memory mismatch.
2005-04-21 23:53:49 +00:00
Christopher Faylor c6cb7f8f01 * sigproc.cc (proc_subproc): Fix handling of waiting for pids with zero value.
* strace.cc (strace::hello): Report parent pid of executing process.
2005-04-20 20:43:36 +00:00
Christopher Faylor 2e98459145 * path.cc (path_conv::check): Fix problem reading symlinks introduced in below
change by reverting the change and adding an additional test for nonexistent
files in /proc.
2005-04-20 18:25:14 +00:00
Christopher Faylor 5746f4b602 * path.cc (path_conv::check): Punt when attempting to access a nonexistent
directory or file in /proc.
2005-04-20 04:06:25 +00:00
Corinna Vinschen 28f2a08860 * security.cc (alloc_sd): Remove DELETE bit from user's ACE if
allow_traverse is set.
2005-04-19 10:10:13 +00:00
Corinna Vinschen d02099f239 * cygwin.din (pselect): Export.
* select.cc (pselect): New function.
	* include/cygwin/version.h: Bump API minor number.
	* include/sys/select.h: Include signal.h.  Declare pselect.
2005-04-19 08:32:59 +00:00
Corinna Vinschen 04843bf4a0 * fhandler.h (enum conn_state): Add connect_failed state.
* fhandler_socket.cc (fhandler_socket::connect): Set connect_state to
	connect_failed when connect failed.
	* poll.cc (poll): Change errno to EINVAL if allocating memory fails,
	according to SUSv3. Add socket descriptors always to except_fds. Test
	for failed connect and set revents flags appropriately.
	* select.cc (set_bits): Set connect_state to connect_failed when
	select indicates failed nonblocking connect.
	(fhandler_dev_null::select_except): Set except_ready to false so that
	/dev/null is not always in except state.
	(peek_socket): Fix bogus conditional.
	(fhandler_socket::select_write): Treat all connect_states except
	unconnected equivalent to return consistent results.
	(fhandler_windows::select_except): Set except_ready to false so that
	/dev/windows is not always in except state.
2005-04-18 18:56:52 +00:00
Christopher Faylor 2180b9627d * include/cygwin/version.h: Bump DLL minor number to 16. 2005-04-18 17:25:04 +00:00
Corinna Vinschen 96ab3848d6 * grp.cc (initgroups32): Return the correct value. 2005-04-18 16:03:08 +00:00
Corinna Vinschen 68401acd24 * fhandler_disk_file.cc (fhandler_base::utimes_fs): Ignore
ERROR_NOT_SUPPORTED to workaround Win9x weirdness.
	* path.cc (symlink_info::check): Remap ERROR_INVALID_FUNTION to
	ERROR_FILE_NOT_FOUND for the same reason.
2005-04-16 17:17:33 +00:00
Corinna Vinschen 68a3f0d34a * security.h (cygsidlist::addfromgr): Allow duplicate entries.
(get_server_groups): Declare new function.
	* security.cc (is_group_member): Simplify.
	(get_server_groups): New function.
	(get_initgroups_sidlist): Call get_server_groups.
	(verify_token): Allow token when supplementary sids are not in
	/etc/group but are in the token.
	Streamline the code.
	* grp.cc (initgroups32): New implementation.
	(getgroups32): Handle case where the supplementary groups are set.
2005-04-16 15:21:47 +00:00
Corinna Vinschen 6381056b23 * environ.cc (environ_init): Don't set traverse checking as default. 2005-04-16 13:11:40 +00:00