Commit Graph

5125 Commits

Author SHA1 Message Date
Christopher Faylor ceb7fa1c4a * cygcheck.cc (dump_sysinfo): Don't attempt to use path if it is not set.
(nuke): Fix off by one error in allocation of environment variable.
(load_cygwin): Always set PATH even if cygwin environment is empty.
2005-05-20 16:38:42 +00:00
Danny Smith 45e3403e7b * crt1.c (_gnu_exception_handler): Handle illegal instruction
OS exception as a signal if user has defined a SIGILL handler.
2005-05-19 22:44:13 +00:00
Corinna Vinschen 89e5f7f81e * include/cygwin/in.h: Add comment. 2005-05-19 21:22:37 +00:00
Corinna Vinschen 58065cb805 * include/cygwin/in.h: Define IPPROTO_xxx values as macros to
accomodate SUSv3.
2005-05-19 21:18:17 +00:00
Christopher Faylor 8c509c0a11 fix comment 2005-05-19 20:37:51 +00:00
Christopher Faylor d63279febe fix comment 2005-05-19 20:34:42 +00:00
Christopher Faylor 776b73dd33 * include/limits.h: Include features.h, as on linux. 2005-05-19 19:45:28 +00:00
Christopher Faylor 071f64d934 * include/endian.h: New file. 2005-05-19 19:44:31 +00:00
Corinna Vinschen 424946e8ab * cygwin.sc: Add Dwarf-2 debug sections. 2005-05-19 17:04:28 +00:00
Corinna Vinschen 989ea1c99e * mmap.cc (mmap64): Make granularity an automatic variable. 2005-05-19 08:43:17 +00:00
Christopher Faylor 969d6089ce * fhandler.h (fhandler_cygdrive::seekdir): Delete declaration.
(fhandler_cygdrive::seekdir): Delete.
* fhandler.h (fhandler_cygdrive::iscygdrive_root): Delete method.
(fhandler_cygdrive::telldir): Delete declaration.
* fhandler_disk_file.cc: Remove all uses of fhandler_cygdrive::iscygdrive_root.
(fhandler_disk_file::mkdir): New method.
(fhandler_disk_file::rmdir): Ditto.
(fhandler_cygdrive::telldir): Delete.
2005-05-19 05:43:55 +00:00
Christopher Faylor ac437c3e0c * external.cc: Move pids declaration to file scope and use less enthusiastic
constructor.
* pinfo.h (winpids::winpids): Remove default setting.
* fhandler_fifo.cc (fhandler_fifo::open_not_mine): Accommodate removal of
default setting.
* fhandler_proc.cc (fhandler_proc::readdir): Ditto.
2005-05-19 01:25:20 +00:00
Christopher Faylor 24515d6563 * cygtls.h (_local_storage::unknown_thread_name): New buffer.
* tlsoffsets.h: Regenerate.
* cygthread.cc (cygthread::name): Use new thread-local buffer.
* exceptions.cc (handle_exceptions): Avoid unnecessary initialization of static
variables to zero.
* fork.cc (slow_pid_reuse) Ditto.
2005-05-18 23:30:02 +00:00
Corinna Vinschen 692fccabfb * mmap.cc (mmap64): Avoid compiler warning.
* ntea.cc (NTReadEA): Ditto.
	* hires.h (hires_base): Remove useless usecs function.
2005-05-18 17:23:17 +00:00
Brian Dessent 022e11fb49 2005-05-18 Brian Dessent <brian@dessent.net>
* install.texinfo ("How do I uninstall..."): Rewrite to cover
	removing services, dealing with permissions, and other common
	tasks for removing Cygwin completely.
2005-05-18 11:56:27 +00:00
Corinna Vinschen 49cc728adc * fhandler_netdrive.cc (fhandler_netdrive::telldir): Remove since it's
equivalent to fhandler_virtual::telldir now anyway.
	* fhandler.h (class fhandler_netdrive): Remove telldir.
2005-05-18 10:32:37 +00:00
Corinna Vinschen bffaf54d76 * fhandler_netdrive.cc (fhandler_netdrive::telldir): Implement.
(fhandler_netdrive::seekdir): Implement.
	(fhandler_netdrive::closedir): Call rewinddir to have only one point
	of calling WNetCloseEnum.
2005-05-18 10:23:40 +00:00
Brian Dessent 7f21d805a3 2005-05-17 Brian Dessent <brian@dessent.net>
* winsup.api/signal-into-win32-api.c (main): Use 'NULL' instead of '0'
	in argument list to avoid compiler warning with gcc4.
	* winsup.api/ltp/execle01.c (main): Ditto.
	* winsup.api/ltp/execlp01.c (main): Ditto.
	* winsup.api/ltp/fcntl07.c (do_exec): Ditto.
	* winsup.api/ltp/fcntl07B.c (do_exec): Ditto.
2005-05-18 01:10:06 +00:00
Corinna Vinschen 5b59a2cc0d * fhandler.h (class fhandler_netdrive): Add method rewinddir.
* fhandler_netdrive.cc (struct netdriveinf): New structure to
	store thread arguments.
	(thread_netdrive): Thread handling all potentially blocking
	WNet... calls.
	(create_thread_and_wait): Start and wait for above thread.
	(fhandler_netdrive::exists): Change to call create_thread_and_wait
	instead of calling WNet... function.
	(fhandler_netdrive::readdir): Ditto.  Fix error handling.
	(fhandler_netdrive::rewinddir): New method.
2005-05-17 20:34:15 +00:00
Corinna Vinschen 0d5ba26ccd * external.cc (cygwin_internal): Avoid compiler warning. 2005-05-17 08:46:41 +00:00
Christopher Faylor dce0c241ef white space 2005-05-17 01:29:27 +00:00
Christopher Faylor 4f7544bc97 * dcrt0.cc (dll_crt0_0): Don't do fixup_after_exec if dynamically loaded since
the state of fds is unknown at this point.
2005-05-17 01:27:31 +00:00
Christopher Faylor ac674bc896 * cygcheck.cc (cygwin_internal): Define as a "C" function.
* strace.cc (cygwin_internal): Ditto.
* cygpath.cc (print_version): Update copyright.
2005-05-17 01:26:16 +00:00
Christopher Faylor 5c8e6fbd8c * include/sys/cygwin.h (enum cygwin_getinfo_types): Add CW_DEBUG_SELF.
* external.cc (cygwin_internal): Implement CW_DEBUG_SELF.
* init.cc (dll_entry): Minor rearrangement of code.
2005-05-17 01:21:06 +00:00
Christopher Faylor b55ba2f3da * path.cc (path_conv::check): Remove embedded dots before slashes. 2005-05-17 01:08:58 +00:00
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
Christopher Faylor 41dcb6199c * cygcheck.cc (load_cygwin): Avoid calling putenv with a NULL path. 2005-05-16 03:18:29 +00:00
Corinna Vinschen 90253b8276 * cygcheck.cc (load_cygwin): Don't touch $PATH for now.
(print_version): Fix copyright.
	* strace.cc (print_version): Ditto.
2005-05-15 12:29:47 +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 1402b12a09 Add missing ChangeLog entry. 2005-05-13 21:01:32 +00:00
Corinna Vinschen 50361e07d1 * fhandler.h (fhandler_netdrive::readdir): Remove useless comment. 2005-05-13 20:29:31 +00:00
Corinna Vinschen b4d72bae47 * include/winnetwk.h (WNetGetResourceParentA): Add missing declaration.
(WNetGetResourceParentW): Ditto.
	* include/ddk/ntifs.h (FILE_ID_FULL_DIRECTORY_INFORMATION): Define.
2005-05-13 20:28:00 +00:00
Christopher Faylor 180cd17fa1 * mount.cc (mount_commands): Display "-X" option when appropriate. 2005-05-13 20:24:20 +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
Danny Smith 96c837f0ca * mingwex/math/nexttoward.c: New file.
* mingwex/math/nexttowardf.c: New file.
	* mingwex/math/nextafterl.c: Add nexttowardl aliaa.
	* mingwex/Makefile.in (MATH_DISTFILES): Add nexttoward.c,
	mexttowardf.c,
	(MATH_OBJS):  Add nexttoward.o,	mexttowardf.o,
	* include/math.h (nexttoward, nextowardf, nexttowardl): Add
	prototypes.
2005-05-10 08:39:07 +00:00
Danny Smith 5b91f0a6ef * mingwex/math/nextafterf.c (nextafterf): Correct
handling of -0.0.
	* mingwex/math/nextafterl.c: New file.
	* mingwex/Makefile.in (MATH_DISTFILES): Add nextafterl.c.
	(MATH_OBJS): Add nextafterl.o.
	* include/math.h (nextafterl): Uncomment prototype.
2005-05-09 09:36:10 +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 f991d0e53e * cygcheck.cc (nuke): New function.
(load_cygwin): New function.
(main): Use load_cygwin to load argv/envp from cygwin environment, if
appropriate.
2005-05-09 01:56:34 +00:00
Christopher Faylor 26c07f704b * strace.cc (attach_process): Don't call load_cygwin(). Assume that it's
already happened.
(dotoggle): Ditto.
(main): Set argv from cygwin environment, if it exists.
2005-05-09 01:21:43 +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
Joshua Daniel Franklin 61931ed5dc * how-programming.texinfo: Replace MAKE_MODE entry with FAQ about execvp errors and cygexec. 2005-05-08 19:43:35 +00:00
Danny Smith 02626f616d * mingwex/math/erfl.c: New file.
* mingwex/Makefile.i (MATH_DISTFILES): Add erfl.c.
	(MATH_OBJS): Add erfl.o.
	* include/math.h (erfl, erfcl): Uncomment prototypes.
2005-05-08 08:07:18 +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 bcd1a9b6d1 move comment 2005-05-06 21:09:58 +00:00
Christopher Faylor e73f487b3c fix breakpoint example 2005-05-06 21:09:35 +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
Danny Smith f3b0036304 * include/wchar.h (WCHAR_MAX): Define as 0xffff, so preprocessor
#if (WCHAR_MAX <= WCHAR_MIN) is false.
	* include/stdint.h (WCHAR_MAX): Likwise.
	(WINT_MAX): Likewise.
2005-05-04 09:29:09 +00:00
Christopher Faylor 530d0e0191 * shared.cc (user_shared_initialize): Rework locking so that nothing is checked
until cb is non-zero.
2005-05-04 01:20:05 +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
Danny Smith 8559dd92d0 * mingwex/math/signbit.c (__signbit): Make return value
consistent with GCC's __builtin_signbit.
	* mingwex/math/signbitf.c (__signbitf):  Likewise.
	* mingwex/math/signbitf.c (__signbitl):  Likewise.
	* include/math.h (__signbit, __signbitf, __signbitl): Likewise
	for inlines.
2005-05-03 08:39:19 +00:00
Danny Smith 38efa5f128 * include/_mingw.h (__MINGW_ATTRIB_NONNULL): Don't define as
variadic macro.
	* mingwex/mbrtowc.c (__mbrtowc_cp): Use __MINGW_ATTRIB_NONNULL.
	Remove unused MBTOWC_FLAGS define.
2005-05-02 08:03:34 +00:00
Christopher Faylor 05726ddd86 white space and minor comment cleanup. 2005-05-02 03:50:11 +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 0d235234c5 * mount.cc (usage): Clarify action of -m option. 2005-05-01 15:50:02 +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
Dave Korn 65e941162d * path.cc (getmntent): Add previously-omitted 'noexec' and 'managed'flags to
mnt_opts string if present in mount flags.
2005-04-29 16:39:34 +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 5c70f2f92e (check in files that should have been checked in previously)
* 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:41:09 +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
Danny Smith 4db7d42977 * include/wininet.h (FtpGetFileSize): Add prototype.
(FtpCommand[AW]): Correct prototypes.
	Reported by <siger at users dot sf dot net>
2005-04-26 08:18:27 +00:00
Christopher Faylor 6f4a176f07 * mount.cc (mount_commands): Display "-X" option when appropriate. 2005-04-25 14:40:53 +00:00
Danny Smith 4e069720c1 * include/vfw.h (capCreateCaptureWindow[AW]): Add prototypes.
(capGetDriverDescription[AW]): Likewise.

	ChangeLog: Typo fixes.
2005-04-25 07:08:22 +00:00
Joshua Daniel Franklin 46bf13ffc0 * how-to-debug-cygwin.txt: Fix typo. 2005-04-25 05:03:53 +00:00
Danny Smith 6fbeb6a3f0 * mingwex/mbrtowc.c: New file.
* mingwex/wcrtomb.c: New file.
	* mingwex/btowc.c: New file.
	* mingwex/wctob.c: New file.
	* mingwex/mb_wc_common.h: New file.
	* mingwex/Makefile.in (DISTFILES): Add new files.
	(Q8_OBJS): Add new objects.
	* include/wchar.h: Adjust comment about mbrtowc() and related
	funcions. Add __restrict__ to pointer params in prototypes.
	(wmemset. wmemchr, wmemcpy, wmemmove, wcstoll, wcstoull): Remove
	arg names from protototypes.
2005-04-24 11:30:27 +00:00
Danny Smith 4fc953d6a1 2005-04-23 Wu Yongwei <adah@sh163.net>
mingwex/dirent.c: Formatting changes.

	mingwex/dirent.c (_topendir): Make the end-of-path slash check
	MBCS-safe.
2005-04-24 10:26:37 +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 6794d79914 revert erroneous checkin 2005-04-20 20:50:57 +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
Corinna Vinschen c6a00dcbb9 * pathnames.sgml (mount-table): Indicate that user-specific
mounts override system-wide.
2005-04-20 12:26:45 +00:00
Corinna Vinschen a30482a386 * utils.sgml (mount): Clarify setting cygdrive prefix for user
and system-wide.
2005-04-20 12:25:43 +00:00
Christopher Faylor eb07f8c343 * fhandler-tut.txt: Update description to cygwin 1.5.13 2005-04-20 04:26:34 +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 f24a695d08 * cygwinenv.sgml: Mention that check_case is deprecated. 2005-04-19 14:45:54 +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
Christopher Faylor 4a08e9bce4 Actually check in files. 2005-04-17 00:12:14 +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 00c05edcf1 * cygwinenv.sgml: Add new words for (no)traverse option. 2005-04-16 13:16:25 +00:00
Corinna Vinschen 6381056b23 * environ.cc (environ_init): Don't set traverse checking as default. 2005-04-16 13:11:40 +00:00
Corinna Vinschen 8f47adf1c6 * fhandler_disk_file.cc (fhandler_base::utimes_fs): Drop touching
ChangeTime.
2005-04-16 12:53:48 +00:00
Christopher Faylor 06e18175e0 * fhandler.cc (fhandler::dup): Duplicate flags, too.
* fhandler.h (fhandler_fifo::owner): Eliminate.
* fhandler_disk_file.cc (fhandler_base::fstat_fs): Handle on-disk devices
better.
(fhandler_base::fstat_helper): Ditto.
* fhandler_fifo.cc (fhandler_fifo::fhandler_fifo): Don't initialize obsolete
"owner".
(fhandler_fifo::open_not_mine): Add some debugging.  Duplicate correct handle
when we own it.
(fhandler_fifo::open): Set flags from input, not from first pipe.  Flag that
fork fixup is needed.
(fhandler_fifo::dup): Set errno correctly when DuplicateHandle fails.
* pinfo.cc (commune_send): Add debugging for fifo.
* cygwin/version.h: Bump API minor version to 127 to reflect exporting of
sigrelese.
2005-04-16 05:20:01 +00:00
Corinna Vinschen f40d6122ff * syscalls.cc (setuid32): Correct debugging output. 2005-04-15 08:19:07 +00:00
Christopher Faylor dda0657380 * dcrt0.cc (do_global_dtors): Run DLL dtors.
(__main): Don't rely on atexit to run dtors.
(do_exit): Specifically call do_global_dtors here.
(cygwin_exit): Ditto.
* dll_init.cc (dll_global_dtors): Make global.  Only run dtors once.
(dll_list::init): Just set flag that dtors should be run.  Don't rely on
atexit.
* dll_init.h (dll_global_dtors): Declare.
* exceptions.cc (sigrelse): Define.
* path.h (is_fs_device): New method.
(is_lnk_special): Ditto.
* fhandler_disk_file.cc (fhandler_disk_file::link): Use "is_lnk_special" rather
than "is_lnk_symlink".
* syscalls.cc (rename): Ditto.
* hookapi.cc (ld_preload): Use colon as a separator rather than space.
2005-04-14 17:34:03 +00:00
Christopher Faylor 3178cfffc8 . 2005-04-14 17:08:02 +00:00
Corinna Vinschen bfe1ed40a8 * fhandler.h (class fhandler_socket): Remove utimes.
* fhandler_socket.cc (fhandler_socket::utimes): Remove.
2005-04-13 17:13:41 +00:00
Corinna Vinschen 7460bfd32b * cygerrno.h (__seterrno_from_nt_status): Define. Always set Win32
error code as well as errno. Use throughout where errno is set from
	NT status.
	(set_errno): Evaluate val only once.
	* fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Fix typo in
	debug output.
	* fhandler_mem.cc (fhandler_dev_mem::open): Rely on
	__seterrno_from_nt_status setting Win32 error code in debug output.
	* fhandler_proc.cc (format_proc_uptime): Ditto.
	(format_proc_stat): Ditto.
	* fhandler_process.cc (format_process_stat): Ditto.
	* sysconf.cc (sysconf): Ditto.
2005-04-13 16:41:33 +00:00
Christopher Faylor f134945dcb * fhandler.h (fhandler_base::utimes_fs): New method.
* fhandler.cc (fhandler_base::utimes): Call utimes_fs if on-disk special file.
* fhandler_disk_file.cc (fhandler_disk_file::utimes): Use utimes_fs.
(fhandler_base::utimes_fs): Handle on-disk device files.
2005-04-13 16:17:37 +00:00
Corinna Vinschen 726fe41807 * fhandler_disk_file.cc (fhandler_disk_file::utimes): Don't set errno
if open fails, it has already been set by open.
2005-04-13 11:07:44 +00:00
Corinna Vinschen 2a24463d0b * autoload.cc (NtQueryVolumeInformationFile): Add.
* fhandler.cc (fhandler_base::raw_write): Don't touch has_changed flag.
	* fhandler.h (enum change_state): Remove.
	(fhandler_base::status): Revert has_changed to a simple bit.
	(fhandler_base::fstat_helper): Add nAllocSize parameter.  Rename
	ftCreationTime to ftChangeTime.
	* fhandler_disk_file.cc:
	Call fstat_helper with additional
	allocation size throughout.
	(fhandler_base::fstat_by_handle): Use NT native functions to get
	full file information on NT.  Call fstat_helper with LastWriteTime
	as ctime, if ChangeTime is not available.
	(fhandler_base::fstat_by_name): Call fstat_helper with LastWriteTime
	as ctime.
	(fhandler_base::fstat_helper): Add comment. Drop special FAT
	handling since it's useless. Use nAllocSize for st_blocks if available.
	(fhandler_disk_file::touch_ctime): Only touch LastWriteTime.
	(fhandler_disk_file::fchmod): Set has_changed on 9x only.
	(fhandler_disk_file::fchown): Don't set has_changed.
	(fhandler_disk_file::facl): Ditto.
	(fhandler_disk_file::ftruncate): Ditto.
	(fhandler_disk_file::link): Set has_changed on 9x only and on original
	file only.
	(fhandler_base::open_fs): Don't set has_changed in O_TRUNC case.
	* ntdll.h (FILE_BASIC_INFORMATION): Define.
	(FILE_STANDARD_INFORMATION): Define.
	(FILE_INTERNAL_INFORMATION): Define.
	(FILE_EA_INFORMATION): Define.
	(FILE_ACCESS_INFORMATION): Define.
	(FILE_POSITION_INFORMATION): Define.
	(FILE_MODE_INFORMATION): Define.
	(FILE_ALIGNMENT_INFORMATION): Define.
	(FILE_NAME_INFORMATION): Don't define with arbitrary FileName size.
	(FILE_ALL_INFORMATION): Define.
	(FILE_INFORMATION_CLASS): Add FileAllInformation.
	(FILE_FS_VOLUME_INFORMATION): Define.
	(FS_INFORMATION_CLASS): Define.
	(NtQueryVolumeInformationFile): Define.
2005-04-12 14:26:31 +00:00
Corinna Vinschen e8b0558a10 Fix ChangeLog entry. 2005-04-11 21:56:08 +00:00
Corinna Vinschen 98e103aac9 Revert previous patch.
* autoload.cc (GetVolumePathNamesForVolumeNameA): Remove.
	* autoload.cc (GetVolumeNameForVolumeMountPointA): Add.
	* syscalls.cc (sync): Rewrite guid case to skip floppies also on
	Windows 2000.
2005-04-11 21:54:54 +00:00
Corinna Vinschen 48d304ef5a * syscalls.cc (sync): Use renamed has_get_volume_pathnames wincap.
* wincap.h (wincaps::has_get_volume_pathnames): Rename from
	has_guid_volumes
	* wincap.cc: Accomodate above rename throughout.  Set to false on
	Windows 2000.
2005-04-11 20:44:45 +00:00
Corinna Vinschen c400419414 * bsd_mutex.cc (msleep_cnt): Remove.
(msleep_max_cnt): Remove.
	(msleep_arr): Remove.
	(class msleep_sync_array): New class to encapsulate msleep/wakeup
	thread synchronization.
	(msleep_sync): New object pointer.
	(msleep_init): Initialize new msleep_sync object.
	(_mutex): Just call msleep_sync->enter() and msleep_sync->leave() for
	thread synchronization. Improve debug output a bit more.
	(wakeup): Just call msleep_sync->wakeup().
	(wakeup_all): Whitespace fix.
2005-04-08 20:31:43 +00:00
Christopher Faylor c07aaf0f04 * pipe.cc (fhandler_pipe::open): Remove O_CREAT limitation. 2005-04-08 19:57:36 +00:00
Corinna Vinschen 2ecb1a58cf * syslog.cc (try_connect_guard): Remove useless conditionalized code. 2005-04-07 20:42:20 +00:00
Corinna Vinschen 9d61c9a250 * syslog.cc: Include sys/socket.h.
(try_connect_guard): New static variable.
	(syslogd_inited): Ditto.
	(syslogd_sock): Ditto.
	(try_connect_syslogd): New function to connect and write syslog to
	local syslogd.
	(vsyslog): Log to stderr if LOG_PERROR flag has been given to openlog.
	Try logging to syslogd.  Use Event Log resp. log file as fallback.
	(closelog): Close socket to syslogd.
	* include/sys/syslog.h (_PATH_LOG): Define.
	(INTERNAL_NOPRI): Define if SYSLOG_NAMES is defined.
	(INTERNAL_MARK): Ditto.
	(struct _code): Ditto.
	(prioritynames): Ditto.
	(facilitynames): Ditto.
2005-04-07 20:16:46 +00:00
Corinna Vinschen a5bfc68712 * fhandler_socket.cc (get_inet_addr): Add type parameter to return
unix socket type.  Read socket type from unix socket file.
	(fhandler_socket::bind): Write socket type to unix socket file.
	(fhandler_socket::connect): Return with errno EPROTOTYPE if
	socket type of socket doesn't match socket type of unix socket
	trying to connect to.
2005-04-06 18:50:13 +00:00
Corinna Vinschen b62b8d7c80 * security.h (cygsidlist::addfromgr): Avoid duplicate entries.
* grp.cc (initgrousp): Add syscall_printf.
	(setgroups): Add syscall_printf and make sure sids are added only once.
2005-04-06 12:35:52 +00:00
Corinna Vinschen dafef5e249 * bsd_helper.cc (ipcexit_hookthread): Fix whitespace and handle leak.
* bsd_mutex.cc: Include stdlib.h, sys/msg.h and sys/sem.h.
	(mtx_init): Initialize lock counter to 0.
	(_mtx_lock): Increment and log mutex lock counter.
	(mtx_owned): Add winpid argument. Return true only if mutex is
	actually owned by process winpid.
	(_mtx_assert): Add winpid argument accordingly.
	(_mtx_unlock): Log owner and lock count.
	(MSLEEP_MUTEX): Remove.
	(MSLEEP_SEM): Ditto.
	(MSLEEP_EVENT): Ditto.
	(msleep_event_name): Ditto.
	(msleep_cs): New global critical section.
	(msleep_cnt): New global variable indicating msleep record usage.
	(msleep_max_cnt): New global variable indicating msleep record size.
	(msleep_arr): New global pointer to msleep records.
	(msleep_init): Initialize msleep_cs. Allocate msleep_arr array.
	(_msleep): Rewrite using new msleep_cs/msleep_arr based thread
	synchronization. Don't be shy with debug output.
	(wakeup): Rewrite using new msleep_cs/msleep_arr based thread
	synchronization.
	* bsd_mutex.h (struct mtx): Add lock counter for better debugging.
	(mtx_owned): Declare with winpid argument.
	(_mtx_assert): Ditto.
	(mtx_assert): Define with winpid argument.
	* cygserver.cc (version): Remove.
	(SERVER_VERSION): New define, decoupling server version information
	from source code control system.
	(print_version): Simplify printing server version.
	* process.cc (process::process): Fix wrong bracketing (and handle leak).
	(process::~process): Only try to close _signal_arrived if valid.
	* sysv_sem.cc: Include sys/smallprint.h.
	(semundo_clear): Define with additional struct thread pointer argument.
	Accomodate throughout.
	(SEMUNDO_LOCKASSERT): Define with winpid argument. Accomodate
	throughout.
	(struct sem_undo): Define un_proc as pid_t on Cygwin. Accomodate
	throughout.
	(seminit): Improve debugging by adding the semid to the mutex name.
	(semget): Correctly print key value as 64 bit hex value in debug
	output.
	(semexit_myhook): Remove Cygwin specific unlocking of mutexes owned
	by exiting process.  Keep semaphore global lock throughout whole
	function to avoid races.
	* sysv_shm.cc (GIANT_REQUIRED): Define empty on Cygwin. We know that
	Giant is locked.
2005-04-06 11:11:07 +00:00
Christopher Faylor 4ef6a27a5a * net.cc (cygwin_getservbyname): Return (possibly NULL) return value of dup_ent
rather than assuming that tls buffer is valid.
(cygwin_getservbyport): Ditto.
(cygwin_gethostbyname): Ditto.
(cygwin_gethostbyaddr): Ditto.
2005-04-06 05:48:55 +00:00
Christopher Faylor 42aa06a575 * cygtls.cc (_cygtls::remove): Don't free or close stuff if we're being called
in a "non-standard" way.
2005-04-05 17:13:35 +00:00
Christopher Faylor 2f1086cbca * sync.h (muto::initforce): Delete flawed implementation.
* pwdgrp.h (pwdgrp::pglock): Make static.
* grp.cc (pwdgrp::pwdgrp): Eliminate use of initforce.
2005-04-05 06:04:57 +00:00
Christopher Faylor f45c299dbe * sync.h (muto::initforce): Force initialization even when name != NULL.
* grp.cc (pwdgrp::pwdgrp): Use initforce since the enclosing structure is
!NO_COPY.
2005-04-05 04:48:02 +00:00
Christopher Faylor 322c131f9f * sync.h (muto::operator int): New operator.
(locker): Remove unused class.
(new_muto): Delete.
(new_muto1): Ditto.
(new_muto_name): Ditto.
* cygheap.cc (cygheap_setup_for_child): Reflect use of static storage for muto
rather than pointer.
(_csbrk): Ditto.
(_cmalloc): Ditto.
(_cmalloc): Ditto.
(_cfree): Ditto.
* cygheap.h (cwdstuff::cwd_lock): Ditto.
(cwdstuff::get_drive): Ditto.
* cygmalloc.h (__malloc_lock): Ditto.
(__malloc_unlock): Ditto.
* cygtls.cc (sentry::lock): Ditto.
(sentry::sentry): Ditto.
(~sentry): Ditto.
(_cygtls::init): Ditto.
* dcrt0.cc: Ditto.
(cygwin_atexit): Ditto.
(cygwin_exit): Ditto.
* debug.cc (lock_debug::locker): Ditto.
(lock_debug::lock_debug): Ditto.
(lock_debug::unlock): Ditto.
(debug_init): Ditto.
* dtable.cc (dtable::init_lock): Ditto.
* dtable.h (dtable::lock_cs): Ditto.
(dtable::lock): Ditto.
(dtable::unlock): Ditto.
* exceptions.cc (mask_sync): Ditto.
(sighold): Ditto.
(set_process_mask_delta): Ditto.
(set_signal_mask): Ditto.
(events_init): Ditto.
* grp.cc (pwdgrp::pwdgrp): Ditto.
* malloc_wrapper.cc (mallock): Ditto.
(malloc_init): Ditto.
* path.cc (cwdstuff::cwd_lock): Ditto.
(cwdstuff::get_hash): Ditto.
(cwdstuff::get_hash): Ditto.
(cwdstuff::init): Ditto.
(cwdstuff::set): Ditto.
(cwdstuff::get): Ditto.
* pwdgrp.h (pwdgrp::pglock): Ditto.
(pwdgrp::refresh): Ditto.
* sigproc.cc (sync_proc_subproc): Ditto.
(get_proc_lock): Ditto.
(proc_subproc): Ditto.
(_cygtls::remove_wq): Ditto.
(proc_terminate): Ditto.
(sigproc_init): Ditto.
* timer.cc (lock_timer_tracker::protect): Ditto.
(lock_timer_tracker::lock_timer_tracker): Ditto.
(lock_timer_tracker::~lock_timer_tracker): Ditto.
* wininfo.cc (wininfo::_lock;): Ditto.
(wininfo::winthread): Ditto.
(operator HWND): Ditto.
(wininfo::lock): Ditto.
(wininfo::release): Ditto.
* wininfo.h (wininfo::_lock;): Ditto.
2005-04-05 04:31:00 +00:00
Christopher Faylor 82ae6271ba * path.cc (path_conv::check): Only check for PC_NO_ACCESS_CHECK in end
component.
2005-04-04 16:07:36 +00:00
Corinna Vinschen e6d598eee0 * dcrt0.cc (dll_crt0_1): Don't call set_cygwin_privileges on 9x.
* fhandler.h (enum change_state): Add.
	(fhandler_base::status): Add a bit to has_changed flag.
	(fhandler_base::has_changed): Implement with type change_state.
	* fhandler.cc (fhandler_base::raw_write): Accomodate type change
	of has_changed.
	* fhandler_disk_file.cc )fhandler_disk_file::touch_ctime): Also
	touch modification time if has_changed == data_changed.
	(fhandler_disk_file::fchmod): Also open on 9x, otherwise we can't
	touch ctime.  Accomodate type change of has_changed.
	(fhandler_disk_file::fchown): Accomodate type change of has_changed.
	(fhandler_disk_file::facl): Ditto.
	(fhandler_disk_file::ftruncate): Ditto.
	(fhandler_disk_file::link): Ditto.
	(fhandler_base::open_fs): Ditto.
2005-04-04 10:26:35 +00:00
Corinna Vinschen 24e2f8b482 * include/winnt.h (SE_UNDOCK_NAME TEXT): Define.
(SE_MANAGE_VOLUME_NAME TEXT): Ditto.
	(SE_IMPERSONATE_NAME TEXT): Ditto.
	(SE_ENABLE_DELEGATION_NAME TEXT): Ditto.
	(SE_SYNC_AGENT_NAME TEXT): Ditto.
2005-04-03 17:47:37 +00:00
Corinna Vinschen f4a1f8a1db * cygheap.cc (cygheap_init): Accomodate set_process_privilege change.
* cygheap.h (cygheap_user::curr_primary_token): New member.
	(cygheap_user::primary_token): New method.
	(cygheap_user::deimpersonate): Always revert to processes'
	impersonation token.
	(cygheap_user::reimpersonate): Set processes' or setuid token as
	necessary.
	(cygheap_user::has_impersonation_tokens): Look for curr_primary_token
	value.
	(cygheap_user::close_impersonation_tokens): Close curr_primary_token
	here if necessary.  Don't reset token values to NO_IMPERSONATION since
	that's done in uinfo_init anyway.
	(init_cygheap::luid): New LUID array keeping privilege LUIDs.
	* cygtls.cc (_cygtls::init_thread): Call cygheap->user.reimpersonate.
	* dcrt0.cc (hProcToken): New global variable to keep process token.
	(hProcImpToken): Ditto for process impersonation token.
	(dll_crt0_0): Open process token here once.  Duplicate to create
	hProcImpToken.
	(dll_crt0_1): Call set_cygwin_privileges.
	* environ.cc (allow_ntea): Drop duplicate declaration.
	(allow_smbntsec): Ditto.
	(set_traverse): Only set allow_traverse here.
	(environ_init): Ditto.
	* fhandler_disk_file.cc (fhandler_disk_file::fchmod): Drop call to
	enable_restore_privilege.
	(fhandler_disk_file::fchown): Ditto.
	(fhandler_disk_file::facl): Ditto.
	* fork.cc (fork_child): Move call to cygheap->user.reimpersonate after
	syn with parent. Call set_cygwin_privileges.
	* grp.cc (internal_getgroups): Use hProcImpToken instead of opening
	process token.
	* path.cc (fs_info::update): Bypass traverse checking when retrieving
	volume information using push/pop_thread_privileges.
	* registry.cc (load_registry_hive): Drop setting restore privilege
	since it's already set if available.
	* sec_helper.cc: Include cygtls.h.
	(cygpriv): Privilege string array.
	(privilege_luid): New function, evaluate LUID from cygpriv_idx.
	(privilege_luid_by_name): New function, evaluate LUID from privilege
	string.
	(privilege_name): New function, evaluate privilege string from
	cygpriv_idx.
	(set_privilege): New static function called by set_process_privilege
	and set_thread_privilege.  Call privilege_luid to get privilege LUID.
	Fix bug in return value evaluation. Improve debug output.
	(set_cygwin_privileges): New function.
	(set_process_privilege): Remove.
	(enable_restore_privilege): Remove.
	* security.cc (allow_traverse): New global variable.
	(sys_privs): Change type to cygpriv_idx and store privilege indices
	instead of strings.
	(SYSTEM_PRIVILEGES_COUNT): Renamed from SYSTEM_PERMISSION_COUNT.
	(get_system_priv_list): Don't use numerical constant in malloc call.
	Use privilege_luid to get privilege LUIDs.
	(get_priv_list): Call privilege_luid_by_name to get LUIDs. Improve
	inner privilege LUID comparison loop.
	(create_token): Enable create token privilege using
	push/pop_self_privileges. Use hProcToken instead of opening process
	token. Use default DACL when duplicating token.
	(subauth): Enable tcb privilege using push/pop_self_privileges.
	Use sec_none instead of homw made security attributes when duplicating
	token.
	(check_file_access): Don't duplicate access token, use active
	impersonation token as is.
	* security.h (enum cygpriv_idx): New enumeration type enumerating
	possible privileges.
	(privilege_luid): Declare new function.
	(privilege_luid_by_name): Ditto.
	(privilege_name): Ditto.
	(allow_traverse): Declare.
	(set_privilege): Declare function.
	(set_process_privilege): Define as macro.
	(enable_restore_privilege): Remove declaration.
	(_push_thread_privilege): Define macro.
	(push_thread_privilege): Ditto.
	(pop_thread_privilege): Ditto.
	(pop_self_privilege): Ditto.
	* spawn.cc (spawn_guts): Use cygheap->user.primary_token instead of
	cygheap->user.token.
	* syscalls.cc (statvfs): Bypass traverse checking when retrieving
	volume information using push/pop_thread_privileges. Rearrange code
	to simplify push/pop bracketing.
	(seteuid32): Use hProcToken instead of opening process token. Call
	cygheap->user.deimpersonate instead of RevertToSelf.  Create
	impersonation token from primary internal or external token.  Set
	cygheap->user.curr_primary_token and cygheap->user.current_token
	privileges once here.  Drop "failed" and "failed_ptok" labels.
	Drop setting DefaultDacl of process token.
	(setegid32): Use hProcToken and hProcImpToken instead of opening
	process token. Always reimpersonate afterwards.
	* uinfo.cc (cygheap_user::init): Use hProcToken instead of opening
	process token.
	(internal_getlogin): Ditto. Set hProcImpToken, too.
	(uinfo_init): Initialize cygheap->user.curr_primary_token.
	* winsup.h (hProcToken): Declare.
	(hProcImpToken): Declare.
2005-04-03 13:06:43 +00:00
Corinna Vinschen fe3e333661 Unify usage of CYG_MAX_PATH throughout. Change buffers from
size CYG_MAX_PATH + 1 to CYG_MAX_PATH.  Change length tests
	accordingly.
2005-04-03 08:45:21 +00:00
Christopher Faylor 5e679b1981 * include/cygwin/version.h: Bump DLL minor number to 15. 2005-04-02 21:22:52 +00:00
Corinna Vinschen 31d419c977 * fork.cc (fork_child): Add missing __stdcall. 2005-04-01 16:52:48 +00:00
Corinna Vinschen c9f545e20f * bsd_mutex.cc (_msleep): Whitespace fix.
* process.cc (process::process): Handle invalid signal_arrived values
	more gracefully.
2005-04-01 15:35:47 +00:00
Christopher Faylor d0bed66e45 * sigproc.cc (create_signal_arrive): New (temporary?) function to create
signal_arrived event.
(sigproc_init): Use create_signal_arrived.
* fork.cc (fork_child): Create signal_arrived early.
2005-04-01 15:27:52 +00:00
Corinna Vinschen b6e69d53f6 * fork.cc (fork_child): Fixup SYSV IPC shared memory before fixing
up fdtab.
2005-04-01 11:47:00 +00:00
Corinna Vinschen e033f8aec0 * gentls_offsets: Add '-m32' flag to native compiler call to satisfy
cross platform builds.
2005-03-31 15:53:57 +00:00
Danny Smith a1d1d8ab80 * include/_mingw.h (__MINGW_ATTRIB_NONNULL): Define. 2005-03-31 10:00:26 +00:00
Corinna Vinschen 12a410132d * errno.cc (NO_SYSTEM_RESOURCES): Map to EAGAIN.
(NONPAGED_SYSTEM_RESOURCES): Ditto.
	(PAGED_SYSTEM_RESOURCES): Ditto.
	(WORKING_SET_QUOTA): Ditto.
	(PAGEFILE_QUOTA): Ditto.
	(COMMITMENT_LIMIT): Ditto.
2005-03-30 22:07:20 +00:00
Christopher Faylor 4e6c0729d1 * environ.cc (spenvs): Re-force SYSTEMROOT to always be included in
environment.
(build_env): Ditto.
2005-03-30 22:06:32 +00:00
Christopher Faylor 6829b6e914 * environ.cc (spenv::retrieve): Revert most of previous change.
(build_env): Ditto.  Rework to track environment variables which need to always
be in the windows environment in a separate array.
2005-03-30 21:35:31 +00:00
Corinna Vinschen e8cf344cf6 * path.cc (symlink_info::case_check): Ignore trailing characters
in paths when comparing case.
2005-03-30 20:01:43 +00:00
Christopher Faylor 18ef968f40 fix typo 2005-03-30 19:43:36 +00:00