Commit Graph

1575 Commits

Author SHA1 Message Date
Christopher Faylor 88de60e449 one more change 2002-08-07 01:22:56 +00:00
Christopher Faylor 772f6c3e12 * cygheap.cc (_csbrk): Avoid !cygheap considerations.
(cygheap_init): Deal with unintialized cygheap issues here.
2002-08-07 01:20:59 +00:00
Christopher Faylor e851d2fe43 Conrad Scott <conrad.scott@dsl.pipex.com
* cygheap.cc (_csbrk): Allocate some slop initially.  Don't erroneously add
sbrk amount to returned value in initial case.
2002-08-06 22:05:53 +00:00
Christopher Faylor 115a0885bc * spawn.cc (spawn_guts): Don't set mount_h here.
* sigproc.cc (init_child_info): Set it here instead.
* shared.cc (cygwin_mount_h): Make NO_COPY.
2002-08-06 05:48:33 +00:00
Christopher Faylor 1524ae42cf * cygthread.cc (cygthread::stub): Accept flag to pass info structure to thread
function.
(cygthread::operator new): Add defense debugging output.
(cygthread::cygthread): Add debugging output.  Set name after thread has been
awakened to avoid a race.
(cygthread::exit_thread): Use handle operator rather than using ev directly.
(cygthread::exit_thread): Reorganize to provide debugging.  Set __name to NULL.
* cygthread.h (cygself): Define.
* fhandler_tty.cc (fhandler_tty_master::init): Use cygself as argument so that
invoked thread can access its own info.
(process_output): Derive cygthread info of thread from thread argument.
* sigproc.cc (sigproc_init): Use cygself as argument so that invoked thread can
access its own info.
(wait_sig): Derive cygthread info of thread from thread argument.
2002-08-06 05:08:55 +00:00
Conrad Scott ffebb4fe0c * debug.h (handle_list::allocated): Remove field.
* debug.cc (newh): Don't malloc extra entries.
	(add_handle): Downgrade strace message level.
	(delete_handle): Remove case for `allocated' entries.
2002-08-06 03:40:40 +00:00
Christopher Faylor 8d0bc156ef * cygthread.cc (cygthread::stub): Change event creation to manual reset. Set
__name after calling SetEvent to prevent races.
(cygthread::detach): Always reset event here to prevent races.
2002-08-05 16:15:46 +00:00
Conrad Scott 245e4e8734 * debug.h (WaitForMultipleObjects): Correct typo. 2002-08-03 23:43:42 +00:00
Christopher Faylor 2389d0af46 update 2002-08-03 23:34:01 +00:00
Corinna Vinschen 23d93d8db7 * security.cc (verify_token): Do not reject a token just because
the supplementary group list is missing Everyone or a groupsid
	equal to usersid, or because the primary group is not in the token,
	as long as it is equal to the usersid.
	* syscalls.cc (seteuid32): Use common code for all successful returns.
	* grp.cc (getgroups32): Never includes Everyone in the output.
2002-08-02 11:00:18 +00:00
Christopher Faylor 6b2a9a2fdf * cygthread.cc (cygthread::exit_thread): Define new method.
* cygthread.h (cygthread::exit_thread): Declare new method.
* fhandler.h (fhandler_tty_master::hThread): Delete.
(fhandler_tty_master::output_thread): Define.
* fhandler_tty.cc (fhandler_tty_master::fhandler_tty_master): Adjust
constructor.
(fhandler_tty_master::init): Use cygthread rather than handle.
(process_output): Use cygthread method to exit.
(fhandler_tty_master::fixup_after_fork): Set output_thread to NULL after fork.
(fhandler_tty_master::fixup_after_exec): Set output_thread to NULL after
spawn/exec.
* tty.cc (tty_list::terminate): Detach from output_thread using cygthread
method.
2002-08-02 02:10:24 +00:00
Christopher Faylor 8a19897f17 * syscalls.cc (_link): Revert previous change and just always dereference the
oldpath.
2002-08-01 23:53:07 +00:00
Christopher Faylor e51cfd3116 * syscalls.cc (link): Properly deal with a link to a symlink. 2002-08-01 21:29:31 +00:00
Christopher Faylor 92655eab17 * cygthread.cc: Remove cruft. 2002-08-01 16:27:29 +00:00
Christopher Faylor b6bd703781 * Makefile.in (DLL_OFILES): Add cygthread.o.
* dcrt0.cc (dll_crt0_1): Eliminate various thread initialization functions in
favor of new cygthread class.
* debug.cc: Remove thread manipulation functions.
* debug.h: Ditto.
* external.cc (cygwin_internal): Use cygthread method for determining thread
name.  Remove capability for setting thread name.
* fhandler_console.cc (fhandler_console::read): Use cygthread method rather
than iscygthread function.
* fhandler_tty.cc (fhandler_tty_master::fhandler_tty_master): Use cygthread
methods to create threads.
(fhandler_tty_common::__acquire_output_mutex): Use cygthread method to retrieve
thread name.
* select.cc (pipeinf): Use cygthread pointer rather than handle.
(start_thread_pipe): Ditto.
(pipe_cleanup): Ditto.
(serialinf): Ditto.
(start_thread_serial): Ditto.
(serial_cleanup): Ditto.
(socketinf): Ditto.
(start_thread_socket): Ditto.
(socket_cleanup): Ditto.
* sigproc.cc (hwait_sig): Ditto.
(hwait_subproc): Ditto.
(proc_terminate): Ditto.
(sigproc_terminate): Ditto.
(sigproc_init): Initialize cygthread hwait_sig pointer.
(subproc_init): Initialize cygthread hwait_subproc pointer.
(wait_sig): Rely on cygthread HANDLE operator.
* strace.cc (strace::vsprntf): Use cygthread::name rather than threadname.
* window.cc (gethwnd): Use cygthread method to initialize thread.
2002-08-01 16:20:31 +00:00
Corinna Vinschen afcd48e61b * fhandler.h (fhandler_base::get_r_no_interrupt): Make non-virtual.
* net.cc (fdsock): Call set_r_no_interrupt.
2002-07-31 13:18:51 +00:00
Christopher Faylor deaa100bae * syscalls.cc (_read): Clarify debugging output. 2002-07-31 00:57:40 +00:00
Christopher Faylor c91a9a9b58 * fhandler.h (fhandler_base::get_r_no_interrupt): Make virtual. 2002-07-31 00:26:36 +00:00
Christopher Faylor 5ba08a9238 * fhandler_disk_file.cc (fhandler_cygdrive::set_drives): Incorporate . and ..
processing here.
(fhandler_cygdrive::readdir): Assume .  and ..  are already in pdrive.
(fhandler_cygdrive::seekdir): Ditto.
2002-07-30 14:17:17 +00:00
Christopher Faylor 4f9cdc9378 fix typo 2002-07-30 04:14:49 +00:00
Christopher Faylor c6ed5790b4 * dcrt0.cc (dll_crt0_1): Move debug_fixup_after_fork_exec.
* cygheap.cc (cygheap_fixup_in_child): Call debug_fixup_after_fork_exec
immediately after cygheap has ben set up.
2002-07-30 01:31:51 +00:00
Corinna Vinschen 5519d54352 * security.cc: Change some formatting.
* include/cygwin/version.h: Bump API minor version.

        * cygheap.h (class cygheap_user): Add member groups.
        * security.h (class cygsidlist): Add members type and maxcount,
        methods position, addfromgr, alloc_sids and free_sids and
        operator+= (const PSID psid). Modify contains () to call
        position () and optimize add () to use maxcount.
        (class user_groups): Create.
        Update declarations of verify_token and create_token.
        * security.cc (cygsidlist::alloc_sids): New.
        (cygsidlist::free_sids): New.
        (get_token_group_sidlist): Create from get_group_sidlist.
        (get_initgroups_sidlist): Create from get_group_sidlist.
        (get_group_sidlist): Suppress.
        (get_setgroups_sidlist): Create.
        (verify_token): Modify arguments. Add setgroups case.
        (create_token): Modify arguments. Call get_initgroups_sidlist and
        get_setgroups_sidlist as needed. Set SE_GROUP_LOGON_ID from auth_pos
        outside of the loop. Rename the various group sid lists consistently.
        * syscalls.cc (seteuid32): Modify to use cygheap->user.groups.
        (setegid32): Call cygheap->user.groups.update_pgrp.
        * grp.cc (setgroups): Create.
        (setgroups32): Create.
        * uinfo.cc (internal_getlogin): Initialize and update user.groups.pgsid.
        * cygwin.din: Add setgroups and setgroups32.
2002-07-29 12:51:52 +00:00
Christopher Faylor eb5720f255 * fhandler_console.cc (fhandler_console::read): Use appropriate kill_pgrp
method.
* select.cc (peek_console): Ditto.
* fhandler_termios.cc (fhandler_termios::bg_check): Send "stopped" signal to
entire process group as dictated by SUSv3.
* termios.cc (tcsetattr): Detect when stopped signal sent and force a stop
before setting anything.
2002-07-29 03:18:41 +00:00
Christopher Faylor 667f875d17 * include/cygwin/version.h: Bump API version to indicate that ntsec is on by
default now.
2002-07-27 01:52:05 +00:00
Christopher Faylor 6b3c247d07 * fhandler_registry.cc (fhandler_registry::close): Return any error result to
the caller.
* syscalls.cc (_close): Return result of fhandler::close to the caller.
2002-07-26 19:58:00 +00:00
Christopher Faylor 68fb3cca64 * security.cc (allow_ntsec): Default to on.
(allow_smbntsec): Default to off.
2002-07-25 17:04:13 +00:00
Christopher Faylor be18721ec4 * times.cc (to_time_t): Always round time_t down to nearest second. 2002-07-25 15:59:49 +00:00
Egor Duda b9e8058df3 * Makefile.in: Check if API version is updated when exports are
changed and stop if not so.
2002-07-25 09:09:34 +00:00
Corinna Vinschen bf47141f36 * include/cygwin/version.h: Bump minor API version. 2002-07-24 11:06:46 +00:00
Corinna Vinschen 0a73fce00c * fhandler_serial.cc: Change 'must_init_serial_line capability'
to 'supports_reading_modem_output_lines' throughout (negated meaning).
	* wincap.cc: Ditto.
	* wincap.h: Ditto.
2002-07-24 11:01:37 +00:00
Corinna Vinschen f72a851fc7 * cygwin.din (fcloseall): Add symbol for export.
(fcloseall_r): Ditto.
2002-07-24 07:38:03 +00:00
Christopher Faylor 99138976d9 * path.cc (path_conv::check): Always set fileattr when component == 0.
(readlink): Use path_conv method rather than field.
* fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Ditto, throughout.
* path.h (path_conv): Make fileattr private.
* exceptions.cc (try_to_debug): Default to idle priority when looping.
2002-07-24 05:37:47 +00:00
Corinna Vinschen 010bb8a4a1 * fhandler_serial.cc: Use must_init_serial_line capability throughout.
* wincap.cc: Set flag must_init_serial_line appropriately.
	* wincap.h: Add flag must_init_serial_line.
2002-07-23 14:47:17 +00:00
Corinna Vinschen fdb93cd2e1 * security.cc (get_group_sidlist): Create group list from /etc files
even if DC is available but access fails.
2002-07-23 14:34:27 +00:00
Christopher Faylor 08e2551c20 * fhandler_serial.cc: Fix formatting problems introduced by below changes. 2002-07-22 14:30:30 +00:00
Corinna Vinschen 780c42b43a * fhandler.h (class fhandler_serial): Add new members of
the class - rts,dtr and method ioctl(). Variables rts and dtr
	important for Win 9x only.
	* fhandler_serial.cc (fhandler_serial::open): Add initial setting
	of dtr and rts. Important for Win 9x only.
	(fhandler_serial::ioctl): New function. Implements commands TIOCMGET,
	TIOCMSET and TIOCINQ.
	(fhandler_serial::tcflush): Fixed found error.
	(fhandler_serial::tcsetattr): Add settings of rts and dtr. Important
	for Win 9x only.
	* termios.h: Add new defines as a support for ioctl() function
	on serial device.
2002-07-22 09:11:45 +00:00
Christopher Faylor 5ec1dcc5bf * autoload.cc (LoadDLLprime): Add jmp call to allow streamlining of later jmp
rewrite.
(doit): Avoid use of cx register.  Just change one word to avoid races.
2002-07-20 04:59:15 +00:00
Christopher Faylor 44480f46ea white space 2002-07-19 23:48:17 +00:00
Corinna Vinschen 095a1272e8 * security.cc (get_unix_group_sidlist): Create.
(get_supplementary_group_sidlist): Evolve into get_unix_group_sidlist.
	(get_user_local_groups): Add check for duplicates.
	(get_user_primary_group): Suppress.
	(get_group_sidlist): Silently ignore PDC unavailability.
	Call get_unix_group_sidlist() before get_user_local_groups().
	Remove call to get_supplementary_group_sidlist(). Never call
	get_user_primary_group() as the passwd group is always included.
	Add well_known_authenticated_users_sid in only one statement.
2002-07-19 15:04:18 +00:00
Christopher Faylor 86620e8f92 * fhandler_serial.cc (fhandler_serial::tcflush): Fix typo. 2002-07-19 14:17:11 +00:00
Corinna Vinschen 315fb3afb0 * security.cc (get_group_sidlist): Fix formatting. 2002-07-15 09:06:44 +00:00
Christopher Faylor 56a42791a3 * dcrt0.cc (initial_env): Force path and CYGWIN_DEBUG contents to lower case.
* exceptions.cc (error_start_init): Use the name derived from GetModuleName
rather than myself->progname.
2002-07-15 03:48:52 +00:00
Christopher Faylor 3d0ba393df * dcrt0.cc (dll_crt0_1): Move debug_init call back to here. Avoid a compiler
warning.
* shared.cc (memory_init): Remove debug_init call.
* debug.h (handle_list): Change "clexec" to "inherited".
* debug.cc: Remove a spurious declaration.
(setclexec): Conditionalize away since it is currently unused.
(add_handle): Use inherited field rather than clexec.
(debug_fixup_after_fork_exec): Ditto.  Move debugging output to delete_handle.
(delete_handle): Add debugging output.
* fhandler.cc (fhandler_base::set_inheritance): Don't bother setting
inheritance in debugging table since the handle was never protected anyway.
(fhandler_base::fork_fixup): Ditto.
* exceptions.cc (debugger_command): Revert.
2002-07-14 19:15:32 +00:00
Christopher Faylor f5c3d18080 * debug.cc (clexec): Add missing `hl = hl->next'. 2002-07-14 16:16:33 +00:00
Christopher Faylor e8a6396f88 * Makefile.in (cygrun.exe): Add a -lcygwin on the end. 2002-07-14 04:14:32 +00:00
Christopher Faylor fea4c29fda * Makefile.in (cygserver.exe): Add -lstdc++.
(cygrun.exe): Move -lgcc last.
2002-07-14 04:03:01 +00:00
Christopher Faylor 613219252e add initial information 2002-07-13 21:15:10 +00:00
Christopher Faylor 6cb6ef7315 cleanup a tad 2002-07-13 21:13:37 +00:00
Christopher Faylor c03dba93d6 * dcrt0.cc (dll_crt0_1): Delay closing of some handles until cygheap has been
set up.
(break_here): New function, for debugging.
(initial_env): Add program name to "Sleeping" message.  Implement new
"CYGWIN_DEBUG" environment variable option.
* exceptions.cc (debugger_command): Add argument to dumper call.
* strace.cc (strace::hello): Use winpid if cygwin pid is unavailable.
(strace::vsprntf): Ditto.
2002-07-13 21:08:13 +00:00
Christopher Faylor 0301bfd0ac * debug.h (handle_list): Move here from debug.cc. Add "inherit" flag
functionality.
* cygheap.cc (init_cheap): Move cygheap_max calculation to _csbrk.
(_csbrk): Reorganize to not assume first allocation is <= 1 page.
(cygheap_setup_for_child): Mark protected handle as inheritable.
* cygheap.h (cygheap_debug): New struct.
(init_cygheap): Add new structure when debugging.
* dcrt0.cc (dll_crt0_1): Remove call to debug_init.  Close ppid_handle here, if
appropriate.  Don't protect subproc_ready, since it is already protected in the
parent.  Call memory_init prior to ProtectHandle to ensure that cygheap is set
up.  Call debug_fixup_after_fork_exec when appropriate.
(_dll_crt0): Don't close ppid_handle here.
* debug.cc: Use cygheap debug structure rather than static elements throughout.
(add_handle): Don't issue a warning if attempt to protect handle in exactly the
same way from exactly the same place.  Add pid info to warning output.  Accept
additional argument controlling whether handle is to be inherited.  Add pid to
stored information.
(debug_fixup_after_fork_exec): Renamed from debug_fixup_after_fork.  Reorganize
to avoid erroneously skipping handles.
(mark_closed): Add pid info to warning output.
(setclexec): Rename from setclexec_pid.
* fhandler.cc (fhandler_base::get_default_fmode): Minor reorg.
(fhandler_base::fstat): Add debugging output.
(fhandler_base::set_inheritance): Call setclexec rather than setclexec_pid.
(fhandler_base::fork_fixup): Ditto.
* fhandler_console.cc (get_tty_stuff): Mark protected handle as inheritable.
* fhandler_tty.cc (fhandler_tty_slave::open): Ditto.
* tty.cc (tty::make_pipes): Ditto.
(tty::common_init): Ditto.
* fork.cc (fork_parent): Ditto.
(fork_child): Close protected handles with correct name.  Remove
debug_fixup_after_fork call.
* fhandler_socket.cc (fhandler_socket::create_secret_event): Mark protected
handle as inheritable/non-inheritable, as appropriate.
* shared.cc (memory_init): Mark protected handle as inheritable.  Call
debug_init here.
* sigproc.cc (wait_sig): Close protected handle with correct name.
* spawn.cc (spawn_guts): Rename spr to subproc_ready and mark it as
inheritable.
* exceptions.cc (debugger_command): Try to run dumper.exe, if found.
* syscalls.cc (fstat64): Don't follow symlinks for path_conv lookup since path
is already resolved.
2002-07-13 20:00:27 +00:00