Commit Graph

10359 Commits

Author SHA1 Message Date
Corinna Vinschen 12b244394c * cygtls.cc (san::leave/x86_64): Implement.
* cygtls.h (class tls_pathbuf): Move counter variables into a union.
	Add 64 bit element _counters covering both counter variables to
	optimize save and restore operations.
	(class san/x86_64): Only store single 64 bit value.
	(san::san/x86_64): Implement.
	(san::leave/x86_64): Only declare here, as returns_twice function.
	Explain why.
	(class san/i686): Change type of _c_cnt and _w_cnt to uint32_t.
	(__try/x86_64): Move definition of __sebastian after the first memory
	barrier.  Drop __sebastian.setup call.
2014-08-25 19:47:44 +00:00
Corinna Vinschen 5578cc4b73 * cygtls.cc (_cygtls::remove): Revert previous patch.
*  cygtls.h (struct _local_storage): Move pathbufs back here.
	(class san/x86_64): Revert class.  Save and restore pathbufs counters
	only.
	(class san/i686): Revert saving and restoring pathbufs counters.
	(__try/x86_64): Add a san variable and call it's setup method.
	(__except/x86_64): Call san::leave to restore pathbufs counters.
	* gendef (_sigbe): Revert previous change.
	* thread.cc (verifyable_object_state): Remove gcc 4.7 workaround in
	forward declaration as well.
	* tls_pbuf.cc (tls_pbuf): Revert previous change.
	* tls_pbuf.h (class tmp_pathbuf): Accommodate reverting pathbufs to
	locals structure.
	* tlsoffsets.h: Regenerate.
	* tlsoffsets64.h: Regenerate.
2014-08-25 14:53:49 +00:00
Corinna Vinschen 3f3bd10104 * Throughout, use __try/__except/__endtry blocks, rather than myfault
handler.
	* cygtls.cc (_cygtls::remove): Accommodate the fact that pathbufs
	has been moved from _local_storage to _cygtls.
	* cygtls.h (class tls_pathbuf): Add comment to hint to gendef usage
	of counters.  Change type of counters to uint32_t for clarity.
	Remove _cygtls as friend class.
	(struct _local_storage): Move pathbufs from here...
	(struct _cygtls): ...to here, allowing to access it from _sigbe.
	(class san): Only define on 32 bit.  Remove errno, _c_cnt and _w_cnt
	members.
	(san::setup): Drop parameter.  Don't initialize removed members.
	(san::leave): Don't set removed members.
	(class myfault): Only define on 32 bit.
	(myfault::faulted): Only keep implementation not taking any parameter.
	Drop argument in call to sebastian.setup.
	(__try/__leave/__except/__endtry): Implement to support real SEH.  For
	now stick to SJLJ on 32 bit.
	* dcrt0.cc (dll_crt0_0): Drop 64 bit call to
	exception::install_myfault_handler.
	* exception.h (exception_handler): Define with EXCEPTION_DISPOSITION
	as return type.
	(PDISPATCHER_CONTEXT): Define as void * on 32 bit.  Define as pointer
	to _DISPATCHER_CONTEXT on 64 bit.
	(class exception): Define separately for 32 and 64 bit.
	(exception::myfault): Add handler for myfault SEH handling on 64 bit.
	(exception::exception): Fix mangled method name to account for change
	in type of last parameter.
	(exception::install_myfault_handler): Remove.
	* exceptions.cc (exception::myfault_handle): Remove.
	(exception::myfault): New SEH handler for 64 bit.
	* gendef (_sigbe): Set tls_pathbuf counters to 0 explicitely when
	returning to the caller.
	* ntdll.h: Move a comment to a better place.
	(struct _SCOPE_TABLE): Define on 64 bit.
	* thread.cc (verifyable_object_isvalid): Remove gcc 4.7 workaround.
	* tls_pbuf.cc (tls_pbuf): Fix to accommodate new place of pathbufs.
	(tls_pathbuf::destroy): Change type of loop variables to uint32_t.
	* tls_pbuf.h (class tmp_pathbuf): Change type of buffer counters to
	uint32_t.  Accommodate new place of pathbufs.
	* tlsoffsets.h: Regenerate.
	* tlsoffsets64.h: Regenerate.
2014-08-22 09:21:33 +00:00
Corinna Vinschen 33ed7bb5bc * miscfuncs.cc (__import_address): Cover the first dereference to imp
under the fault handler.
2014-08-21 09:04:09 +00:00
Corinna Vinschen b1f81c3b71 * net.cc (if_freenameindex): Don't catch a SEGV from free to fail
loudly on double free.
2014-08-21 08:59:28 +00:00
Corinna Vinschen 88fa851784 * dir.cc (rmdir): Don't skip deleting fh in the ENOTEMPTY case. 2014-08-21 08:46:35 +00:00
Corinna Vinschen 854e058b56 * tls_pbuf.h (tmp_pathbuf::tmp_pathbuf): Convert to inline method.
(tmp_pathbuf::~tmp_pathbuf): Ditto.
	* tls_pbuf.cc (tmp_pathbuf::tmp_pathbuf): Remove here.
	(tmp_pathbuf::~tmp_pathbuf): Ditto.
2014-08-20 19:44:09 +00:00
Corinna Vinschen 905a851912 * dir.cc (dirfd): Per POSIX, return EINVAL on invalid directory stream.
(telldir): Per POSIX, return -1 and set errno to EBADF, rather than
	just returning 0, on invalid directory stream.
	* signal.cc (sigwaitinfo): Return -1, not EFAULT, when SEGV was catched.
2014-08-19 19:25:54 +00:00
Corinna Vinschen de1c312566 * fhandler.h (enum conn_state): Add "connect_credxchg" state.
(class fhandler_socket): Grant another bit to connect_state flag.
	* fhandler_socket.cc (fhandler_socket::af_local_connect): Rearrange
	variable definition.  Set connect_state to connect_credxchg.
	(fhandler_socket::af_local_accept): Ditto.
	(fhandler_socket::recv_internal): Accept connect_credxchg on connection
	oriented AF_LOCAL sockets as well to allow the credential exchange.
	Extend comment to explain.
2014-08-19 09:47:12 +00:00
Corinna Vinschen 67986ac4a4 * autoload.cc: Replace WNet[...]A with WNet[...]W imports.
* dcrt0.cc (initial_env): Drop strlwr calls.  Call strcasestr instead.
	* fhandler_netdrive.cc: Throughout, convert to calling WNet UNICODE
	functions.  Use tmp_pathbuf rather than alloca.  Replace call to
	strlwr with call to RtlDowncaseUnicodeString.
2014-08-19 08:41:40 +00:00
Corinna Vinschen be2b7c5684 * fhandler.h (fhandler_serial::is_tty): Reinstantiate. 2014-08-19 08:31:10 +00:00
Corinna Vinschen bd094739f3 * miscfuncs.cc (strlwr): Rename from cygwin_strlwr. Drop __stdcall
decoration.
	(strupr): Rename from cygwin_strupr.  Drop __stdcall decoration.
	* string.h (strlwr): Remove override macro.  Simply declare.
	(strupr): Ditto.
2014-08-18 18:24:06 +00:00
Corinna Vinschen 697c710dc3 *** empty log message *** 2014-08-18 11:37:27 +00:00
Corinna Vinschen 1091d4404e * dtable.cc (dtable::init_std_file_from_handle): Mention that console
handles are kernel objects since Windows 8.
	* fhandler.h (enum conn_state): Add "listener" state.
	(class fhandler_socket): Drop listener status flag.
	(fhandler_socket::lseek): Return -1 and errno ESPIPE.
	(fhandler_serial::lseek): Ditto.
	* fhandler_socket.cc (fhandler_socket::listen): Set connect_state to
	listener.  Add comment.
	(fhandler_socket::accept4): Explicitely check if the socket is listening
	and fail with EINVAL, if not.  Explain why we have to do that.
	(fhandler_socket::recv_internal): Explicitely check if the socket is
	connected if it's a stream socket.  Explain why we have to do that.
	(fhandler_socket::getpeereid): Drop now redundant test.
2014-08-18 11:09:56 +00:00
Corinna Vinschen 7e46c0af62 * configure.ac: Convert to new AC_INIT style.
* configure: Regenerate.
2014-08-15 21:24:35 +00:00
Corinna Vinschen 4dd1ecc3d4 * winsup.h (_GNU_SOURCE): Define. Explain why.
* configure.ac: Convert to new AC_INIT style.
	* configure: Regenerate.
2014-08-15 21:21:59 +00:00
Corinna Vinschen fc15ff2f0d * cygerrno.h (seterrno): Define as (always) inline function.
* errno.cc (seterrno): Remove.
2014-08-15 13:50:53 +00:00
Corinna Vinschen d1ebeeab58 * cygwin-api.xml: Include misc-funcs.xml.
* misc-funcs.xml: New file.
2014-08-14 20:47:14 +00:00
Corinna Vinschen d9e9de3f38 * dll_init.sgml: Remove.
* dtable.sgml: Move into ../doc/misc-funcs.xml.
	* external.sgml: Ditto.
	* stackdump.sgml: Ditto.
2014-08-14 20:46:28 +00:00
Corinna Vinschen 9f2842e92c * cygwin-api.xml: Move chapter tags from path.xml back here.
Include logon-funcs.xml.
	* logon-funcs.xml: Moved from ../cygwin here and converted to XML.
	* path.xml: Drop chapter tags.  Create subsections.
2014-08-14 20:15:49 +00:00
Corinna Vinschen 308ea1e73c * security.sgml: Move to ../doc dir and rename to logon-funcs.xml. 2014-08-14 20:12:50 +00:00
Corinna Vinschen 6b31215816 * Makefile.in: Throughout use parenthesis instead of braces where
appropriate.
	(DBXDIRS): Remove.
	(XSLTPROC): Define for symmetry.  Use throughout.
	(clean): Drop removing cygwin-api.xml and doctool.*.
	(cygwin-api.xml): Drop rule.
	(doctool): Drop rule.
	(Makefile.dep): Add dependency to cygwin-api.xml.
	* cygwin-api.in.xml: Rename to cygwin-api.xml.  Convert includes to
	XML XInclude style.
	* doctool.c: Remove.
	* doctool.txt: Remove.
	* faq-programming.xml: Drop reference to local utils.xml file.
	* path.xml: Moved from ../cygwin and converted to XML.
	* posix.xml: Ditto.
	* using.xml: Drop relative path from utils.xml include.
	* utils.xml: Moved from ../utils.
2014-08-14 19:44:29 +00:00
Corinna Vinschen fbf2e44799 * utils.xml: Move to ../doc. 2014-08-14 19:33:57 +00:00
Corinna Vinschen ec50fa3597 * path.sgml: Move to ../doc dir and rename to path.xml.
* posix.sgml: Move to ../doc dir and rename to posix.xml.
2014-08-14 19:31:33 +00:00
Corinna Vinschen f509713291 * dlmalloc.c: Remove unused file.
* dlmalloc.h: Ditto.
	* malloc.cc: Update to Doug Lea's malloc version 2.8.6.
2014-08-14 17:36:24 +00:00
Corinna Vinschen 12a8027532 * new-features.xml: (ov-new1.7.33): Add new section.
(ov-new1.7.32): Reflect intermediate 1.7.32 release.
2014-08-13 17:44:07 +00:00
Corinna Vinschen 0d45f7ee54 * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 33.
(CYGWIN_VERSION_API_MINOR): Bump to reflect intermediate 1.7.32 release.
2014-08-13 17:38:47 +00:00
Corinna Vinschen 5b4e301b36 * cpuid.h: Add missing copyright header. Fix formatting. Use uint32_t
instead of unsigned throughout.  Change functions to static inline and
	always inline.
	(cpuid): Add parameter to set ecx, allowing to request extended CPUID
	info.
	* fhandler_proc.cc (format_proc_cpuinfo): Use uint32_t instead of
	unsigned throughout.  Add fake decimal places to MHz info.  Handle more
	feature flags.
	* fhandler_random.cc (fhandler_dev_random::write): Allow up to 4K
	input to add entropy.
	* syscalls.cc: Drop including cpuid.h.
2014-08-11 12:03:18 +00:00
Yaakov Selkowitz f9c956a1ff * common.din (__cxa_finalize): Export.
* dcrt0.cc (cygwin_atexit): Use d->handle with __cxa_atexit.
* dll_init.cc (dll_list::detach): Use d->handle with __cxa_finalize.
* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Use 274 for
__cxa_finalize as well.
2014-08-07 16:25:06 +00:00
Yaakov Selkowitz 85a7b23a5c * Makefile.common (COMPILE.cc): Add -fno-use-cxa-atexit. 2014-08-07 16:19:09 +00:00
Corinna Vinschen 5528975705 * passwd.c (usage): Rename DAYS to MINDAYS and MAXDAYS.
* utils.xml (passwd): Ditto.
2014-08-06 19:24:57 +00:00
Corinna Vinschen 89d35a4833 * ntsec.xml (ntsec-mapping): Drop plus-prepended builtin accounts as
default setting.  Add short explanation in db_prefix: always mode.
	Fix a type.  Drop a paragraph with redundant information.
2014-08-06 14:46:03 +00:00
Corinna Vinschen 0b20d00bf3 * include/sys/file.h: Add extern "C". 2014-08-06 08:46:12 +00:00
Corinna Vinschen 79131d442e * common.din (__cxa_atexit): Export.
* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump to 274.
2014-08-04 16:52:04 +00:00
Corinna Vinschen 64665f459e * uinfo.cc (pwdgrp::fetch_account_from_windows): Drop "plus_prepended"
as naming style.  Drop enum name_style_t, use a boolean
	"fully_qualified_name" value instead.  Rework function to drop
	"plus_prepended" handling througout and default to "name only" style
	as replacement.
2014-08-04 15:50:42 +00:00
Yaakov Selkowitz c0a211cc3e * faq-what.xml (faq.what.who): Remove mention of retired setup
maintainers.  Add link to cygwin-pkg-maint.
2014-08-03 19:53:24 +00:00
Eric Blake 9067d19b9a headers: properly decorate attributes
As pointed out here:
https://cygwin.com/ml/cygwin/2014-07/msg00371.html

any use of __attribute__ in a header that can be included by a user
should be namespace-safe, by decorating the attribute arguments with __
(while gcc does a lousy job at documenting it, ALL attributes have a __
counterpart, precisely so that public headers can use attributes without
risk of collision with macros belonging to user namespace).

* include/pthread.h: Decorate attribute names with __, for
namespace safety.
* include/cygwin/core_dump.h: Likewise.
* include/cygwin/cygwin_dll.h: Likewise.
* include/sys/cygwin.h: Likewise.
* include/sys/strace.h: Likewise.
2014-08-01 15:48:37 +00:00
Yaakov Selkowitz 02206cd3e4 * faq-what.xml (faq.what.who): CGF has retired. 2014-08-01 01:29:46 +00:00
Corinna Vinschen 1721a38efd * uinfo.cc (pwdgrp::fetch_account_from_windows): Fix comment. 2014-07-30 14:23:53 +00:00
Corinna Vinschen dea309cf1f * ntsec.xml: Small improvments. 2014-07-30 12:00:24 +00:00
Corinna Vinschen 0e76ca5fd9 * new-features.xml: (ov-new1.7): Change section title. 2014-07-30 11:32:41 +00:00
Corinna Vinschen 232f23e038 * new-features.xml: (ov-new1.7.1): Add new section. Move old 1.7
sections into section level 3.
2014-07-30 11:28:58 +00:00
Corinna Vinschen f092b3ddf3 * cygwin.xsl: Allow 3 section levels in TOC.
* new-features.xml: (ov-new1.7.32): Add new section.
	* ntsec.xml: Rename top-level section to reflect extension of topics.
	Remove old /etc/passwd, /etc/group considerations.  Add new sections
	explaining Windows to POSIX account mapping.  Make setuid sections
	third level sections.
	* pathnames.xml: Note new method of account mapping for fstab.d/$USER.
	* faq-setup.xml: Rework references to /etc/passwd and /etc/group to
	reflect changes to account handling.
	* faq-using.xml: Ditto.
2014-07-30 11:07:34 +00:00
Corinna Vinschen 03ad777ab0 Add missing utils.xml 2014-07-29 13:31:33 +00:00
Corinna Vinschen c72a0d361d * mkgroup.c (usage): Move info message that this /etc/group isn't really
required anymore more to the top of the usage output.
	* mkpasswd.c (usage): Ditto for /etc/passwd.  Drop old text from output.
2014-07-29 13:29:54 +00:00
Corinna Vinschen 898e26c82f * cygheap.h (class cygheap_domain_info): Remove lowest_tdo_posix_offset.
* ldap.cc (cyg_ldap::fetch_posix_offset_for_domain): Return UINT32_MAX
	in case of error.
	* security.h (PRIMARY_POSIX_OFFSET): Define.
	(NOACCESS_POSIX_OFFSET): Define.
	(UNUSABLE_POSIX_OFFSET): Define.
	* uinfo.cc (cygheap_domain_info::init): Drop initializing
	lowest_tdo_posix_offset.
	(pwdgrp::fetch_account_from_file): Set PosixOffset to either
	UNUSABLE_POSIX_OFFSET or NOACCESS_POSIX_OFFSET in case we don't get a
	sensible offset from AD.  Explain why.  Drop setting ch
	lowest_tdo_posix_offset.
	(pwdgrp::fetch_account_from_windows): Replace constant 0x100000 with
	PRIMARY_POSIX_OFFSET throughout.
2014-07-29 08:53:13 +00:00
Corinna Vinschen c999d29a7b * fhandler_socket.cc (fhandler_socket::send_internal): Fix value of
out_len when tweaking the last buffer so out_len is correct in a
	subsequent if expression.
2014-07-24 13:21:02 +00:00
Corinna Vinschen 3be2cd0405 * thread.cc (pthread::init_mainthread): Initialize thread mutex to
type PTHREAD_MUTEX_RECURSIVE, just as for any other thread.
2014-07-21 16:32:09 +00:00
Corinna Vinschen 7cc124b0e5 bump to 32 2014-07-21 11:08:07 +00:00
Corinna Vinschen 9c96187172 * uinfo.cc: Fix typo in comment. 2014-07-21 09:55:52 +00:00