summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin
Commit message (Collapse)AuthorAgeFilesLines
* * debug.cc (clexec): Add missing `hl = hl->next'.Christopher Faylor2002-07-142-0/+5
|
* * Makefile.in (cygrun.exe): Add a -lcygwin on the end.Christopher Faylor2002-07-142-1/+5
|
* * Makefile.in (cygserver.exe): Add -lstdc++.Christopher Faylor2002-07-142-2/+7
| | | | (cygrun.exe): Move -lgcc last.
* add initial informationChristopher Faylor2002-07-131-1/+3
|
* cleanup a tadChristopher Faylor2002-07-131-8/+18
|
* * dcrt0.cc (dll_crt0_1): Delay closing of some handles until cygheap has beenChristopher Faylor2002-07-135-9/+66
| | | | | | | | | | 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.
* * debug.h (handle_list): Move here from debug.cc. Add "inherit" flagChristopher Faylor2002-07-1318-111/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* fyx tipo.Christopher Faylor2002-07-121-1/+1
|
* * cygwin.in: Change erroneous entries.Christopher Faylor2002-07-122-2/+5
|
* * fhandler_disk_file.cc (fhandler_disk_file::open): Don'tCorinna Vinschen2002-07-112-3/+6
| | | | | move the file pointer to the end of file if O_APPEND is specified in the open flags.
* * debug.cc: Avoid explicit zeroing of globals.Christopher Faylor2002-07-093-10/+39
| | | | | | | | (lock_debug): Make locker a static member. Avoid unlocking when already unlocked (from Conrad Scott). (debug_init): Initialize lock_debug::locker here. * fork.cc (fork_child): Fix up fdtab earlier to avoid some (but not all) confusion with close-on-exec craziness.
* Add missing entry from 2002-06-25Christopher Faylor2002-07-071-0/+43
|
* * fhandler.h (fhandler_socket::is_unconnected): Constify.Corinna Vinschen2002-07-065-20/+55
| | | | | | | | | | | | | | | | | | | (fhandler_socket::is_connect_pending): Ditto. (fhandler_socket::is_connected): Ditto. (fhandler_socket::set_connect_state): New method. (struct select_record): Add member `except_on_write'. (select_record::select_record): Initialize all bool values to `false'. * fhandler_socket.cc: Use set_connect_state() method throughout. (fhandler_socket::connect): Set state always to connected if connection isn't pending. * net.cc (cygwin_getsockopt): Revert erroneous previous patch. * select.cc (set_bits): Check for `except_on_write'. Set fd in write_fds if set. Set connect state to connected if fd has been returned by WINSOCK_SELECT. (peek_socket): Check for `except_on_write'. (start_thread_socket): Ditto. (fhandler_socket::select_write): Don't set `write_ready' if connect is pending. Set `except_on_write' if connect is pending.
* add missing entryChristopher Faylor2002-07-051-0/+3
|
* * ntdll.h (_SYSTEM_PROCESSOR_TIMES): Force eight byte alignment.Christopher Faylor2002-07-053-36/+43
| | | | (_SYSTEM_TIME_OF_DAY_INFORMATION): Ditto.
* * fhandler.h (UNCONNECTED): New define.Corinna Vinschen2002-07-055-20/+64
| | | | | | | | | | | | | | | | | | | | | (CONNECT_PENDING): Ditto. (CONNECTED): Ditto. (class fhandler_socket): Add member `had_connect_or_listen'. Add member functions `is_unconnected', `is_connect_pending' and `is_connected'. * fhandler_socket.cc (fhandler_socket::connect): Set member `had_connect_or_listen' according to return code of WinSock call. (fhandler_socket::listen): Ditto. * net.cc (cygwin_getsockopt): Modify SO_ERROR return value in case of socket with pending connect(). * select.cc (peek_socket): Only add socket to matching fd_set if it's not "ready". Call WINSOCK_SELECT only if at least one socket is in one of the fd_sets. (start_thread_socket): Only add socket to matching fd_set if it's not "ready". (fhandler_socket::select_write): Set write_ready to true also if socket isn't connected or listening.
* * fhandler_socket.cc (fhandler_socket::set_sun_path): Don't freeCorinna Vinschen2002-07-042-3/+6
| | | | memory here. Allow NULL parameter.
* * fhandler_socket.cc (fhandler_socket::dup): Add missing copy operationCorinna Vinschen2002-07-042-0/+7
| | | | on sun_path.
* 2002-06-25 Thomas Pfaff <tpfaff@gmx.net>Robert Collins2002-07-044-281/+342
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * include/pthread.h (PTHREAD_CANCELED): Defined a reasonable value. * pthread.cc (pthread_exit): Call method instead of function. (pthread_setcancelstate): Ditto. (pthread_setcanceltype): Ditto. (pthread_testcancel): Ditto. * thread.h (pthread::cancel_event): New member. (__pthread_cancel_self): New prototype. (pthread::exit): New Method. (pthread::cancel): Ditto. (pthread::testcancel): Ditto. (pthread::cancel_self): Ditto. (pthread::static_cancel_self): Ditto. (pthread::setcancelstate): Ditto. (pthread::setcanceltype): Ditto. (__pthread_cancel): Give c++ linkage. (__pthread_exit): Remove. (__pthread_setcancelstate): Ditto. (__pthread_setcanceltype): Ditto. (__pthread_testcancel): Ditto. * thread.cc (pthread::pthread): Inititialize cancel_event. (pthread::~pthread): Close cancel_event if needed. (pthread::create): Create cancel_event. (pthread::exit): New method. Replacement for __pthread_exit. (pthread::cancel): New method. (pthread::testcancel): Ditto. (pthread::static_cancel_self); New static method. (pthread::setcancelstate): New method. Replacement for __pthread_setcancelstate. (pthread::setcanceltype): New method. Replacement for __pthread_setcanceltype. (pthread::pop_cleanup_handler): Added lock for async cancel safe cancellation. (pthread::thread_init_wrapper): Change __pthread_exit to thread->exit(). (__pthread_cancel): Call method thread->cancel(). (__pthread_exit): Remove. (__pthread_setcancelstate): Ditto. (__pthread_setcanceltype): Ditto. (__pthread_testcancel): Ditto.
* * include/cygwin/version.h: Bump DLL minor number.Christopher Faylor2002-07-032-1/+5
|
* * include/sys/statfs.h: New header file.Christopher Faylor2002-07-032-0/+15
|
* * dtable.cc (cygwin_attach_handle_to_fd): Default to implicit bin mode if noneChristopher Faylor2002-07-034-2/+12
| | | | | | | | specified. * fhandler.cc (fhandler_base::init): Make bin argument a guarantee rather than a suggestion. * path.cc (path_conv::check): Load flag returned from cygwin_conv_to_win32_path into path_flags.
* * tty.cc (tty::common_init): Reverse logic of cygserver check inConrad Scott2002-07-032-1/+6
| | | | call to SetKernelObjectSecurity.
* * autoload.cc (WSAEventSelect): Define new autoload function.Corinna Vinschen2002-07-033-16/+83
| | | | | | (WSAEnumNetworkEvents): Ditto. * fhandler_socket.cc (fhandler_socket::accept): If socket is in blocking mode wait for incoming connection and signal.
* * cygheap.cc (init_cheap): Rearrange error message.Christopher Faylor2002-07-037-44/+28
| | | | | | | | (cygheap_fixup_in_child): Ditto. * dtable.cc: Remove if 0'ed code. * fhandler_dsp.cc (fhandler_dev_dsp::open): Force binmode. * sec_helper.cc (cygsid::get_id): Use system_printf for error message. * tty.cc (tty::common_init): Ditto.
* * net.cc (cygwin_getpeername): Defend against NULL pointer dereference.Christopher Faylor2002-07-022-1/+5
|
* * include/cygwin/version.h: Bump API minor version.Corinna Vinschen2002-07-022-1/+6
|
* * security.cc (get_logon_server): Interpret a zero lengthCorinna Vinschen2002-07-022-3/+15
| | | | | | | | domain as the local domain. (get_group_sidlist): Add authenticated users SID to SYSTEM's group list instead of SYSTEM itself. (verify_token): Accept the primary group sid if it equals the token user sid.
* * cygwin.din (__fpclassifyd): Add symbol.Corinna Vinschen2002-07-022-0/+11
| | | | | | (__fpclassifyf): Ditto. (__signbitd): Ditto. (__signbitf): Ditto.
* * security.h (DONT_INHERIT): Eliminate definition.Corinna Vinschen2002-07-024-11/+19
| | | | | | | | (INHERIT_ALL): Ditto. (INHERIT_ONLY): Ditto. * sec_acl.cc: Use appropriate defines from accctrl.h instead of the above throughout. * security.cc: Ditto.
* * syscalls.c (seteuid32): Return immediately if the program is not impersonatedChristopher Faylor2002-07-022-11/+16
| | | | | and both uid and gid are original. (setegid32): Return immediately if the new gid is the current egid.
* * syscalls.cc (seteuid32): Fix incorrect placement of Pierre's patch below.Christopher Faylor2002-07-022-5/+10
|
* * syscalls.cc (seteuid32): Fix incorrect use of system_printf.Christopher Faylor2002-07-022-1/+5
|
* * autoload.cc (GetSecurityInfo): Define new autoload function.Christopher Faylor2002-07-029-152/+507
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (RegQueryInfoKeyA): Ditto. * fhandler.h (fhandler_virtual::fill_filebuf): Change return type to bool. (fhandler_proc::fill_filebuf): Ditto. (fhandler_registry::fill_filebuf): Ditto. (fhandler_process::fill_filebuf): Ditto. (fhandler_registry::value_name): Add new member. (fhandler_registry::close): Add new method. (fhandler_process::p): Remove member. * fhandler_proc.cc (fhandler_proc::open): Add set_nohandle after calling superclass method. Check return value of fill_filebuf. (fhandler_proc::fill_filebuf): Change return type to bool. Add return statement. * fhandler_process.cc (fhandler_process::open): Add set_nohandle after calling superclass method. Remove references to p. Check return value of fill_filebuf. (fhandler_process::fill_filebuf): Change return type to bool. Don't use dereference operator on p. Add return statement. (fhandler_process::format_process_stat): Fix typo. * fhandler_registry.cc: Add static open_key declaration. (fhandler_registry::exists): Assume path is already normalised. Try opening the path as a key in its own right first, before reverting to enumerating subkeys and values of the parent key. (fhandler_registry::fstat): Add additional code to return more relevant information about the registry key/value. (fhandler_registry::readdir): Explicitly set desired access when opening registry key. Remove output of buf from debug_printf format string. (fhandler_registry::open): Use set_io_handle to store registry key handle. Set value_name member. Move code to read a value from the registry to fill_filebuf. Add call to fill_filebuf. (fhandler_registry::close): New method. (fhandler_registry::fill_filebuf): Change return type to bool. Add code to read a value from registry. (fhandler_registry::open_key): Make function static. Use KEY_READ as desired access unless this is the last path component. Check the return value of RegOpenKeyEx for an error instead of hKey. * fhandler_virtual.cc (fhandler_virtual::lseek): Check the return value of fill_filebuf. (fhandler_virtual::open): Remove call to set_nohandle. (fhandler_virtual::fill_filebuf): Change return type to bool. Add return statement. * security.cc (get_nt_object_attribute): New function. (get_object_attribute): New function. * security.h (get_object_attribute): New function declaration.
* * syscalls.c (seteuid32): Do not return an error when the token cannot beChristopher Faylor2002-07-014-3/+14
| | | | created only because of a problem with the gid.
* * fhandler_clipboard.c (fhandler_dev_clipboard::open): Force text mode.Christopher Faylor2002-07-0114-14/+39
| | | | | | | | | | | | | | | | * fhandler_console.cc (fhandler_console::open): *Really* force binary mode rather than make it optional. * fhandler_proc.cc (fhandler_proc::open): Ditto. * fhandler_process.cc (fhandler_process::open): Ditto. * fhandler_random.cc (fhandler_dev_random::fhandler_dev_random): Ditto. * fhandler_raw.cc (fhandler_dev_raw::open): Ditto. * fhandler_registry.cc (fhandler_registry::open): Ditto. * fhandler_tty.cc (fhandler_tty_slave::open): Ditto. * fhandler_virtual.cc (fhandler_virtual::open): Ditto. * fhandler_windows.cc (fhandler_windows::open): Ditto. * fhandler_zero.cc (fhandler_dev_zero::open): Ditto. * net.cc (fdsock): Ditto. * path.cc (set_flags): Add more debugging.
* * debug.cc (threads): Avoid initialization.Christopher Faylor2002-07-013-3/+8
| | | | | * uinfo.cc (cygheap_user::ontherange): (from Corinna Vinschen) Actually make below changes work.
* * uinfo.cc (cygheap_user::ontherange): Make cygwin root the last resort forChristopher Faylor2002-07-012-4/+7
| | | | HOMEPATH/HOMEDRIVE for consistency with HOME.
* * shared.cc (sec_none): Move to sec_helper.cc.Corinna Vinschen2002-07-013-96/+113
| | | | | | | | | | | | | | | | (sec_none_nih): Ditto. (sec_all): Ditto. (sec_all_nih): Ditto. (get_null_sd): Ditto. (sec_acl): Ditto. (__sec_user): Ditto. * sec_helper.cc (sec_none): Move from shared.cc to here. (sec_none_nih): Ditto. (sec_all): Ditto. (sec_all_nih): Ditto. (get_null_sd): Ditto. (sec_acl): Ditto. (__sec_user): Ditto.
* * uinfo.cc (cygheap_user::ontherange): Potentially set HOME from existingChristopher Faylor2002-07-012-10/+21
| | | | | | homepath and homedrive cygheap_user fields (not currently used yet). Set HOME to / if no other alternative. (cygheap_user::test_uid): Simplify.
* white spaceChristopher Faylor2002-07-012-2/+2
|
* * environ.cc (parse_options): Use setenv to potentially replace CYGWIN value onChristopher Faylor2002-07-012-14/+40
| | | | | | | | export. Fixes broken behavior since November 2000 changes. (regopt): Return indication of whether or not something has been parsed from the registry. (environ_init): Only attempt to export CYGWIN variable when values were set from the registry. It is exported automatically otherwise.
* * fhandler.h (fhandler_process::pid): New field.Christopher Faylor2002-06-303-7/+26
| | | | | | (fhandler_process::fstat): Remove unneeded array. Set pid element. (fhandler_process::open): Ditto. (fhandler_process::fill_filebuf): Handle case where 'p' field is NULL.
* * fhandler.h (fhandler_process::p): New field.Christopher Faylor2002-06-303-17/+29
| | | | | | | (fhandler_process:fill_filebuf): Revert to same definition as virtual in parent class. (fhandler_process::open): Fill out p field rather than passing as an argument. (fhandler_process::fill_filebuf): Use p pointer rather than argument.
* * security.cc (extract_nt_dom_user): Check for all buffer overflows.Corinna Vinschen2002-06-302-41/+31
| | | | | | Call LookupAccountSid after trying to get domain & user from passwd. (get_group_sidlist): Obtain the domain and user by calling extract_nt_dom_user instead of LookupAccountSid.
* * uinfo.cc (cygheap_user::test_uid): Use standard issetuid test.Christopher Faylor2002-06-292-1/+5
|
* * autoload.cc (NetGetDCName): Change to make this an optional load function.Christopher Faylor2002-06-294-7/+23
| | | | | | | | * cygheap.h (cygheap_user::logsrv): Return NULL when operation fails. (cygheap_user::winname): Ditto. (cygheap_user::domain): Ditto. * uinfo.cc (cygheap_user::env_logsrv): Save results in temp variable. (cygheap_user::env_userprofile): Ditto.
* * environ.cc (spenv::retrieve): Detect return of env_dontadd from cygheap_userChristopher Faylor2002-06-292-5/+13
| | | | | | | methods. (build_env): Avoid incrementing environment pointer if not actually adding to the environment. That could result in garbage in the environment table. Be more defensive when reallocing envblock.
* * uinfo.cc (cygheap_user::test_uid): Return NULL or further tests are sortaChristopher Faylor2002-06-292-2/+8
| | | | | useless. (cygheap_user::env_domain): Recalculate if name is missing.
* * environ.cc (spenv::from_cygheap): Still need to take setuid intoChristopher Faylor2002-06-292-2/+7
| | | | consideration.