summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin
Commit message (Collapse)AuthorAgeFilesLines
* 2002-12-10 Pierre Humblet <pierre.humblet@ieee.org>Corinna Vinschen2002-12-1010-195/+258
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * pwdgrp.h (pwdgrp_check::pwdgrp_state): Replace by pwdgrp_check::isinitializing (). (pwdgrp_check::isinitializing): Create. * passwd.cc (grab_int): Change type to unsigned, use strtoul and set the pointer content to 0 if the field is invalid. (parse_pwd): Move validity test after getting pw_gid. (read_etc_passwd): Replace "passwd_state <= " by passwd_state::isinitializing (). (internal_getpwuid): Ditto. (internal_getpwnam): Ditto. (getpwent): Ditto. (getpass): Ditto. * grp.cc (parse_grp): Use strtoul for gr_gid and verify the validity. (read_etc_group): Replace "group_state <= " by group_state::isinitializing (). (internal_getgrgid): Ditto. (getgrent32): Ditto. (internal_getgrent): Ditto. 2002-12-10 Pierre Humblet <pierre.humblet@ieee.org> * security.h: Move declarations of internal_getgrent, internal_getpwsid and internal_getgrsid to pwdgrp.h. * pwdgrp.h: Declare internal_getpwsid, internal_getpwnam, internal_getpwuid, internal_getgrsid, internal_getgrgid, internal_getgrnam, internal_getgrent and internal_getgroups. Delete "emulated" from enum pwdgrp_state. (pwdgrp_check::isuninitialized): Create. (pwdgrp_check::pwdgrp_state): Change state to initializing rather than to uninitialized. (pwdgrp_read::gets): Remove trailing CRs. * passwd.cc (grab_string): Don't look for NLs. (grab_int): Ditto. (parse_pwd): Don't look for CRs. Return 0 if entry is too short. (search_for): Delete. (read_etc_passwd): Simplify tests to actually read the file. Set state to loaded before making internal_getpwXX calls. Replace search_for calls by equivalent internal_pwgetXX calls. (internal_getpwsid): Use passwd_state.isuninitialized to decide to call read_etc_passwd. (internal_getpwuid): Create. (internal_getpwnam): Create. (getpwuid32): Simply call internal_getpwuid. (getpwuid_r32): Call internal_getpwuid. (getpwnam): Simply call internal_getpwnam. (getpwnam_r): Call internal_getpwnam. * grp.cc (parse_grp): Don't look for CRs. Adjust blank space. (add_grp_line): Adjust blank space. (class group_lock): Ditto. (read_etc_group): Simplify tests to actually read the file. Set state to loaded before making internal_getgrXX calls. Replace getgrXX calls by equivalent internal calls. (internal_getgrsid): Use group_state.isuninitialized to decide to call read_etc_group. (internal_getgrgid): Create. (internal_getgrnam): Create. (getgroups32): Simply call internal_getgrgid. (getgrnam32): Simply call internal_getgrnam. (internal_getgrent): Call group_state.isuninitialized. (internal_getgroups): Create from the former getgroups32, using two of the four arguments. Set gid to myself->gid and username to cygheap->user.name (). (getgroups32): Simply call internal_getgroup. (getgroups): Call internal_getgroup instead of getgroups32. (setgroups32): Call internal versions of get{pw,gr}XX. * sec_helper.cc: Include pwdgrp.h. (is_grp_member): Call internal versions of get{pw,gr}XX. * security.cc: Include pwdgrp.h. (alloc_sd): Call internal versions of get{pw,gr}XX. * syscalls.cc: Include pwdgrp.h. (seteuid32): Call internal versions of get{pw,gr}XX. (setegid32): Ditto. * uinfo.cc: Include pwdgrp.h. (internal_getlogin): Call internal versions of get{pw,gr}XX. (cygheap_user::ontherange): Ditto. * sec_acl.cc: Include pwdgrp.h. (setacl): Call internal versions of get{pw,gr}XX. (acl_access): Ditto and simplify logic. (aclfromtext): Ditto.
* correct dateChristopher Faylor2002-12-091-1/+1
|
* * lib/pseudo-reloc.c: New file.Christopher Faylor2002-12-094-0/+101
| | | | | * lib/_cygwin_crt0_common.cc: Perform pseudo-relocs during initialization of cygwin binary (.exe or .dll).
* fix dateChristopher Faylor2002-12-071-1/+1
|
* * cygwin.din: Reflect name change from strtodf to strtof. Export strtof.Christopher Faylor2002-12-063-3/+11
| | | | * include/cygwin/version.h: Bump API minor number.
* * fhandler.h (fhandler_termios::line_edit): Change return from an int to anChristopher Faylor2002-12-055-12/+40
| | | | | | | | | | | enum to allow the function to return an error. * fhandler_console.cc (fhandler_console::read): Update the line_edit call to use the new enum. * fhandler_termios.cc (fhandler_termios::line_edit): Change return from an int to an enum to allow the function to return an error. Put put_readahead call before doecho for future patch. * fhandler_tty.cc (fhandler_pty_master::write): Change to call line_edit one character at a time, and stop if an error occurs.
* fix commentChristopher Faylor2002-12-041-2/+2
|
* * netdb.cc: New file.Christopher Faylor2002-12-045-11/+455
| | | | | | * Makeile.in (DLL_OFILES): Add reference to the new netdb.cc file. * cygwin.din : Add new aliased exports for service and protocol enumerations in netdb.cc.
* * cxx.cc: New file. Implement new, new[], delete and delete[]Corinna Vinschen2002-12-043-2/+58
| | | | | | operators and __cxa_pure_virtual if compiled by gcc >=3. * Makefile.in (DLL_OFILES): Add cxx.o. Remove libstdc++.a from cygwin1.dll link step.
* * fhandler_tty.cc (fhandler_pty_master::accept_input): Move read_retvalChristopher Faylor2002-11-302-4/+15
| | | | | assignment to prevent race condition. Remove read_retval from return statement.
* * pinfo.h (winpids::set): Renamed from init.Christopher Faylor2002-11-296-5/+32
| | | | | | | | | | | (winpids::init): New declaration. (winpids::cs): Ditto. (winpids::winpids): Use set rather than init. * external.cc (fillout_pinfo): Ditto. * dcrt0.cc (dll_crt0_1): Call winpids::init. * pinfo.cc (winpids::set): Renamed from init. Wrap calls in critical section. (winpids::init): New function. (winpids::cs): Define.
* * sigproc.cc (sig_dispatch_pending): Remove assertion.Christopher Faylor2002-11-292-1/+4
|
* revert botched checkinChristopher Faylor2002-11-281-6/+6
|
* * include/cygwin/version.h: Bump DLL minor number.Christopher Faylor2002-11-283-7/+11
|
* * fhandler_socket.cc (fhandler_socket::sendto): Fix potential unitialized valueChristopher Faylor2002-11-272-3/+8
| | | | return.
* * cygwin.din: Export pthread_getsequence_np.Christopher Faylor2002-11-273-1/+8
| | | | * include/cygwin/version.h: Bump API minor version.
* white spaceChristopher Faylor2002-11-271-1/+1
|
* * cygwin.din: Export nl_langinfo().Christopher Faylor2002-11-273-1/+9
| | | | * include/cygwin/version.h: Bump API minor version.
* * fhandler_tty.cc (fhandler_pty_master::accept_input): Just use a normal SleepChristopher Faylor2002-11-263-4/+10
| | | | | or suffer amazing pauses when other tty apps are running. (fhandler_pty_master::process_slave_output): Ditto.
* * passwd.cc (read_etc_passwd): Never add an entry when startingCorinna Vinschen2002-11-253-4/+14
| | | | | | on Win95/98/ME if a default entry is present. * uinfo.cc (internal_getlogin): Look for the default uid if needed. Always call user.set_name ().
* * sec_acl.cc (getacl): Set errno to ENOSPC if command is GETACL andCorinna Vinschen2002-11-252-1/+9
| | | | nentries is less than the number of entries in the file's ACL.
* 2002-11-24 Corinna Vinschen <corinna@vinschen.de>Corinna Vinschen2002-11-242-142/+153
| | | | | | | | | | | | | | | | | | | | | | * sec_acl.cc: Fix some formatting. Only set and check `other' bits in a_perm throughout. Use ILLEGAL_GID id for all entries having no id. (setacl): Fix inheritance condition. (getacl): Set all permission bits in CLASS_OBJ and DEF_CLASS_OBJ entries. Remove DENY bits before returning to calling function. (acltomode): Fix usage of searchace(). If available, use CLASS_OBJ to mask GROUP_OBJ permissions. (aclfrommode): Fix usage of searchace(). If available, set CLASS_OBJ permissions to same value as GROUP_OBJ permissions. 2002-11-24 Pierre Humblet <pierre.humblet@ieee.org> * sec_acl.cc (getace): Fix the behavior when allow and deny entries are present in arbitrary order. (getacl): Report the actual number of entries when aclbufp is NULL, even if nentries is zero. Fix the mask reporting, handle the case where the owner and group sids are equal and streamline the code. (acl_worker): Take allow_ntsec into account.
* 2002-11-05 Thomas Pfaff <tpfaff@gmx.net>Robert Collins2002-11-245-78/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dcrt0.cc (dll_crt0_1): Add call to pthread::initMainThread to initialize mainthread when it is safe to call new. * init.cc (dll_entry): Change call to store reents in tls key. * thread.cc (_reent_clib) : Change call to get reents from tls key. (_reent_winsup): Ditto. (MTinterface::Init): Key handling changed. Remove initialization of member variables. (MTinterface::fixup_after_fork): Reinitialize mainthread object after fork. Reset threadount to 1. (pthread::initMainThread): Create mainthread object dynamically. and initialize with valid handles. (pthread::self): Remove calls to create thread objects. (pthread::setTlsSelfPointer): Change call to store thread self handle in tls key. (pthread::getTlsSelfPointer): New static method. (pthread::exit): Remove setTlsSelfPointer call. (pthread::initCurrentThread): New method. (pthread::thread_init_wrapper): Change call to store thread self handle in tls key. (pthread::join): Check for a valid joiner. (pthreadNull::pthreadNull): Mark Null object as detached. (pthreadNull::exit): Terminate thread via ExitThread. * thread.h (pthread::initMainThread): Change parameter in function call. (pthread::getTlsSelfPointer): New static method. (pthread::initCurrentThread): New method. (MTinterface::reent_key): Remove. (MTinterface::thread_self_dwTlsIndex): Ditto.. (MTinterface::indexallocated): Ditto. (MTinterface::mainthread): Ditto. (MTinterface::reent_key): New member. (MTinterface::thread_self_key): Ditto. (MTinterface::MTinterface): Initialize all members.
* * wait.cc (wait4): Force pending signal delivery before waiting for processChristopher Faylor2002-11-232-0/+6
| | | | completion.
* * include/cygwin/version.h: Bump DLL minor number.Christopher Faylor2002-11-232-1/+5
|
* fix typoChristopher Faylor2002-11-231-1/+1
|
* * exceptions.cc (handle_sigsuspend): Force pending signal delivery beforeChristopher Faylor2002-11-227-2/+66
| | | | | | | | | | | | | | | | | | waiting for signals to happen. * signal.cc (sleep): Force pending signal delivery before sleeping. (usleep): Ditto. (signal): Force pending signal delivery before manipulating signal stuff. (sigprocmask): Ditto. (kill_worker): Ditto. (abort): Ditto. (sigaction): Ditto. * syscalls.cc (readv): Force pending signal delivery before I/O. (writev): Ditto. (open): Ditto. * net.cc: Ditto, throughout. * sigproc.cc (sig_dispatch_pending): Deliver any pending signals prior to returning. * tty.cc (tty::make_pipes): Increase pipe buffer size.
* * include/cygwin/version.h: Fix comment.Christopher Faylor2002-11-222-3/+7
|
* * external.cc (cygwin_internal): Fix va_arg references.Christopher Faylor2002-11-222-4/+7
|
* * exceptions.cc (sigthread::get_winapi_lock): Just do standard 'give upChristopher Faylor2002-11-227-61/+97
| | | | | | | | | | | | timeslice' wait. (setup_handler): Revamp YA to attempt to deliver signal multiple times on failure rather than punting to wait_sig. * miscfuncs.cc (low_priority_sleep): Accept INFINITE sleep to mean "don't reset the priority after setting it to idle". Return previous priority. * winsup.h (SLEEP_0_STAY_LOW): Define. (low_priority_sleep): Return an int. * sigproc.h: Define WAIT_SIG_PRIORITY here. * sigproc.cc: Remove WAIT_SIG_PRIORITY definition.
* * security.h: Declare internal_getpwsid and internal_getgrsid.Corinna Vinschen2002-11-206-234/+205
| | | | | | | | | | | | | | | | | | | | | | | | | | | Undeclare internal_getpwent. Define DEFAULT_UID_NT. Change DEFAULT_GID. * passwd.cc (internal_getpwsid): New function. (internal_getpwent): Suppress. (read_etc_passwd): Make static. Rewrite the code for the completion line. Set curr_lines to 0. (parse_pwd): Change type to static int. Return 0 for short lines. (add_pwd_line): Pay attention to the value of parse_pwd. (search_for): Do not look for nor return the DEFAULT_UID. * grp.cc (read_etc_group): Make static. Free gr_mem and set curr_lines to 0. Always call add_pwd_line. Rewrite the code for the completion line. (internal_getgrsid): New function. (parse_grp): If grp.gr_mem is empty, set it to &null_ptr. Never NULL gr_passwd. (getgrgid32): Only return the default if ntsec is off and the gid is ILLEGAL_GID. * sec_helper.cc (cygsid::get_id): Use getpwsid and getgrsid. (cygsid_getfrompw): Clean up last line. (cygsid_getfromgr): Ditto. (is_grp_member): Use getpwuid32 and getgrgid32. * uinfo.cc (internal_getlogin): Set DEFAULT_GID at start. Use getpwsid. Move the read of /etc/group after the second access to /etc/passwd. Change some debug_printf.
* * poll.cc (poll): ...but set POLLIN instead.Corinna Vinschen2002-11-202-1/+7
|
* * security.cc (get_attribute_from_acl): Always test "anti",Corinna Vinschen2002-11-203-96/+107
| | | | | | | | | | | | | | | | | | | just in case an access_denied ACE follows an access_allowed. Handle the case owner_sid == group_sid, with a FIXME. Remove unnecessary tests for non-NULL PSIDs. (alloc_sd): Use existing owner and group sids if {ug}id == -1. Handle case where owner_sid == group_sid. Do not call is_grp_member. Try to preserve canonical ACE order. Remove unnecessary tests for non-NULL PSIDs. Reorganize debug_printf's. (get_initgroups_sidlist): Put well_known_system_sid on left side of ==. (add_access_denied_ace): Only call GetAce if inherit != 0. (add_access_allowed_ace): Ditto. Use appropriate sizeof. * syscalls.cc (chown_worker): Pass {ug}id equal to -1 to alloc_sd, which removes the need to obtain old_{ug}id. (chmod): Remove call to get_file_attribute (), simply pass {ug}id equal to -1 to alloc_sd.
* * poll.cc (poll): Don't set POLLERR if a listening socket has aCorinna Vinschen2002-11-202-13/+37
| | | | | pending connect. Don't use errno value from call to fhandler_socket::recvfrom().
* * net.cc: Sprinkle sigframes throughout.Christopher Faylor2002-11-192-0/+14
|
* remove unneeded commentsChristopher Faylor2002-11-191-6/+0
|
* * tty.cc (tty::make_pipes): Make pipe buffer larger.Christopher Faylor2002-11-162-2/+6
|
* * grp.cc (getgroups32): Protect against closing cygheap->user.token.Christopher Faylor2002-11-162-1/+6
|
* * include/cygwin/version.h: Bump API_MINOR to accommodate below changes.Christopher Faylor2002-11-154-1/+27
| | | | | * cygwin.din (siginterrupt): New export. * signal.cc (siginterrupt): New.
* * select.cc (peek_serial): Don't call PurgeComm() to avoid characters loss.Christopher Faylor2002-11-152-6/+7
|
* * exceptions.cc (setup_handler): Add debugging output. Set thread priority toChristopher Faylor2002-11-155-9/+27
| | | | | | | | idle if pending signals to allow other threads to get into interruptible state. * miscfuncs.cc (sys_mbstowcs): Save current thread in variable to avoid an OS call. * wait.cc (wait_sig): Reset thread priority each time through loop since the priority may have been set down to deal with pending signals.
* * fhandler_serial.cc (fhandler_serial::tcgetattr): Don't take any specialChristopher Faylor2002-11-152-10/+8
| | | | action when vmin_ == 0.
* * grp.cc (getgroups32): Revert previous patch. Use impersonationCorinna Vinschen2002-11-143-17/+62
| | | | | | token if process is in impersonated state. * sec_helper.cc (is_grp_member): Rewrite. Call getgroups32 only for current user. Scan passwd and group info otherwise.
* checking previously ChangeLog'ed file.Christopher Faylor2002-11-141-1/+1
|
* * fhandler_console.cc (fhandler_console::write): Allow characters >= 0177 to beChristopher Faylor2002-11-141-0/+5
| | | | displayed in the title bar.
* * grp.cc (getgroups32): Don't use access token of current user whenCorinna Vinschen2002-11-142-0/+6
| | | | retrieving group info for another user.
* * dll_init.cc (dll_list::detach): Eliminate reliance on passed in dll address.Christopher Faylor2002-11-143-18/+34
| | | | | | Infer from module of caller instead. (cygwin_detach_dll): Ignore dll_index argument. * dll_init.h (dll_list::detach): Reflect argument change above.
* * ioctl.cc (ioctl): Always print ioctl results, even when it's a tty.Christopher Faylor2002-11-142-5/+20
| | | | * winsup.h (low_priority_sleep): Declare.
* * winsup.h (low_priority_sleep): Declare.Christopher Faylor2002-11-131-0/+1
|
* * miscfuncs.cc (low_priority_sleep): New function. Use throughout where codeChristopher Faylor2002-11-1313-26/+38
| | | | | | is supposed to be giving up time slice. * fhandler_console.cc (fhandler_console::read): Switch button 2/3 output escape sequences to be consistent with xterm.