Richard Earnshaw [Wed, 11 Jun 2014 10:42:54 +0000 (10:42 +0000)]
* libc/machine/aarch64/strchrnul.S: New file.
* libc/machine/aarch64/strchrnul-stub.c: New file.
* libc/machine/aarch64/Makefile.am: Add them to build list.
* libc/machine/aarch64/Makefile.in: Regenerated.
Richard Earnshaw [Tue, 10 Jun 2014 14:04:31 +0000 (14:04 +0000)]
* libc/machine/aarch64/strchr.S: New file
* libc/machine/aarch64/strchr-stub.c: New file
* libc/machine/aarch64/Makefile.am: Add them to build list.
* libc/machine/aarch64/Makefile.in: Regenerated.
DJ Delorie [Tue, 10 Jun 2014 03:09:35 +0000 (03:09 +0000)]
* configure.host (default_newlib_nano_malloc): New.
(msp430): Set it.
* configure.in (newlib_nano_malloc): Leave unset if not set by
the user.
* configure: Regenerate.
* libc/configure.in (NEWLIB_NANO_MALLOC): Set after running
configure.host.
(newlib_nano_malloc): Leave unset if not set by the user.
* libc/configure: Regenerate.
Corinna Vinschen [Fri, 23 May 2014 10:29:11 +0000 (10:29 +0000)]
* autoload.cc (ldap_memfreeW): Remove.
(ldap_msgfree): Import.
* ldap.cc: Throughout, use ldap_msgfree to free LDAPMessage memory,
rather than ldap_memfreeW.
(cyg_ldap::next_account): Immediately abandon search when quiting from
search.
Corinna Vinschen [Thu, 22 May 2014 20:07:25 +0000 (20:07 +0000)]
* autoload.cc (ldap_abandon): Remove.
(ldap_count_entries): Import.
(ldap_get_next_page_s): Import.
(ldap_result): Remove.
(ldap_searchW): Remove.
(ldap_search_abandon_page): Import.
(ldap_search_init_pageW): Import.
* ldap.cc (cyg_ldap::close): Use ldap_search_abandon_page to abandon
search. Reset srch_id, srch_msg and srch_entry.
(cyg_ldap::enumerate_ad_accounts): Use paged search to overcome server
side search result set restriction.
(cyg_ldap::next_account): Ditto.
* ldap.h (class cyg_ldap): Add members srch_id, srch_msg and srch_entry.
Remove member msg_id.
(cyg_ldap::cyg_ldap): Change initialization accordingly.
Corinna Vinschen [Thu, 22 May 2014 14:50:24 +0000 (14:50 +0000)]
* ldap.cc (cyg_ldap::fetch_ad_account): Take additional domain string
parameter. Convert into likely rootDSE string if not NULL, and use in
subsequent call to ldap_search_stW. Add comment to explain that this
is not the exactly correct solution.
* ldap.h (cyg_ldap::fetch_ad_account): Change prototype accordingly.
* uinfo.cc (pwdgrp::fetch_account_from_windows): Always use loc_ldap
in call to fetch_posix_offset to make sure we're fetchoinmg the posix
offsets from *our* domain controller. Only set domain variable to
non-NULL if the account is from a trusted domain. Use domain in call
to cyg_ldap::fetch_ad_account.
Corinna Vinschen [Thu, 22 May 2014 09:45:17 +0000 (09:45 +0000)]
* libc/bsdlib.cc (forkpty): Close master and slave if fork fails to
avoid resource leak (CID 59997).
* libc/fts.c: Update to FreeBSD version 1.39 (CID 59947).
* libc/minires.c (minires_get_search): Fix out-of-bounds read from
words array (CID 59937).
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.