Corinna Vinschen [Tue, 20 May 2014 10:21:34 +0000 (10:21 +0000)]
* scandir.cc (scandir): Assume namelist is always valid, per POSIX.
(CID 60021).
* sec_auth.cc (cygwin_logon_user): Securely erase password copy.
(lsaprivkeyauth): Avoid trying to dereference data if no key is stored
in the registry (CID 60122). Securely erase passwords after usage.
Corinna Vinschen [Mon, 19 May 2014 15:57:22 +0000 (15:57 +0000)]
* net.cc (call_gaa): Fix setting pa_ret pointer in case of an error
from GetAdaptersAddresses (CID 60218).
(get_ifs): Add missing braces in AF_INET6 case which broke netmask
computation. Break out of loop if prefix gets <= 0 (CID 59939).
Corinna Vinschen [Mon, 19 May 2014 09:49:15 +0000 (09:49 +0000)]
* bsd_helper.cc (ipcexit_creat_hookthread): Delete shs to make
Coverity happy (CID 59993).
* transport_pipes.cc (transport_layer_pipes::listen): Make listen_pipe
and connect_pipe statics to make Coverity happy (CID 60010/60011).
Corinna Vinschen [Thu, 15 May 2014 11:16:28 +0000 (11:16 +0000)]
* external.cc (cygwin_internal): Implement CW_CYGNAME_FROM_WINNAME.
Add lengthy comment to explain what we do and why.
* include/sys/cygwin.h (cygwin_getinfo_types): Add
CW_CYGNAME_FROM_WINNAME.
Corinna Vinschen [Wed, 14 May 2014 11:27:47 +0000 (11:27 +0000)]
* sec_auth.cc (get_server_groups): Call get_logon_server only for
non-builtin accounts.
* uinfo.cc (pwdgrp::fetch_account_from_windows): Check incoming
account name for validity in terms of the current name prefixing rules
and refuse invalid names.
Corinna Vinschen [Tue, 13 May 2014 16:07:50 +0000 (16:07 +0000)]
* fhandler_socket.cc (fhandler_socket::ioctl): Handle the different
ideas of u_long between Winsock and Cygwin applications on x86_64.
Add long comment.
Jon TURNEY [Tue, 13 May 2014 10:26:26 +0000 (10:26 +0000)]
* minidumper.cc (filter_minidump_type): New function.
(minidump): Change default dump type from MiniDumpNormal to
something with more useful information without getting too
big. Use filter_minidump_type() to filter out unsupported dump
types.
* signal.cc (sigprocmask): Fix strace output to include "how".
* fhandler_console.cc (dev_console::save_restore): Only current dwEnd line
rather than the one after that.
* grp.cc (pwdgrp::parse_group): Set grp.len. Drop generating any
gr_mem entries.
(getgrgid_r): Don't try to copy gr_mem entries. Always set gr_mem
to an empty list.
(getgrnam_r): Ditto.
(app_gr): New static struct to store group data propagated to the
calling application via getgrgid/getgrnam.
(getgr_cp): Fill app_gr and return pointer to app_gr.g.
(getgrgid32): Call getgr_cp.
(getgrnam32): Ditto.
* passwd.cc (pwdgrp::parse_passwd): Set res.len.
(app_pw): New static struct to store passwd data propagated to the
calling application via getpwuid/getpwnam.
(getpw_cp): Fill app_pw and return pointer to app_pw.p.
(getpwuid32): Cal getpw_cp.
(getpwnam): Ditto.
* pwdgrp.h (struct pg_pwd): Add len member.
(struct pg_grp): Ditto.
* grp.cc (internal_getgroups): Drop unused cygsid variable.
* sec_helper.cc (cygpsid::pstring): Use sid_sub_auth_count macro.
(cygsid::get_sid): Use MAX_SUBAUTH_CNT rather than wrong constant 8.
Don't call memcpy to copy subauthorities into SID, use assignment.
(cygsid::getfromstr): Use MAX_SUBAUTH_CNT rather than wrong constant 8.
* security.h (MAX_SUBAUTH_CNT): New definition. Set to 11 to cover
Microsoft Accounts.
(MAX_SID_LEN): Define in terms of SID member sizes and MAX_SUBAUTH_CNT.
(DBGSID): Use MAX_SUBAUTH_CNT to define size of SubAuthority array.
* uinfo.cc (pwdgrp::fetch_account_from_windows): Handle Micosoft
Accounts. Handle them as well known group. Compare domain names
case-insensitive.
* winlean.h (PIPE_REJECT_REMOTE_CLIENTS): Drop temporary definition
since Mingw64 catched up.
(DNLEN): Redefine as 16. Explain why.
* DevNotes: Add entry cgf-000026.
* fhandler.h (fhandler_console::save_top): Save top of screen coordinates.
* fhandler_console.cc (dev::save_restore): Record top of screen coordinates.
Clear entire buffer when restoring saved buffer and try to position the cursor
on the save relative place on the screen.
* fhandler_socket.cc: On x86_64, define u_long as __ms_u_long before
including the windows headers. Explain why.
(get_inet_addr): Convert ANY address to LOOPBACK address. Explain why.
(fhandler_socket::evaluate_events): Forcibly set SO_ERROR socket option
in case a connection attempt failed. Explain why.
(fhandler_socket::ioctl): Drop x86_64 re-definition of u_long here.
* fhandler_procnet.cc: On x86_64, define u_long as __ms_u_long before
including the windows headers. Explain why.
* net.cc: Ditto.
Richard Earnshaw [Tue, 22 Apr 2014 12:16:22 +0000 (12:16 +0000)]
* libc/machine/arm/strcmp-arm-tiny.S: New file.
* libc/machine/arm/strcmp-armv4.S: New file.
* libc/machine/arm/strcmp-armv4t.S: New file.
* libc/machine/arm/strcmp-armv6.S: New file.
* libc/machine/arm/strcmp-armv7.S: New file.
* libc/machine/arm/strcmp-armv7m.S: New file.
* libc/machine/arm/strcmp.S: Replace with wrapper for various
implementations.
* libc/machine/arm/Makefile.am (strcmp.o, strcmp.obj): Add
dependencies.
* libc/machine/arm/Makefile.in: Regenerated.
* cygtls.h (TP_NUM_C_BUFS): Raise to 50 to allow SYMLOOP_MAX recursions
path_conv <-> normalize_posix_path, plus a bit of buffer.
(TP_NUM_W_BUFS): Ditto.
(class san): Change type of _c_cnt and _w_cnt to unsigned.
* path.cc (normalize_posix_path): Guard recursion into path_conv
against tmp_pathbuf overflow. Generate normalized path in call to
path_conv. If the path is valid, replace dst with the normalized_path
from path_conv call. Add comment to explain why we're doing this.
* tls_pbuf.cc (tls_pathbuf::destroy): Only free buffers until the
first buffer pointer is NULL.
(tmp_pathbuf::c_get): Simplify error message.
(tmp_pathbuf::w_get): Ditto.
* tls_pbuf.h (class tmp_pathbuf): Change type of c_buf_old and w_buf_old
to unsigned.
(tmp_pathbuf::check_usage): New inline method to check if we have
enough tmp_pathbuf buffers left to call a function using tmp_pathbuf
buffers.
* tlsoffsets.h: Regenerate.
* tlsoffsets64.h: Regenerate.
* cygwin.sc.in: (Temporarily?) workaround serious ld bug which
truncates symbols in certain computations to 32 bit. See
https://sourceware.org/bugzilla/show_bug.cgi?id=16821
* cygserver_ipc.h (ipc_set_proc_info): Add bool parameter to specify
whether or not to send signal_arrived.
* shm.cc (client_request_shm::client_request_shm): Call
ipc_set_proc_info with bool parameter set to true to not send
signal_arrived.
Jeff Johnston [Fri, 4 Apr 2014 21:40:59 +0000 (21:40 +0000)]
2014-04-04 Ashish Kapania <akapania@ti.com>
* configure.host (sys_dir, newlib_cflags): Set sys_dir to tirtos and use
-D__DYNAMIC_REENT__ and -DMALLOC_PROVIDED compiler options for TIRTOS
target.
* libc/stdio/local.h (_STDIO_CLOSE_PER_REENT_STD_STREAMS): Change #ifdef
to not define this macro when __tirtos__ is defined.
* libc/sys/tirtos : Add support for TIRTOS.
* libc/sys/tirtos/Makefile.am, libc/sys/tirtos/lock.c: New files.
* libc/sys/tirtos/configure.in, libc/sys/tirtos/include/sys/lock.h: Ditto.
* ntea.cc (EA_BUFSIZ): Fix comment.
(read_ea): Use tmp_pathbuf for local buffer rather than alloca.
Throughout change ZwQueryEaFile to NtQueryEaFile in comments.
* DevNotes: Add entry cgf-000025.
* exceptions.cc (_cygtls::signal_debugger): Reorganize to avoid contacting the
debugger if we have already done so via the exception handler. Eliminate need
for goto. Remove an ifdef in favor of just allocating a larger buffer.
Corinna Vinschen [Fri, 28 Mar 2014 22:31:53 +0000 (22:31 +0000)]
* dcrt0.cc (dll_crt0_0): Install myfault exception handler on x86_64.
* exception.h (exception_list): Typedef as void on x86_64.
(exception::handler_installed): Remove.
(exception::handle_while_being_debugged): Remove.
(exception::myfault_handle): Declare for x86_64.
(exception::handle): Declare as ordinary exception handler on x86_64
as well.
(exception::exception): Drop previous code (again). Install
exception::handle as SEH handler.
(exception::install_myfault_handler): New x86_64-only method to
install exception::myfault_handle as VEH handler. Explain why.
(exception::~exception): For x86_64, define frame end label (again).
* exceptions.cc (CYG_EXC_CONTINUE_EXECUTION): Drop definition.
(CYG_EXC_CONTINUE_SEARCH): Ditto.
(exception::myfault_handle): New x86_64-only method, VEH handler to
handle myfault exceptions.
(exception::handle): Define as ordinary exception handler on x86_64
as well. Use ExceptionContinueExecution and ExceptionContinueSearch
throughout instead of deleted Cygwin macros. Don't handle myfault
exceptions on x86_64.
Corinna Vinschen [Thu, 27 Mar 2014 19:35:55 +0000 (19:35 +0000)]
* gendef (_sigbe/x86_64): Fix typo in .seh_proc pseudo-op.
(setjmp/x86_64): Drop storing ExceptionList pointer in jmp_buf->Frame.
Drop comment. Store likely frame in rdx. Jump to __setjmpex.
(__setjmpex): New function providing setjmp functionality. Fetch
jmp_buf->Frame from rdx, like MSVCRT setjmpex.
(__sjfault/x86_64): Store rdx content in jmp_buf->Frame.
(__ljfault/x86_64): Don't restore ExceptionList pointer.
(longjmp/x86_64): Ditto.
Jeff Johnston [Fri, 21 Mar 2014 20:55:57 +0000 (20:55 +0000)]
2014-03-21 Sabrini Ni <sabrinanitw@gmail.com>
* nds32/Makefile.in: Alter filename.
* nds32/syscall_argv.S: Rename to _argv.S
* nds32/syscall_argvlen.S: Rename to _argvlen.S
* nds32/syscall_chdir.S: Rename to _chdir.S
* nds32/syscall_chmod.S: Rename to _chmod.S
* nds32/syscall_close.S: Rename to _close.S
* nds32/syscall_exit.S: Rename to _exit.S
* nds32/syscall_fstat.S: Rename to _fstat.S
* nds32/syscall_getpid.S: Rename to _getpid.S
* nds32/syscall_gettimeofday.S: Rename to _gettimeofday.S
* nds32/syscall_isatty.S: Rename to _isatty.S
* nds32/syscall_kill.S: Rename to _kill.S
* nds32/syscall_link.S: Rename to _link.S
* nds32/syscall_lseek.S: Rename to _lseek.S
* nds32/syscall_open.S: Rename to _open.S
* nds32/syscall_read.S: Rename to _read.S
* nds32/syscall_rename.S: Rename to _rename.S
* nds32/syscall_sbrk.S: Rename to _sbrk.S
* nds32/syscall_stat.S: Rename to _stat.S
* nds32/syscall_system.S: Rename to _system.S
* nds32/syscall_time.S: Rename to _time.S
* nds32/syscall_times.S: Rename to _times.S
* nds32/syscall_unlink.S: Rename to _unlink.S
* nds32/syscall_utime.S: Rename to _utime.S
* nds32/syscall_write.S: Rename to _write.S
* fhandler.h (fhandler_dev_dsp): Remove variable names from declarations.
(fhandler_dev_dsp::close_audio_in): Make __reg1.
(fhandler_dev_dsp::close_audio_out): Make __reg2.
* fhandler_dev_dsp.cc (fhandler_dev_dsp::close_audio_in): Make __reg1.
(fhandler_dev_dsp::close_audio_out): Make __reg2.
(fhandler_dev_dsp::close): Don't abruptly terminate sound just because we are
exiting.