summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Set mcontext.cr2 to the faulting addressJon TURNEY2015-04-232-0/+9
| | | | | | | * exceptions.cc (call_signal_handler): Set mcontext.cr2 to the faulting address. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Only construct ucontext for SA_SIGINFO signal handlersJon TURNEY2015-04-232-22/+38
| | | | | | | | * exceptions.cc (call_signal_handler): Only bother to construct the ucontext for signal handlers with SA_SIGINFO set. Set mcontext.oldmask. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Initialize context before RtlContextCaptureJon TURNEY2015-04-232-2/+11
| | | | | | | * exceptions.cc (call_signal_handler): Zero initialize context and set context flags, as RlCaptureContext doesn't. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Call open_null to open fake handleCorinna Vinschen2015-04-232-2/+6
| | | | | | * fhandler_dsp.cc (fhandler_dev_dsp::open): Call open_null. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* For the RX port, avoid using string instructions when ↵Nick Clifton2015-04-2316-0/+272
| | | | | | | | | | | | | | | | | | | __RX_DISALLOW_STRING_INSNS__ is defined. * rx/crt0.S (_start): If string instructions are not allowed, avoid using SMOVF. * libc/machine/rx/memchr.S: Add non-string insn using version. * libc/machine/rx/memcpy.S: Likewise. * libc/machine/rx/memmove.S: Likewise. * libc/machine/rx/mempcpy.S: Likewise. * libc/machine/rx/strcat.S: Likewise. * libc/machine/rx/strcmp.S: Likewise. * libc/machine/rx/strcpy.S: Likewise. * libc/machine/rx/strlen.S: Likewise. * libc/machine/rx/strncat.S: Likewise. * libc/machine/rx/strncmp.S: Likewise. * libc/machine/rx/strncpy.S: Likewise.
* Add .note and DWARF3 sections to RX linker scripts.Nick Clifton2015-04-233-0/+17
| | | | | * rx/rx.ld: Add .note and DWARF3 sections. * rx/rx-sim.ld: Likewise.
* Introduce sidfromuid and sidfromgidCorinna Vinschen2015-04-234-14/+30
| | | | | | | | | * pwdgrp.h (sidfromuid): New inline function. (sidfromgid): Ditto. * fhandler_disk_file.cc (fhandler_disk_file::fchown): Use sidfromuid. * quotactl.cc (quotactl): Use sidfromuid and sidfromgid. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Remove __acl16 from official headerCorinna Vinschen2015-04-233-10/+11
| | | | | | | * include/cyggwin/acl.h (struct __acl16): Move from here... * sec_acl.cc: ...to here. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Always include the .csstart section in RL78 executables.Nick Clifton2015-04-233-2/+7
| | | | | * rl78/rl78.ld (.csstart): Add a KEEP directive. * rl78/rl78-sim.ld (.csstart): Add a KEEP directive.
* Remove unused 32/64 bit tty codeCorinna Vinschen2015-04-232-18/+8
| | | | | | | * tty.h (class tty): Remove unused 32/64 bit interoperability considerations. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Raise # of ptys to 128.Corinna Vinschen2015-04-235-3154/+6324
| | | | | | | | * tty.h (NTTYS): Raise to 128. * devices.in: Change pty, ptym, and cons expressions accordingly. * devices.cc: Regenerate. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Compile exceptions.cc with -fno-omit-frame-pointer on x86Jon TURNEY2015-04-232-52/+13
| | | | | | | | | | | | | | Selectively using -fomit-frame-pointer when -O is used doesn't make sense anymore, apparently since gcc 4.6, -O implies -fomit-frame-pointer. exceptions.cc must be compiled with -fno-omit-frame-pointer on x86, as it uses RtlCaptureContext, which requires a frame pointer. * Makefile.in : Remove setting -fomit-frame-pointer for compiling various files, it is already the default. Set -fno-omit-frame-pointer for exceptions.cc on x86. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Cygwin hangs up if several keys are typed during outputting a lot of texts.Takashi Yano2015-04-232-1/+6
| | | | | | | * fhandler_tty.cc (fhandler_pty_slave::read): Change calculation of "readlen" not to use "bytes_in_pipe" value directly. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add FAQ entry on how Cygwin counters install and update MITM attacksDavid A. Wheeler2015-04-232-1/+127
| | | | | | | | | * faq-setup.xml: Document how Cygwin secures installation and update against man-in-the-middle (MITM) attacks. Note that setup embeds a public key to check the signature of setup.ini, and that setup.ini includes SHA-512 cryptographic hashes. Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
* Try to make sure struct _mcontext is 16-byte alignedJon TURNEY2015-04-233-3/+8
| | | | | | | | | | | | | | | | | | On x86_64, RtlCaptureContext() uses fxsave to save FPU/MMX/SSE state. fxsave requires that the destination address is 16-byte aligned, or it will fault. CONTEXT is already annotated __attribute__ ((aligned (16))), do the same with struct _mcontext. Rearrange ucontext_t so that it's struct _mcontext element is also correctly aligned. * include/cygwin/signal.h (struct __mcontext): 16-byte align. * include/sys/ucontext.h (ucontext_t): Ditto. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Add parens around MIN/MAX values in stdint.h.Corinna Vinschen2015-04-232-71/+75
| | | | | | * libc/include/stdint.h: Throughout add parens around MIN/MAX values. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Drop local stdint.h and inttypes.h in favor of newlib filesCorinna Vinschen2015-04-234-544/+7
| | | | | | | | * include/cygwin/types.h: Include sys/_stdint.h rather than stdint.h. * include/stdint.h: Drop in favor of newlib version. * include/inttypes.h: Ditto. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add <sys/_stdint.h> for FreeBSD compatibilitySebastian Huber2015-04-236-46/+87
| | | | | | | | | | | | | | | | | | | | * libc/include/sys/_stdint.h: New file. * libc/include/stdint.h (int8_t): Move to <sys/_stdint.h>. (uint8_t): Likewise. (int16_t): Likewise. (uint16_t): Likewise. (int32_t): Likewise. (uint32_t): Likewise. (int64_t): Likewise. (uint64_t): Likewise. (intptr_t): Likewise. (uintptr_t): Likewise. * libc/include/sys/types.h: Include <sys/_stdint.h>. * libc/sys/rtems/machine/_types.h: Remove <stdint.h> include. * libc/sys/time.h>: Replace __uint32_t with uint32_t and __uint64_t with uint64_t. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Provide ucontext to signal handlersJon TURNEY2015-04-234-2/+70
| | | | | | | | | | | | | | Add ucontext.h header, defining ucontext_t and mcontext_t types. Provide sigaction sighandlers with a ucontext_t parameter, containing stack and context information. * include/sys/ucontext.h : New header. * include/ucontext.h : Ditto. * exceptions.cc (call_signal_handler): Provide ucontext_t parameter to signal handler function. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Make stack_t typedef generally availableJon TURNEY2015-04-232-9/+14
| | | | | | | * libc/include/sys/signal.h (stack_t): Make typedef generally available. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Add cygwin_internal() operation to retrieve the EXCEPTION_RECORD from a ↵Jon TURNEY2015-04-234-1/+26
| | | | | | | | | | | siginfo_t * * external.cc (cygwin_internal): Add operation to retrieve a copy of the EXCEPTION_RECORD from a siginfo_t *. * include/sys/cygwin.h (cygwin_getinfo_types): Ditto. * exception.h (cygwin_exception): Add exception_record accessor. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Rename struct ucontext to struct __mcontextJon TURNEY2015-04-232-9/+26
| | | | | | | | | * include/cygwin/signal.h : Rename struct ucontext to struct __mcontext. Fix layout differences from the Win32 API CONTEXT type. Remove unused member _internal. Rename member which corresponds to ContextFlags. Add cr2 member. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Fix UTF-16 surrogate handling in wctomb and friends.Corinna Vinschen2015-04-233-1/+9
| | | | | | | * libc/stdlib/wctomb_r.c (__utf8_wctomb): Fix check for handling a lone high surrogate. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Avoid potential crash at startup or in getgroups(2).Corinna Vinschen2015-04-233-1/+13
| | | | | | | * grp.cc (internal_getgroups): Handle negative domain index to avoid crashes. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix documentation of cygwin_internal()'s return type.Jon TURNEY2015-04-232-1/+5
| | | | | | * misc-funcs.xml (cygwin_internal): Correct return type. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Fix buffer size error handling in gethostname.Renato Silva2015-04-232-1/+8
| | | | | | * net.cc (cygwin_gethostname): Fix buffer size error handling. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add release msgCorinna Vinschen2015-04-231-0/+10
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Document GNU basename.Corinna Vinschen2015-04-232-0/+23
| | | | | | | * new-features.xml (ov-new1.7.36): Add new section. Document GNU basename. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Don't allow fully qualified Windows account names.Corinna Vinschen2015-04-232-0/+12
| | | | | | | * uinfo.cc (pwdgrp::fetch_account_from_windows): Don't allow fully qualified Windows account names (domain\user or user@domain). Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Avoid excessive locking and calling tzset in time functions.Corinna Vinschen2015-04-234-5/+25
| | | | | | | | | | * libc/time/lcltime_r.c (localtime_r): Call _tzset_unlocked inside TZ lock. * libc/time/mktime.c (mktime): Ditto. * libc/time/strftime.c (strftime, wcsftime): Ditto. Guard against calling _tzset_unlocked more than once (baring recursion). Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add _tzset_unlocked and _tzset_unlocked_rCorinna Vinschen2015-04-236-23/+49
| | | | | | | | | | | | | | | | | | | newlib: * libc/time/local.h (_tzset_unlocked_r): Add prototype. (_tzset_unlocked): Ditto. * libc/time/tzset.c (_tzset_unlocked): New function, call _tzset_unlocked_r. (tzset): Lock and call _tzset_unlocked_r. * libc/time/tzset_r (_tzset_unlocked_r): Remove locking and rename from _tzset_r. (_tzset_r): Lock and call _tzset_unlocked_r. cygwin: * localtime.cc (tzset_unlocked): Export as _tzset_unlocked. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Move tzset calls to time functions.Craig Howland2015-04-235-7/+13
| | | | | | | | | | * libc/stdlib/setenv_r.c (_setenv_r): Remove tzset() call for TZ definition. * libc/time/lcltime_r.c (localtime_r): Add tzset() call * libc/time/mktime.c (mktime): Ditto. * libc/time/strftime.c (strftime, wcsftime): Ditto. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* strftime: use tzname if TM_ZONE is NULLYaakov Selkowitz2015-04-232-3/+8
| | | | | | | This avoids a strlen(NULL) crash a few lines later. * libc/time/strftime.c (strftime) <%Z>: Initialize tznam to NULL. Use _tzname as fallback if TM_ZONE is NULL.
* cygwin: add GNU basename(3)Yaakov Selkowitz2015-04-235-1/+44
| | | | | | | | | | winsup/cygwin/ * common.din (__gnu_basename): Export. * path.cc (__gnu_basename): New function. winsup/doc/ * posix.xml (std-gnu): Add basename. (std-notes): Add note about two forms of basename.
* string: add GNU basename(3)Yaakov Selkowitz2015-04-236-2/+61
| | | | | | | | * libc/include/libgen.h (_BASENAME_DEFINED): Define. * libc/include/string.h (basename): Declare. * libc/string/Makefile.am (ELIX_4_SOURCES): Add gnu_basename.c. * libc/string/Makefile.in: Regenerate. * libc/string/gnu_basename.c: New file.
* Try best to handle user from domain not in trusted domain list.Corinna Vinschen2015-04-233-4/+45
| | | | | | | | | | * cygheap.h (cygheap_domain_info::add_domain): Add prototype. * uinfo.cc (cygheap_domain_info::add_domain): New method. (pwdgrp::fetch_account_from_windows): Try to add domain explicitely if it was not in the original list of trusted domains and go ahead rather than bailing out. Add comment to explain why. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Prepare to rename/reuse struct ucontext.Corinna Vinschen2015-04-236-112/+120
| | | | | | | | | * cygtls.h (struct _cygtls): Convert thread_context to type CONTEXT. * exceptions.cc (_cygtls::signal_debugger): Use sizeof (CONTEXT) for size of CONTEXT copied for GDB's digestion. * include/cygwin/signal.h: Add a preliminary comment. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add CMIN and CTIME definitionsCorinna Vinschen2015-04-233-4/+11
| | | | | | | * include/sys/termios.h: Add CMIN and CTIME. * fhandler_termios.cc (fhandler_termios::tcinit): Use CMIN and CTIME. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Bump tty.cc copyright dateCorinna Vinschen2015-04-231-1/+1
|
* TIOCPKT mode of PTY is broken if ONLCR bit is cleared.Takashi Yano2015-04-237-132/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tty.h (class tty_min): Remove variable "write_error" to which any errors are not currently set at anywhere. (class tty): Add variable "column" for handling ONOCR. * tty.cc (tty::init): Add initialization code for variable "column". * fhandler.h (class fhandler_pty_master): Remove variable "need_nl" which is not necessary any more. "need_nl" was needed by OPOST process in fhandler_pty_master::process_slave_output(). (class fhandler_pty_common): Add function process_opost_output() for handling post processing for OPOST in write process. * fhandler_tty.cc (fhandler_pty_master::process_slave_output): Count TIOCPKT control byte into length to be read in TIOCPKT mode. Move post processing for OPOST to write process. Remove code related to variable "write_error". Return with EIO error if slave is already closed. (fhandler_pty_master::fhandler_pty_master): Remove initialization code for variable "need_nl". (fhandler_pty_common::process_opost_output): Add this function for handling of OPOST in write process. Add code to avoid blocking in non-blocking mode when output is suspended by ^S. (fhandler_pty_slave::write): Call fhandler_pty_common:: process_opost_output() instead of WriteFile(). Remove code related to variable "write_error". (fhandler_pty_master::doecho): Call fhandler_pty_common:: process_opost_output() instead of WriteFile(). * select.cc (peek_pipe): Remove code related to variable "need_nl". Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Import <sys/tree.h> from FreeBSDSebastian Huber2015-04-232-0/+805
| | | | * libc/include/sys/tree.h: New file.
* Ignore __STDC_{FORMAT,LIMIT,CONSTANT}_MACROSCorinna Vinschen2015-04-233-23/+9
| | | | | | | | | Per glibc BZ #15366: * inttypes.h: Drop __STDC_FORMAT_MACROS consideration. * stdint.h: Drop __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS consideration. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* * newlib.hin: Remove _UINTPTR_EQ_ULONG and _UINTPTR_EQ_ULONGLONG.Joel Sherrill2015-04-232-6/+4
| | | | | | 2013-03-23 Joel Sherrill <joel.sherrill@oarcorp.com> * newlib.hin: Remove _UINTPTR_EQ_ULONG and _UINTPTR_EQ_ULONGLONG.
* Change from configure time to compile time probe for intptr_t definition.Joel Sherrill2015-04-235-110/+36
| | | | | | | | | | | 2015-03-23 Joel Sherrill <joel.sherrill@oarcorp.com * configure.in: Delete logic to determine _UINTPTR_EQ_ULONGLONG and _UINTPTR_EQ_ULONG at configuration time. *libc/include/sys/config.h: Add logic to determine _UINTPTR_EQ_ULONGLONG and _UINTPTR_EQ_ULONG at compilation time. * libc/include/inttypes.h: Add include of <sys/config.h>. * configure: Regenerated.
* Drop cygwin/_types.h.Corinna Vinschen2015-04-232-16/+4
| | | | | | * include/cygwin/_types.h: Drop unused file. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add ChangeLog entry for last patch to libc/include/sys/time.h.Steve Ellcey2015-04-231-0/+5
|
* Replace uint32_t/uint64_t type usage with __uint32_t/__uint64_t.Steve Ellcey2015-04-231-18/+18
| | | | | * libc/include/sys/time.h: Replace uint32_t and uint64_t with __uint32_t and __uint64_t.
* Implmenet faster getfrompw/getfromgrCorinna Vinschen2015-03-187-18/+43
| | | | | | | | | | | | | | | | | | * grp.cc (pwdgrp::parse_group): Call cygsid::getfromgr_passwd. * passwd.cc (pwdgrp::parse_passwd): Call cygsid::getfrompw_gecos. * pwdgrp.h (cygsid::getfrompw): Implement as inline method here, accessing pg_pwd's sid member directly. (cygsid::getfromgr): Implement as inline method here, accessing pg_grp's sid member directly. * sec_auth.cc (extract_nt_dom_user): Call cygsid::getfrompw_gecos. Explain why. * sec_helper.cc (cygsid::getfrompw): Drop implementation. (cygsid::getfromgr): Ditto. * security.h (cygsid::getfrompw_gecos): Implement former getfrompw inline here. (cygsid::getfromgr_passwd): Implement former getfromgr inline here. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Drop unneeded passwd argument from security functionsCorinna Vinschen2015-03-185-18/+31
| | | | | | | | | | | | | | | | * sec_auth.cc (get_server_groups): Drop unused passwd argument. Adjust calls throughout. (get_initgroups_sidlist): Ditto. (get_setgroups_sidlist): Ditto. (create_token): Ditto. (lsaauth): Ditto. * security.h (create_token): Adjust prototype to above change. (lsaauth): Ditto. (get_server_groups): Ditto. * grp.cc (get_groups): Adjust call to get_server_groups. * syscalls.cc (seteuid32): Adjust calls to lsaauth and create_token. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Drop unused timeoput paramter to internal_getloginCorinna Vinschen2015-03-174-7/+9
| | | | | | | | * grp.cc (internal_getgroups): Drop unused timeout parameter. * pwdgrp.h (internal_getgroups): Ditto in prototype. * uinfo.cc (internal_getlogin): Ditto in usage. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>