Commit Graph

8218 Commits

Author SHA1 Message Date
Chris Sutcliffe 954e9f99fb 2010-02-17 LRN <lrn1986@gmail.com>
* include/shlguid.h (IID_IFolderView): Define.
        * include/shlobj.h (IFolderView interface): Define.
        * lib/shell32.c (IID_IFolderView): Export.
2010-02-18 13:01:56 +00:00
Corinna Vinschen 16e235b5ad * new-features.sgml (ov-new1.7.2): Accommodate name change of getlocale
to locale.
	* setup2.sgml (setup-locale-how): Ditto.
2010-02-17 15:02:17 +00:00
Corinna Vinschen ce4f5f76ab * Makefile.in (CYGWIN_BINS): Rename getlocale to locale.
* getlocale.c: Rename to ...
	* locale.cc: Revamp to add full functionality of POSIX locale(1) tool,
	as far as Cygwin supports it.
	* utils.sgml (getlocale): Move and rename to ...
	(locale): Accommodate new functionality.
2010-02-17 15:01:56 +00:00
Chris Sutcliffe f94e2b9f58 2010-02-14 Roumen Petrov <rumen@users.sourceforge.net>
Issue [2134161]: time64 functions and types for msvcrt >= 8.0
        (initial implementation)

        * new type: __time32_t

        * new structures: _finddata32_t, _finddata32i64_t, _finddata64i32_t,
        __stat32, _stat32i64, _stat64i32, __timeb32, __utimbuf32,
        __wfinddata32_t, _wfinddata32i64_t, _wfinddata64i32_t

        * new functions: _ctime32, _difftime32, _difftime64, _findfirst32
        _findfirst32i64, _findfirst64i32, _findnext32, _findnext32i64,
        _findnext64i32, _fstat32, _fstat32i64, _fstat64i32, _ftime32,
        _futime32, _gmtime32, _localtime32, _mkgmtime32, _mkgmtime64,
        _mktime32, _stat32, _stat32i64, _stat64i32, _time32, _utime32,
        _wctime32, _wfindfirst32, _wfindfirst32i64, _wfindfirst64i32,
        _wfindnext32, _wfindnext32i64, _wfindnext64i32, _wstat32,
        _wstat32i64, _wstat64i32,_wutime32

        * new define _USE_32BIT_TIME_T set 32 or 64 aliases for: time_t,
        ctime, difftime, _findfirst, _findfirsti64, _findnext, _findnexti64,
        _fstat, _fstati64, _ftime, _futime, gmtime, localtime, mktime,
        _stat, _stati64, time, _utime, _wctime, _wfindfirst, _wfindfirsti64,
        _wfindnext, _wfindnexti64, _wstat, _wstati64, _wutime
2010-02-17 02:41:06 +00:00
Corinna Vinschen 0da7a27a1b * new-features.sgml (ov-new1.7.2): Add native DOS path and UNC path
change.
	* pathnames.sgml (pathnames-intro): Make the Win32 path text a note
	and xref to new pathnames-win32 section.
	(cygdrive): Add description how the cygdrive mount flags apply to
	UNC paths starting with slashes.
	(pathnames-win32): New section describing native path handling.
2010-02-15 13:35:53 +00:00
Corinna Vinschen 66f2d8f13e * path.cc (path_conv::check): Treat native DOS paths as "noacl". 2010-02-15 13:29:02 +00:00
Corinna Vinschen 93579594b7 * mount.cc (mount_info::conv_to_win32_path): Set UNC path flags to
cygdrive prefix path flags.
2010-02-15 12:42:31 +00:00
Christopher Faylor 8103e40743 * fhandler.cc (fhandler_base::setup_overlapped): Don't set signalled state to
true initially.
(fhandler_base::has_ongoing_io): Delete ill-advised function.
(fhandler_base::read_overlapped): Rely on caller having checked nonblocking
state.  Don't attempt to (incorrectly) check it here.
(fhandler_base::write_overlapped): Remove call to has_ongoing_io.
* select.cc (peek_pipe): Ditto.
* fhandler.h (fhandler_base::has_ongoing_io): Delete declaration.
2010-02-15 01:45:05 +00:00
Christopher Faylor d67a6ce4a8 * regex/regcomp.c (xwcrtomb): Fix one explicable and one inexcplicable C
warning.
2010-02-14 21:28:44 +00:00
Corinna Vinschen 15a9e17656 * regex/regcomp.c (xwcrtomb): Don't convert Unicode chars outside the
base plane always to UTF-8.  Call wcsnrtombs instead to allow arbitrary
	multibyte charsets.
2010-02-13 12:26:06 +00:00
Corinna Vinschen 03ac74c168 * cygpath.cc (do_pathconv): Fix potential crash. 2010-02-13 11:41:53 +00:00
Corinna Vinschen 6b3f923fe2 * regex/regcomp.c (wgetnext): Use size_t as type for n2 since that's
what's returned by mbrtowc.
	* regex/regexec.c (xmbrtowc): Ditto.
2010-02-12 20:17:22 +00:00
Christopher Faylor 2b1407d372 * pthread.cc (pthread_mutex_init): Explicitly fill out third arg to
pthread_mutex::init.
* thread.cc: Remov some obsolete comments.
(verifyable_object_isvalid): Reflect change to use thread_magic_t for magic
numbers.
(pthread_mutex::pthread_mutex): Set magic number to invalid initially until
we've verified that everything is valid.
(pthread_mutex::unlock): Fix a comment.
(verifyable_object::verifyable_object): Delete here.
(~verifyable_object::~verifyable_object): Ditto.
(pthread_mutex::init): Don't run is_good_initializer for non-static objects.
* thread.h (thread_magic_t): New typedef.
(verifyable_object::verifyable_object): Use thread_magic_t;
(verifyable_object::magic): Ditto.
(pthread_mutex::is_good_initializer_or_bad_object): Remove unneeded variable
names.
(pthread_mutex::can_be_unlocked): Ditto.
(pthread_mutex::init): Ditto.  Remove default for third argument.
2010-02-12 20:07:13 +00:00
Christopher Faylor 97e5d3ffa4 fix typo 2010-02-12 18:38:59 +00:00
Corinna Vinschen 7bd2296c83 * regex/regcomp.c (xwcrtomb): New function to convert wide chars
outside of the base plane to UTF-8.  Call throughout instead of
	wcrtomb.
	(wgetnext): Handle surrogate pairs on UTF-16 systems.
	* regex/regexec.c (xmbrtowc): Ditto.
2010-02-12 17:46:39 +00:00
Corinna Vinschen e122c47112 * sec_auth.cc (get_user_local_groups): Retrieve name of well known
builtin group from system.  Explain why.
	* sec_helper.cc (well_known_builtin_sid): New SID for BUILTIN group.
	* security.h (well_known_builtin_sid): Declare.
2010-02-12 17:40:42 +00:00
Pierre Humblet 848dbc8f98 2010-02-11 Pierre Humblet <Pierre.Humblet@ieee.org>
* registry.c (get_registry_hive_path): Add space in string.
2010-02-12 01:04:52 +00:00
Corinna Vinschen 44caccfca2 * regex/engine.c (step): Drop Cygwin-specific definition.
(NONCHAR): Better cast here to make the test work.  Move comment
	from step here.
	(matcher): Disable skipping initial string in multibyte case.
	* regex/regcomp.c (p_bracket): Don't simplify singleton in the invert
	case.
	(p_b_term): Handle early end of pattern after dash in bracket
	expression.
	(singleton): Don't ignore the wides just because there's already a
	singleton in the single byte chars.  Fix condition for a singleton
	wide accordingly.
	(findmust): Check for LC_CTYPE charset, rather than LC_COLLATE charset.
	* regex2.h (CHIN): Fix condition in the icase & invert case.
	(ISWORD): Fix wrong cast to unsigned char.
2010-02-11 21:19:19 +00:00
Corinna Vinschen 9bb1d645b3 * new-features.sgml (ov-new1.7.2): Rephrase getlocale entry. 2010-02-11 11:39:58 +00:00
Corinna Vinschen 583c495774 * getlocale.c (main): Rename local variable to avoid problems.
Avoid string comparisons, rather test language and sublanguage codes
	wheere possible.  Add more code to handle Serbian language/territory
	state identical on all Windows versions.  Fix handling for "@latin"
	modifier in Belarusian locale.
	* utils.sgml (getlocale): Try to make wording and example clearer.
2010-02-11 11:39:23 +00:00
Corinna Vinschen 87c0903113 * nlsfuncs.cc (initial_setlocale): Move check whether charset has
changed from here...
	(internal_setlocale): ...to here, to avoid unnecessary work when invoked
	via CW_INT_SETLOCALE.
2010-02-11 10:04:51 +00:00
Corinna Vinschen 374a555fda * getlocale.c (usage): Change text slightly. 2010-02-10 15:58:59 +00:00
Corinna Vinschen bb6d8123db * getlocale.c (main): Restrict -a loop to avoid psudo language entries
on Vista and later.
2010-02-10 12:39:40 +00:00
Corinna Vinschen 96cbb3a380 * getlocale.c (main): Revamp -a loop to avoid duplicates and to print
locales with the correct, supported modifiers.
2010-02-10 12:36:29 +00:00
Corinna Vinschen 3b994b1249 * new-features.sgml (ov-new1.7.2): Add LC_MESSAGES support.
* setup2.sgml (setup-locale-ov): Change "@euro" modifier description.
	(setup-locale-missing): Remove.
2010-02-10 12:34:54 +00:00
Corinna Vinschen 4f1c922e06 * nlsfuncs.cc (__set_charset_from_locale): Allow "@euro" modifier only
for locales which use EUR as currency.
2010-02-10 12:29:26 +00:00
Corinna Vinschen ae40237a0a * nlsfuncs.cc (__get_lcid_from_locale): Convert iu_CA to iu-Latn-CA
rather than iu-Cans-CA on Vista and later.
	(__set_charset_from_locale): Set default charset for iu_CA to UTF-8.
2010-02-10 10:44:21 +00:00
Christopher Faylor 3700578ee8 * dcrt0.cc (_dll_crt0): Set _main_tls as early as possible.
* thread.cc (pthread_mutex::can_be_unlocked): Remove check for
MUTEX_OWNER_ANONYMOUS since it is racy and unsafe.
(pthread::init_mainthread): Initialize thread directly from _my_tls.
(pthread::self): Ditto.
(pthread::get_tls_self_pointer): Delete.
(pthread_mutex::pthread_mutex): Use an event rather than a semaphore.
(pthread_mutex::lock): Rename from _<func>.  Derive self directly.
(pthread_mutex::tryunlock): Ditto.
(pthread_mutex::destroy): Ditto.
(pthread_mutex::unlock): Ditto.  Accommodate change from semaphore to event.
(pthread_mutex::_fixup_after_fork): Accommodate change from semaphore to event.
(pthread_mutex::init): Don't attempt to initialize a semaphore unless it is in
an initialized state.  Do this check under mutex_initialization_lock.lock
* thread.h (fast_mutex::init): Use event rather than semaphore.
(fast_mutex::lock): Ditto.
(pthread_mutex::_lock): Delete.
(pthread_mutex::_unlock): Ditto.
(pthread_mutex::_trylock): Ditto.
(pthread_mutex::_destroy): Ditto.
(pthread_mutex::get_pthread_self): Ditto.
(pthread_mutex::get_tls_self_pointer): Ditto.
(pthread_mutex::lock): Un-inline.
(pthread_mutex::unlock): Ditto.
(pthread_mutex::trylock): Ditto.
(pthread_mutex::destroy): Ditto.
2010-02-10 07:25:26 +00:00
Christopher Faylor 161387a725 * cygtls.h (struct _cygtls): Remove unneeded elements.
* thread.cc (pthread::exit): Avoid potential double call to _my_tls.remove.
* tlsoffsets.h: Regenerate.
2010-02-10 03:17:32 +00:00
Corinna Vinschen 23a4a3517f * nlsfuncs.cc (lc_wcstombs): Add `return_invalid' flag to specify
whether invalid chars should be ignored or not.  Change comment.
	(__set_lc_monetary_from_win): Call lc_wcstombs with return_invalid
	flag set.
	(__set_lc_messages_from_win): Simplify to accommodate the fact that
	lc_wcstombs just ignores invalid chars.  Explain why.
2010-02-09 12:22:26 +00:00
Corinna Vinschen 3d9e3644ee * nlsfuncs.cc (__set_lc_messages_from_win): Fix typo. 2010-02-09 11:44:03 +00:00
Corinna Vinschen 9008eb4041 * lc_msg.h: New file, fix a problem in locales with modifiers. 2010-02-09 11:38:44 +00:00
Corinna Vinschen 09dfe7e025 * lc_msg.h: New file, generated from running Linux system. 2010-02-09 11:16:38 +00:00
Corinna Vinschen 502a4f52ed * lc_msg.h: New file, autogenerated from CLDR data.
* nlsfuncs.cc: Include lc_msg.h.
	(lc_time_buf): Remove.
	(lc_numeric_buf): Remove.
	(lc_monetary_buf): Remove.
	(lc_mbstowcs): Fix previous fix.
	(__set_lc_time_from_win): Take additional pointer to buffer pointer,
	defined in newlib.
	(__set_lc_numeric_from_win): Ditto.
	(__set_lc_monetary_from_win): Ditto.
	(locale_cmp): New static function.
	(__set_lc_messages_from_win): New function to be called from newlib.
2010-02-09 08:59:49 +00:00
Corinna Vinschen 2f27950afb Now *really* check in what should have been checked in 12 hours ago. 2010-02-08 21:33:59 +00:00
Corinna Vinschen 4dce4255ff This patch got lost in the previous checkin, accidentally:
* nlsfuncs.cc (lc_mbstowcs): Fix call to f_mbtowc.
2010-02-08 09:55:35 +00:00
Corinna Vinschen f5a73638cd * external.cc (cygwin_internal): Add CW_INT_SETLOCALE case to
allow to call internal_setlocale().
	* nlsfuncs.cc (internal_setlocale): Make externally available.
	* include/cygwin/version.h: Bump API minor number.
	* include/sys/cygwin.h (cygwin_getinfo_types): Add CW_INT_SETLOCALE.

	* nlsfuncs.cc (lc_mbstowcs): Fix call to f_mbtowc.
	(__set_locale_from_locale_alias): Ignore "@cjknarrow" modifier.
2010-02-08 09:52:40 +00:00
Yaakov Selkowitz b6ab02dea8 * new-features.sgml (ov-new1.7-misc): Fix typo. 2010-02-07 22:06:16 +00:00
Corinna Vinschen ab6ef08082 * nlsfuncs.cc (__get_lcid_from_locale): Handle "@cyrillic" modifier
for uz_UZ locale here.
	(__set_charset_from_locale): Accommodate above change.
2010-02-07 17:35:59 +00:00
Corinna Vinschen 8803e713c7 * new-features.sgml (ov-new1.7.2): Add support for locales from
/usr/share/locale/locale.alias.
	* setup2.sgml (setup-locale-ov): Ditto.
2010-02-07 13:42:49 +00:00
Corinna Vinschen 07d061aeec * nlsfuncs.cc (__set_locale_from_locale_alias): New function to read
locale aliases from /usr/share/locale/locale.alias.
2010-02-07 13:31:08 +00:00
Corinna Vinschen 689109a76f * nlsfuncs.cc (__get_lcid_from_locale): Handle no_NO as nb_NO, rather
than nn_NO.
2010-02-06 21:57:33 +00:00
Corinna Vinschen 573df59cd4 * setup2.sgml (setup-locale-ov): Align description of working modifiers
to latest changes.
2010-02-06 21:41:05 +00:00
Corinna Vinschen 28d3c4fa38 * nlsfuncs.cc (has_modifier): MOve up in file to use in
__get_lcid_from_locale as well.
	(__get_lcid_from_locale): Handle no_NO locale as alias for nn_NO.
	Default all sr_XY locales to Cyrillic script.  Change lcid to Latin
	script if "@latin" modifier has been specified.
	(__set_charset_from_locale): Handle Serbian in codepage 1251 case as
	well.  Also check for sr_BA lcid.  Restrict "@euro" modifier to
	locales otherwise defaulting to ISO-8859-1.
2010-02-06 21:40:53 +00:00
Corinna Vinschen 3673ff5968 * new-features.sgml (ov-new1.7.2): Add support for new charsets.
Change text for modifier support.
	(setup-locale-charsetlist): Add new GEORGIAN-PS and PT154 charsets
	to list of supported charsets.  Reorder list for non-ISO, non-CP
	charsets alphabetically.
2010-02-06 18:33:40 +00:00
Corinna Vinschen b6b236270e * nlsfuncs.cc (__set_charset_from_locale): Set default charset for
"ka_GE" locale to GEORGIAN-PS, for "kk_KZ" to PT154.
2010-02-06 18:30:18 +00:00
Corinna Vinschen 38d9821daf * path.cc (symlink_info::check_nfs_symlink): Reopen file with
FILE_READ_EA access since, surprisingly, you need it to read EAs even
	on NFS.
2010-02-06 15:57:21 +00:00
Corinna Vinschen b96600ef91 * sec_auth.cc (get_full_privileged_inheritable_token): New function
to fetch token with full privileges from logon token in Vista and
	later, and to make token inheritable.  Add lengthy comments to explain
	the function's job.
	(cygwin_logon_user): Drop calling SetHandleInformation.  Enable TCB
	privilege and call get_full_privileged_inheritable_token.
	(lsaauth): Don't fetch linked token and don't make handle inheritable
	here, just call get_full_privileged_inheritable_token instead.
	(lsaprivkeyauth): Ditto.
2010-02-06 13:13:15 +00:00
Corinna Vinschen e90f14f5d3 * setup2.sgml (setup-locale-ov): Add description for "uz_UZ@cyrillic"
and "tt_RU@iqtelif" modifiers.  Slightly rephrase locale specifier
	description in terms of the modifier string.
2010-02-05 21:38:31 +00:00
Corinna Vinschen 207889c9a7 * nlsfuncs.cc (__set_charset_from_locale): Set default locale for
"uz_UZ" locale to ISO-8859-1, with the "@cyrillic" modifier to UTF-8.
2010-02-05 21:35:34 +00:00
Christopher Faylor e7fd08839e * dll_init.cc (per_module::run_dtors): Use consistent method for running
destructors.
2010-02-05 15:05:22 +00:00
Corinna Vinschen 8c9c8fa938 * new-features.sgml (ov-new1.7.2): Add grouping for printf/wprintf. 2010-02-05 08:57:32 +00:00
Christopher Faylor 6e3f2c626d * regcomp.c (p_ere): Workaround incorrect compiler warning.
* regerror.c (regatoi): Return non-const string or compiler complains in
certain inexplicable situations.
2010-02-04 21:05:07 +00:00
Corinna Vinschen aec8c3d510 * regex/engine.c (step): Declare and define with `int ch' rather than
`wint_t ch' parameter.  Explain why.
	(NONCHAR): Remove related Cygwin patch here, including wrong comment.
2010-02-04 17:34:44 +00:00
Corinna Vinschen 4db9544f4f * new-features.sgml (ov-new1.7.2): Add multibyte-awareness of regcomp
and regexec.
2010-02-04 12:38:00 +00:00
Corinna Vinschen e1e595a649 Replace regex files with multibyte-aware version from FreeBSD.
* Makefile.in (install-headers): Remove extra command to install
	regex.h.
	(uninstall-headers): Remove extra command to uninstall regex.h.
	* nlsfuncs.cc (collate_lcid): Make externally available to allow
	access to collation internals from regex functions.
	(collate_charset): Ditto.
	* wchar.h: Add __cplusplus guards to make C-clean.
	* include/regex.h: New file, replacing regex/regex.h.  Remove UCB
	advertising clause.
	* regex/COPYRIGHT: Accommodate BSD license.  Remove UCB advertising
	clause.
	* regex/cclass.h: Remove.
	* regex/cname.h: New file from FreeBSD.
	* regex/engine.c: Ditto.
	(NONCHAR): Tweak for Cygwin.
	* regex/engine.ih: Remove.
	* regex/mkh: Remove.
	* regex/regcomp.c: New file from FreeBSD.  Tweak slightly for Cygwin.
	Import required collate internals from nlsfunc.cc.
	(p_ere_exp): Add GNU-specific \< and \> handling for word boundaries.
	(p_simp_re): Ditto.
	(__collate_range_cmp): Define.
	(p_b_term): Use Cygwin-specific collate internals.
	(findmust): Ditto.
	* regex/regcomp.ih: Remove.
	* regex/regerror.c: New file from FreeBSD.  Fix a few compiler warnings.
	* regex/regerror.ih: Remove.
	* regex/regex.7: New file from FreeBSD.  Remove UCB advertising clause.
	* regex/regex.h: Remove.  Replaced by include/regex.h.
	* regex/regexec.c: New file from FreeBSD.  Fix a few compiler warnings.
	* regex/regfree.c: New file from FreeBSD.
	* regex/tests: Remove.
	* regex/utils.h: New file from FreeBSD.
2010-02-04 12:35:49 +00:00
Christopher Faylor 66dd5c4ff5 * sigproc.cc (get_proc_lock): Fix error message typo. 2010-02-03 19:57:05 +00:00
Corinna Vinschen 4a49c71595 * fhandler_disk_file.cc (fhandler_base::fstat_helper): Workaround
another bug in NWFS.  Add comment to explain why.  Improve debug output
	in case the NT calls to test for binary fail.
	* path.h (path_conv::fs_is_cifs): New method.
	(path_conv::fs_is_nwfs): New method.
2010-02-03 16:05:33 +00:00
Corinna Vinschen fac3c73ba0 * include/paths.h (_PATH_MNTTAB): Define.
(_PATH_MOUNTED): Define.
	* include/mntent.h: Include paths.h.  Define MNTTAB and MOUNTED as their
	paths.h equivalents.  Add comment.
2010-02-02 11:17:54 +00:00
Christopher Faylor fc6a0dc849 * dcrt0.cc (atexit_lock): Delete.
(cygwin_exit): Remove atexit lock.
(cygwin_atexit): Ditto.  Rename parameter to match newlib.  Call __cxa_atexit
when invoked by a registered DLL.
* dll_init.cc (remove_dll_atexit): Delete.
(dll_list::find): New function.
(dll_list::detach): Use dll_list::find to find dll associated with return
address.  Use __cxa_finalize to run atexit functions associated with the dll.
(cygwin_detach_dll): Don't assume that HANDLE == void *.
* dll_init.h (dll_list::find): Declare.
(__cxa_atexit): Ditto.
(__cxa_finalize): Ditto.
* init.cc (dll_entry): Clarify comment.
2010-02-02 02:00:01 +00:00
Dave Korn a390615010 * how-startup-shutdown-works.txt: Add new document. 2010-02-02 01:54:55 +00:00
Yaakov Selkowitz 50da6b49ed * faq-programming.xml: Update for Cygwin docbook-utils package. 2010-02-02 01:18:03 +00:00
Yaakov Selkowitz 2972058a05 * README: Update for Cygwin docbook-utils package. 2010-02-02 01:02:49 +00:00
Corinna Vinschen 54c4a92634 * sec_auth.cc (lsaauth): Use CYG_LSA_MAGIC as checksum start value to
decouple from Cygwin release.
2010-01-29 19:51:11 +00:00
Corinna Vinschen cd5401de59 * cyglsa.c: Include lmcons.h instead of lm.h to make newer WinDDK happy.
(LsaApLogonUserEx): Use CYG_LSA_MAGIC as checksum start value to
	decouple from Cygwin release.
	* make-64bit-version-with-visual-c.bat: Avoid compiler warning.
	* cyglsa64.dll: New build.
2010-01-29 19:50:15 +00:00
Corinna Vinschen 0b189c1ef3 * libc/strfmon.c (__setup_vars): Test for an empty string rather than
for a NULL pointer.
2010-01-29 19:38:22 +00:00
Christopher Faylor d5c4cd3f6c * dll_init.cc (remove_dll_atexit): New function.
(dll_list::detach): Run any atexit handlers registered in the DLL prior to
unloading.
2010-01-29 18:34:09 +00:00
Christopher Faylor 2b37c431b1 * libc/strfmon.c (__setup_vars): Fix compiler warning about assigning const
strings.  Compare a pointer to NULL rather than '\0'.
* dll_init.cc (dll_dllcrt0_1): Minor comment fix.
* pipe.cc (fhandler_pipe::create_selectable): Remove Win9x accommodation.
2010-01-29 17:37:54 +00:00
Corinna Vinschen 3432d6f1f7 Throughout, use FileBothDirectoryInformation info class rather than
FileDirectoryInformation info class to avoid problems with incomplete
	filesystem implementations.  Fix comments accordingly.
	* fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Set
	fname->Length to 0 in error case to avoid potential crash in debug
	output.
	(fhandler_disk_file::readdir): Try to speed up the working default case.
	Check for STATUS_INVALID_NETWORK_RESPONSE as potential status value
	returned by filesystems not implementing FileIdBothDirectoryInformation.
	* ntdll.h (STATUS_INVALID_NETWORK_RESPONSE): Define.
	(FILE_BOTH_DIRECTORY_INFORMATION): Rename to official name.
	* path.cc (symlink_info::check): Don't request FILE_READ_EA access, it's
	not required for NFS.  Try to speed up the working default case.  Check
	for STATUS_INVALID_NETWORK_RESPONSE as potential status value returned
	by filesystems not supporting non-NULL EA parameters.  Fix the way
	fs.update is called.  Improve debug output.
2010-01-29 11:20:06 +00:00
Chris Sutcliffe 3d635c060e 2010-01-26 Chris Sutcliffe <ir0n3h4d@users.sourceforge.net>
* include/shldisp.h (AUTOCOMPLETEOPTIONS): Add version guard around
        ACO_WORD_FILTER and ACO_NOPREFIXFILTERING.
2010-01-29 00:41:58 +00:00
Corinna Vinschen 1b52d127bd * Makefile.in (tags, ctags, CTAGS)): Add rules to create tags file. 2010-01-28 11:54:00 +00:00
Chris Sutcliffe 6a69717458 2010-01-26 Chris Sutcliffe <ir0n3h4d@users.sourceforge.net>
* include/shldisp.h (AUTOCOMPLETEOPTIONS): Add enum.
2010-01-28 01:16:55 +00:00
Yaakov Selkowitz 954515b011 * faq-api.xml: d2u/u2d are from cygutils, not util-linux. 2010-01-26 19:26:59 +00:00
Christopher Faylor e9e924bfae * Makefile.in: Skip validation in xmlto step.
* overview.sgml: Clarify language in "A brief history of Cygwin".
2010-01-26 16:16:19 +00:00
Corinna Vinschen bd5e7d1efc * new-features.sgml (ov-new1.7.2): Add console enhancements. 2010-01-26 16:09:46 +00:00
Chris Sutcliffe d359eb2e1f 2010-01-25 Kai Tietz <kai.tietz@onevision.com>
Implement TLS Callback.

        * tlsmcrt.c: New file.
        * tlsmthread.c: Ditto.
        * tlssup.c: Ditto.
        * tlsthrd.c: Ditto.
        * Makefile.in: Include new files.
        * crt1.c: Implement TLS Callback.
        * dllcrt1.c: Ditto.
        * mthr_stub.c: Remove.
2010-01-25 22:58:03 +00:00
Corinna Vinschen 8944c6af48 * nlsfuncs.cc (__get_lcid_from_locale): Add comments. Fix typos in
comments.  Make sure to set last_lcid every time.  Return locale
	without territory part as invalid.  Handle modern serbian territory
	names per ISO 3166 on older systems as well.  Add appropriate comment.
	(__set_charset_from_locale): Handle LCID for sr_CS as well to make older
	systems happy.
2010-01-25 21:20:31 +00:00
Corinna Vinschen 9a3628f50c * faq-setup.xml: Drop references to non-NT systems.
* faq-using.xml: Ditto.
	(faq.using.sshd-in-domain): New FAQ entry.
2010-01-25 17:04:29 +00:00
Corinna Vinschen 0f8df291ac * nlsfuncs.cc (__set_charset_from_locale): Rearrange to set charset
more closely aligned to Glibc.
2010-01-25 11:55:46 +00:00
Corinna Vinschen 27ac64346f * spawn.cc (spawn_guts): Only try to remove long path prefix from
runpath if runpath is not NULL.
2010-01-25 11:21:56 +00:00
Corinna Vinschen aced35f883 * faq-using.xml: Fix typos and remove incorrect locale-specific
documentation.
	* new-features.sgml: Ditto.
	* pathnames.sgml: Ditto.
2010-01-25 10:50:21 +00:00
Corinna Vinschen 4fc8ae4f7b * nlsfuncs.cc (__get_lcid_from_locale): Fix a comment. Handle special
language/TERRITORY combinations explicitely.  Explain why.
2010-01-25 10:44:56 +00:00
Corinna Vinschen ca2b906d55 * getlocale.c (main): Use setlocale and fetch string from Windows
using GetLocaleInfoW.  Explain why.
2010-01-25 09:22:12 +00:00
Corinna Vinschen af7f57b9fb * new-features.sgml: Rework layout to use itemizedlist. Fix typo.
Add two missing entries.
2010-01-24 15:08:01 +00:00
Corinna Vinschen 05fab4a63b * nlsfuncs.cc (__set_charset_from_locale): Fix comment. 2010-01-24 14:43:51 +00:00
Corinna Vinschen 57c7e05ea7 * nlsfuncs.cc (check_codepage): Move from syscalls.cc here.
(internal_setlocale): Ditto.
	(initial_setlocale): Ditto.
	(setlocale): Ditto.
	* strfuncs.cc (__sjis_wctomb): Revert previous patch.
	(__sjis_mbtowc): Ditto.
	* syscalls.cc: Move setlocale-related functions to nlsfuncs.cc.
2010-01-24 12:29:49 +00:00
Corinna Vinschen 96697c23e4 * setup2.sgml (setup-locale-charsetlist): Add CP932. Change description
for SJIS.
2010-01-23 16:44:00 +00:00
Corinna Vinschen 6b121156cd * strfuncs.cc (__sjis_wctomb): Special handling for characters which
differ between SJIS and Windows codepage 932, if charset is "SJIS".
	(__sjis_mbtowc): Ditto.
	(_jis_wctomb): Remove.
	(__jis_mbtowc): Remove.
2010-01-23 16:43:17 +00:00
Corinna Vinschen e0c57463f0 * setup2.sgml (setup-locale-charsetlist): Add ASCII and TIS-620. Add
various aliases and case differences.
2010-01-23 15:03:06 +00:00
Corinna Vinschen e020bfa85b * nlsfuncs.cc (wcsxfrm): Call LCMapStringW with LCMAP_BYTEREV flag to
allow correct comparison using wcscmp.
2010-01-23 10:11:43 +00:00
Corinna Vinschen bc9fcc287d * posix.sgml (strfmon): Move to implemented SUSv4 API. 2010-01-22 22:33:22 +00:00
Corinna Vinschen ff0056d45e * new-features.sgml (ov-new1.7.2): Add chapter for news in 1.7.2.
* setup2.sgml (setup-locale-ov): Describe how valid locales are
	determined by Windows locale support.  Change description for modifiers
	in locale environment variables.
	(setup-locale-how): Describe new charset behaviour.  Mention new
	getlocale tool to fetch valid locale information from Windows.
	(setup-locale-missing): Drop now implemented LC_foo options.
	Explain missing LC_MESSAGES in more detail.
2010-01-22 22:32:42 +00:00
Corinna Vinschen be822de2a1 * Makefile.in (CYGWIN_BINS): Add getlocale.
* getlocale.c: New file.
	* utils.sgml (getlocale): New section describing new getlocale tool.
2010-01-22 22:31:50 +00:00
Corinna Vinschen 326fb376dd * Makefile.in (DLL_OFILES): Add nlsfunc.o and strfmon.o.
* autoload.cc (LocaleNameToLCID): Define.
	* cygwin.din (strfmon): Export.
	* nlsfuncs.cc: New file.  Define a lot of internal functions called
	from setlocale.
	(wcscoll): Implement locale-aware here, using CompareStringW function.
	(strcoll): Ditto.
	(wcsxfrm): Implement locale-aware here, usingLCMapStringW function.
	(strxfrm): Ditto.
	(__set_charset_from_locale): Replace __set_charset_from_codepage.
	Return Linux-compatible charset.
	* strfuncs.cc (__set_charset_from_codepage): Remove.
	* wchar.h (__set_charset_from_codepage): Drop definition.
	* wincap.h (wincaps::has_localenames): New element.
	* wincap.cc: Implement above element throughout.
	* libc/strfmon.c: New file.
	* libc/strptime.cc: Remove locale constant strings in favor of
	access to locale-specifc data.
	(strptime): Point _CurrentTimeLocale to locale-specific data.
	Throughout use correct locale-specific format fields for all
	locale-specific formats.
	* include/monetary.h: New file.
	* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2010-01-22 22:31:31 +00:00
Corinna Vinschen 43b4aa0f7c * strfuncs.cc: Remove needless includes. 2010-01-18 16:07:22 +00:00
Corinna Vinschen 0b8e38dd8b * setup2.sgml (setup-locale): Mention three character codes per
ISO 639-3.

	* setup2.sgml (setup-locale): Adapt description to the C using ASCII
	change in 1.7.2.
2010-01-17 14:55:57 +00:00
Corinna Vinschen 62910474ac * syscalls.cc (internal_setlocale): Use UTF-8 internally if external
charset is ASCII.
2010-01-17 09:41:01 +00:00
Christopher Faylor e6bda02346 * setup-net.sgml: Remove obsolete assertion. 2010-01-16 18:06:27 +00:00
Corinna Vinschen 011560c87d * libc/fnmatch.c: Replace with multibyte capable version from FreeBSD. 2010-01-16 15:11:56 +00:00
Corinna Vinschen 1b526b480b * cygpath.cc (get_mixed_name): Drop function. Replace with call to
convert_slashes throughout.
	(do_sysfolders): Free allocated buffer.
	(do_pathconv): Fix freeing last buffer.
2010-01-16 10:25:58 +00:00
Corinna Vinschen 1a8d1e1040 * fhandler_socket.cc (fhandler_socket::accept4): Reset async flag
on accepted socket.
2010-01-16 10:22:58 +00:00
Corinna Vinschen 2b24bd4898 * faq-using.xml (faq.using.bloda): Clarify wxvault.dll. 2010-01-15 21:41:47 +00:00
Corinna Vinschen 9d5bf1b13c * fhandler_socket.cc (fhandler_socket::accept4): Set nonblocking
flag exactly according to flags, as on Linux.
	* net.cc (cygwin_accept): Maintain BSD semantics here.
2010-01-15 21:34:27 +00:00
Christopher Faylor be0ca195b9 * faq-setup.xml: Add missing setup options. Sort options. 2010-01-15 18:47:31 +00:00
Corinna Vinschen 0d6531551b * cygwin.din (accept4): Export.
* fhandler.h (fhandler_socket::accept4): Rename from accept.  Take
	additional flag parameter.
	* fhandler_socket.cc (fhandler_socket::accept4): Ditto.  Handle
	SOCK_NONBLOCK and SOCK_CLOEXEC flags.
	* net.cc (cygwin_socket): Handle SOCK_NONBLOCK and SOCK_CLOEXEC flags
	in type.  Check for invalid flag values.
	(socketpair): Ditto.
	(cygwin_accept): Accommodate renaming of fhandler_socket::accept
	function to accept4.
	(accept4): New function.
	* posix.sgml: Mention accept4 as GNU extensions.
	* include/cygwin/socket.h (SOCK_NONBLOCK): Define.
	(SOCK_CLOEXEC): Define.
	(_SOCK_FLAG_MASK): Define when building Cygwin.
	* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
	* include/sys/socket.h (accept4): Declare.
2010-01-15 15:40:05 +00:00
Corinna Vinschen 14c800a5ba * posix.sgml: Mention dup3 and pipe2 as GNU extensions. 2010-01-15 14:22:42 +00:00
Corinna Vinschen 41d184bb62 * dcrt0.cc (dll_crt0_1): Reset locale to "C" at the last moment before
calling the application's main.
	* syscalls.cc (internal_setlocale): Don't reset locale to "C here.
	Change comment accordingly.
2010-01-14 18:56:24 +00:00
Corinna Vinschen e70fdfb99f * cygwin.din (dup3): Export.
(pipe2): Export.
	* dtable.cc (dtable::dup_worker): Take additional flags parameter.
	Handle O_CLOEXEC flag.
	(dtable::dup3): Rename from dup2.  Take additional flags parameter.
	Check for valid flags.  Drop check for newfd == oldfd.
	* dtable.h (dtable::dup_worker): Add flags parameter.
	(dtable::dup3): Rename from dup2.
	* fcntl.cc (fcntl64): Add F_DUPFD_CLOEXEC case.
	* fhandler.h (fhandler_mailslot::get_object_attr): Add flags parameter.
	* fhandler.cc (fhandler_base::open): Use security attribute with
	inheritance according to setting of O_CLOEXEC flag.
	* fhandler_console.cc (fhandler_console::open): Ditto.
	* fhandler_fifo.cc (sec_user_cloexec): New inline function to
	create security attribute with inheritance according to setting of
	O_CLOEXEC flag.
	(fhandler_fifo::open): Call sec_user_cloexec to fetch security
	attribute.
	(fhandler_fifo::wait): Ditto.
	* fhandler_mem.cc (fhandler_dev_mem::open): Ditto.
	* fhandler_mailslot.cc (fhandler_mailslot::get_object_attr): Take
	additional flags parameter.  Use security attribute with inheritance
	according to setting of O_CLOEXEC flag.
	(fhandler_mailslot::open): Call get_object_attr with flags parameter.
	* fhandler_registry.cc (fhandler_registry::open): Call set_close_on_exec
	on real handles to accommodate O_CLOEXEC flag.
	* fhandler_tty.cc (fhandler_tty_slave::open): Ditto.
	* fhandler_tape.cc: Create mutex with inheritance according to setting
	of O_CLOEXEC flag.
	* pipe.cc: Replace usage of O_NOINHERIT with O_CLOEXEC.
	 (fhandler_pipe::init): Simplify setting close_on_exec flag.
	(fhandler_pipe::open): Remove setting close_on_exec flag.
	(fhandler_pipe::create): Use security attribute with inheritance
	according to setting of O_CLOEXEC flag.
	(pipe2): New exported function.
	* posix_ipc.cc: Throughout, open backing files with O_CLOEXEC
	flag to follow POSIX semantics.
	* security.h (sec_none_cloexec): New define.
	* syscalls.cc (dup): Add missing extern "C" qualifier.  Accommodate
	renaming of dtable::dup2 to dtable::dup3.
	(dup2): Ditto.  Check newfd == oldfd here.
	(dup3): New function.  Check newfd == oldfd here.
	(open): Set close_on_exec flag according to O_CLOEXEC flag before
	calling fhandler->open.
	* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2010-01-14 18:46:02 +00:00
Corinna Vinschen 811de4bff3 * include/fcntl.h (O_TTY_INIT): Define as 0. 2010-01-13 16:51:37 +00:00
Corinna Vinschen c013520152 * fhandler_tty.cc (fhandler_tty_master::init): Don't erase all default
termios settings of slave console.
2010-01-13 11:06:21 +00:00
Corinna Vinschen 4bcdec7276 * syscalls.cc (rename): Don't exit prematurely with EROFS when trying
to rename an AF_LOCAL socket or when trying to replace an AF_LOCAL
	socket.
2010-01-13 09:45:18 +00:00
Corinna Vinschen 4aab0ed828 * cygwinenv.sgml (cygwinenv-implemented-options): Try to make
compatibility new symlinks vs. old Cygwin clearer.
2010-01-12 16:40:53 +00:00
Corinna Vinschen c04ed45d82 * globals.cc (ro_u_nwfs): New R/O unicode string.
* mount.cc (fs_info::update): Check for NWFS filesystem.  Set
	has_buggy_basic_info, if so.  Add comment to explain why.
	(fillout_mntent): Add "nwfs" string to fs_names array.
	* mount.h (enum fs_info_type): Add nwfs.
	(class fs_info): Add has_buggy_basic_info status flag.  Add accessors
	for has_buggy_basic_info and is_nwfs.
	* fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Accommodate
	filesystems with broken FileBasicInformation handling.
	* path.cc (symlink_info::check): Ditto.
	* path.h (path_conv::has_buggy_basic_info): Add method.
2010-01-12 14:47:46 +00:00
Corinna Vinschen 4ee93264fd * dtable.cc (build_fh_name_worker): Remove. Move all functionality
back into build_fh_name.
	(build_fh_name): Drop unused HANDLE parameter.  Drop call to pc.fillin.
	Remove disabled build_fh_name with UNICODE_STRING name parameter.
	* dtable.h (build_fh_name): Drop HANDLE parameter from declaration.
	Remove declaration for build_fh_name with UNICODE_STRING name parameter.
	* path.cc (path_conv::fillin): Remove.
	(symlink_info::check): Fix comment.
	* path.h (path_conv::fillin): Remove declaration.
	* dir.cc: Accommodate change in build_fh_name parameters throughout.
	* sec_acl.cc: Ditto.
	* syscalls.cc: Ditto.

	* ntea.cc (getxattr_worker): Fix debug output.
	(setxattr_worker): Ditto.
	* times.cc (utimens_worker): Ditto.
2010-01-12 10:14:59 +00:00
Corinna Vinschen 2e74cde7cb * pathnames.sgml (mount-table): Add info that posix=0 is default for
the cygdrive prefix.
2010-01-11 18:00:14 +00:00
Corinna Vinschen 523a66d91d * fhandler_proc.cc (format_proc_stat): Use new in_buf.
(format_proc_cpuinfo): Replace szBuffer with a union in_buf.  Use type
	correct throughout.  Add a couple of missing or newer cpu flags.  Allow
	certain AMD flags for intel as well.
2010-01-11 15:10:21 +00:00
Corinna Vinschen f380ca5803 * mount.cc (do_mount_from_fstab): Allow to change cygdrive prefix, too. 2010-01-11 12:13:55 +00:00
Corinna Vinschen f1817d368a * fhandler.h (fhandler_base::fstat_helper): Declare timestamps as
PLARGE_INTEGER.
	* fhandler_disk_file.cc (fhandler_base::fstat_by_handle):
	Accommodate fstat_helper change of timestamp arguments.
	(fhandler_base::fstat_by_name): Ditto.
	(fhandler_base::fstat_helper): Define with timestamps as PLARGE_INTEGER.
	Accommodate in call to to_timestruc_t.
2010-01-10 11:12:52 +00:00
Corinna Vinschen 9f00d74664 * sec_auth.cc (get_token_group_sidlist): Add BUILTIN\Users account
to all created tokens.
	* sec_helper.cc (well_known_users_sid): Define as BUILTIN\Users.
	* security.h (well_known_users_sid): Declare.
2010-01-08 15:55:27 +00:00
Corinna Vinschen bf4b80201a * cygpath.cc: Throughout, free obsolete path buffers. 2010-01-07 17:19:12 +00:00
Corinna Vinschen 781be3b173 * overview.sgml: Fix Red Hat brand name. 2010-01-07 12:18:01 +00:00
Corinna Vinschen 6004370ba1 * cygpath.cc (main): Remove enforcing "en_US.UTF-8" locale.
Revert usage of argz functions when reading input from file and
	simplify option usage.  Allow only one option argument and use
	the rest as filename argument to allow spaces in filenames.  Restrict
	processing special folder type options to one line.
2010-01-07 12:08:11 +00:00
Christopher Faylor 37f42cc1c8 * overview.sgml: Fix Red Hat URL. 2010-01-04 16:24:06 +00:00
Christopher Faylor e1212c436b * dcrt0.cc: Bump copyright.
Do the changelog shuffle.
2010-01-01 19:28:15 +00:00
Christopher Faylor 1afba8e5f2 * dcrt0.cc (dll_crt0_1): Move internal locale setting prior to potential
globify to prevent creation of unglobbed filenames in the wrong character set.
2010-01-01 19:15:11 +00:00
Corinna Vinschen 935d37f116 * fhandler.h (fhandler_socket::wait_for_events): Drop parameter default
value.
	* fhandler_socket.cc (fhandler_socket::connect): Add false as second
	parameter to wait_for_events call.
	(fhandler_socket::accept): Ditto.
	(fhandler_socket::send_internal): Fix typo in call to wait_for_events.
2009-12-28 17:24:03 +00:00
Eric Blake 1c0a4c3a8e Make pty.h match recent glibc.
* include/pty.h (openpty, forkpty): Mark last two arguments const,
to match glibc 2.8.
* libc/bsdlib.cc (openpty, forkpty): Likewise.
2009-12-26 06:20:56 +00:00
Christopher Faylor 37520977df * fhandler_console.cc (handler_console::read): Use the tty's VERASE character
as the backspace keycode.
2009-12-25 17:38:46 +00:00
Corinna Vinschen 14c622c6e3 * path.cc (symlink_info::check): Set fileattr to
FILE_ATTRIBUTE_DIRECTORY in a certain error condition.  Explain why.
2009-12-24 12:53:43 +00:00
Corinna Vinschen daee16e053 * pathnames.sgml (mount-table): Add missing slash in pathname. 2009-12-23 10:43:45 +00:00
Christopher Faylor 4c9a77261e * select.cc (fhandler_fifo::select_read): Fill in device specific record.
(fhandler_fifo::select_write): Ditto.
(fhandler_fifo::select_except): Ditto.
2009-12-23 00:35:18 +00:00
Corinna Vinschen 59cb363a5f * path.cc (cygwin_conv_path): Add band-aid including comment to avoid
conversion from POSIX "." to Win32 ".\\".
2009-12-21 16:44:37 +00:00
Corinna Vinschen 6d63272b53 * exec.cc (execvp): Call find_exec with FE_NNF flag to enforce
a NULL return when executable isn't found in $PATH.  Convert NULL
	to "".
	(execvpe): Ditto.
	* spawn.cc (spawn_guts): Return with EFAULT if prog_arg is NULL.
	Return with ENOENT if prog_arg is empty string.  Add a comment.
2009-12-21 15:16:28 +00:00
Corinna Vinschen b2d6e5dfd3 * fhandler_console.cc (get_nonascii_key): Generate ESC prefix
for Alt modifier generically for function keys and keypad keys.
	Distinguish Normal, Ctrl, Shift, Ctrl-Shift rather
	than Normal, Ctrl, Shift, Alt, so that in combination with generic
	Alt handling all 8 combinations of these modifiers are distinguished.
	(keytable): Add escape sequences for remaining modified
	function keys as a compatible extension using rxvt escape codes.
	Also distinguish keypad keys modified with Ctrl, Shift, Ctrl-Shift
	using xterm-style modifier coding.
2009-12-21 10:11:27 +00:00
Corinna Vinschen 1b71ce005c Throughout, revert ill-conceived replacement of hMainThread with
GetCurrentThread/NtCurrentThread.
	* dcrt0.cc (dll_crt0_0): Duplicate main thread handle to hMainThread
	again.
2009-12-21 09:38:25 +00:00
Corinna Vinschen 57a2873a5d * fhandler_console.cc (__vt100_conv): Minor formatting change. 2009-12-19 15:40:31 +00:00
Corinna Vinschen 8fd4bd2bf1 * fhandler_console.cc (write_console): Check for VT100
graphics mode and transform wide characters in ASCII small
	letter range to corresponding graphics.
	(__vt100_conv): Table to transform small ASCII letters to line
	drawing graphics for use in VT100 graphics mode.
	(write_normal): Check for SO/SI control characters to
	enable/disable VT100 graphics mode.
	(base_chars): Enable SO/SI control characters for detection.
	(write): Check for ESC ( 0 / ESC ( B escape sequences to
	enable/disable VT100 graphics mode. Also detect ">" while
	parsing ESC [ sequences to distinguish specific requests.
	(char_command): Distinguish Secondary from Primary Device Attribute
	request to report more details about cygwin console terminal version.
	* fhandler.h (vt100_graphics_mode_active): New flag to indicate mode.
	(saw_greater_than_sign): New parse flag for ESC [ > sequences.
	(gotparen, gotrparen): New state values to parse ESC ( / ) sequences.

	* fhandler_console.cc (read): Allow combined Alt-AltGr modifiers
	to also produce an ESC prefix like a plain Alt modifier, e.g. to make
	Alt-@ work on a keyboard where @ is AltGr-q.
2009-12-19 15:37:10 +00:00
Eric Blake d954168ddb * signal.cc (nanosleep): Fix bug in previous patch. 2009-12-19 00:58:34 +00:00
Corinna Vinschen f16706de97 Throughout, replace hMainProc with GetCurrentProcess/NtCurrentProcess
according to context.  Throughout, replace hMainThread with
	GetCurrentThread/NtCurrentThread according to context.
	* dcrt0.cc (dll_crt0_0): Drop duplication of GetCurrentProcess to
	hMainProc.  Drop duplication of GetCurrentThread to hMainThread.
	* dtable.cc (dtable::stdio_init): Remove useless comment.
	* globals.cc (hMainProc): Remove.
	(hMainThread): Remove.
	* ntdll.h (NtCurrentProcess): Define.
	(NtCurrentThread: Define.
2009-12-18 20:32:04 +00:00
Corinna Vinschen 333a47d316 * fhandler.h (fhandler_registry::value_name): Convert to wchar_t*.
* fhandler_registry.cc: Call UNICODE registry functions throughout
	and convert to multibyte using current locale's charset.  Accommodate
	throughout.
	(must_encode): Take wchar_t.
	(encode_regname): Convert from wchar_t *.
	(decode_regname): Convert to wchar_t *.
2009-12-18 17:14:21 +00:00
Corinna Vinschen ae8547442b * path.sgml (func-cygwin-conv-path): Clarify meaning of size parameter.
(func-cygwin-conv-path-list): Fix typo.
	(func-cygwin-posix-path-list-p): Ditto.
2009-12-18 10:11:56 +00:00
Christopher Faylor d0e99ecc19 * ps.cc (main): Return 0 if pid found. 2009-12-18 03:34:59 +00:00
Corinna Vinschen 314c2d2fed * syscalls.cc (try_to_bin): Handle remote shares as well. Just rename
files in this case, instead of moving them to the recycler.  Create
	even more unique filename.  Add comment to explain filename.
	(unlink_nt): Remove code returning with EBUSY on remote shares.
	Set bin_stat to move_to_bin except on NFS.  Add comment to explain.
2009-12-17 18:33:05 +00:00
Eric Blake 214f44da10 * signal.cc (nanosleep): Support 'infinite' sleep times.
(sleep): Avoid uninitialized memory.
2009-12-17 14:04:04 +00:00
Corinna Vinschen beeae48288 * fhandler_console.cc (read): Detect and handle mouse wheel scrolling
events (for completion of mouse reporting mode 1000) and mouse
	movement events (for additional mouse reporting modes 1002 and 1003).
	Use mouse_aware() as a guard and only condition for mouse
	reporting in order to enforce consistence of read() and select().
	Add focus reports (for additional focus reporting mode 1004).
	(mouse_aware): Enable detection of additional mouse events for select().
	Tune function to precisely match actual reporting criteria.
	Move adjustment of mouse position (by window scroll offset)
	here to avoid duplicate code.
	(char_command): Initialization of enhanced mouse reporting modes.
	Initialization of focus reporting mode.
	* fhandler.h (use_mouse): Change flag (bool->int) to indicate
	additional mouse modes. Add flag to indicate focus reporting.
	(mouse_aware): Move enhanced function into fhandler_console.cc.
	* select.cc (peek_console): Use modified mouse_aware() for more
	general detection of mouse events. Also check for focus reports.
2009-12-16 14:56:10 +00:00
Corinna Vinschen 7077c48e54 * regtool.cc: Throughout, convert all registry calls to wide char
calls and use string conversion according to current locale.
	(longopts): Change "dword-le" to "dword-be", as was originally
	intended.
	(usage): Change usage accordingly.
	(print_version): Simplify copyright dates in output.
	(cmd_list): Handle REG_LINK like REG_SZ.
	(cmd_get): Ditto.
	(main): Call setlocale.
	* utils.sgml (regtool): Fix options and add missing descriptions for
	new features.
2009-12-16 14:02:57 +00:00
Corinna Vinschen d1600b38c0 * registry.cc (cygnus_class): Remove.
(reg_key::build_reg): Don't set class when creating key.
2009-12-16 13:09:46 +00:00
Corinna Vinschen 2f5d8f7bd0 * net.cc (cygwin_setsockopt): Only skip calling setsockopt(SO_REUSEADDR)
on stream sockets under systems supporting enhanced socket security.
2009-12-15 17:08:20 +00:00
Corinna Vinschen f04f6d49fa * fhandler_console.cc (char_command): Fix code to select dim mode
to 2 rather than 9.  Add entries for mode 22 (normal, not bold)
	28 (visible, not invisible), 25 (not blinking).
2009-12-15 12:46:40 +00:00
Corinna Vinschen a3bb10f356 * faq-setup.xml (faq.setup.mirror): Fix URL to wget. 2009-12-14 17:15:51 +00:00
Corinna Vinschen 5d5594597e * libc/getopt.c (getopt_internal): Set optreset according to optind
setting earlier.  Reevaluate POSIXLY_CORRECT if optreset is set to !0.
	Handle a leading '-' in options independently of posixly_correct.
2009-12-14 10:47:25 +00:00
Christopher Faylor d0f9de23a1 * fhandler_fifo.cc (fhandler_fifo::open): Avoid resetting errno after it has
been explicitly set.
* include/cygwin/version.h: Bump DLL minor version number to 2.
2009-12-09 16:52:43 +00:00
Corinna Vinschen 6d67afbe9c * include/cygwin/version.h: Bump DLL minor version number to 1. 2009-12-06 12:24:34 +00:00
Corinna Vinschen 2bc3381e5c * fhandler_socket.cc (send_internal): Don't split datagram messages
into pieces.

	* syslog.cc (vsyslog): Set default facility to LOG_USER if it hasn't
	been set yet.
2009-12-02 15:23:03 +00:00
Corinna Vinschen 725d792fe1 * setup2.sgml (setup-env): Clarify that Windows environment gets
copied over.  Add paragraph about TMP, TEMP, and TMPDIR.
2009-12-02 09:36:54 +00:00
Corinna Vinschen b4a3a3e367 * fhandler_registry.cc (fhandler_registry::open): Mark /proc/registry
directory and siblings as nohandle fhandler.
2009-12-01 16:31:04 +00:00
Christopher Faylor c84fd8fe23 * speclib: Use last dll found since that's the real name of the cygwin DLL. 2009-11-30 15:40:23 +00:00
Corinna Vinschen 19ac72547f * setfacl.c (getaclentry): Allow to delete default entries for the
owner and owner group.
2009-11-29 14:28:29 +00:00
Chris Sutcliffe ff928075e9 2009-11-29 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/_mingw.h: Increment version to 3.17.
2009-11-28 06:07:27 +00:00
Chris Sutcliffe bde3635669 2009-11-25 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* mingwex/gdtoa/misc.c: Fix security vulnerability in gdtoa:
 http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-0689
2009-11-28 05:28:35 +00:00
Corinna Vinschen 667d9ad130 * fhandler_disk_file.cc (fhandler_base::fstat_helper): Fix typos in
comments.  Always open file synchronized when reading header bytes,
	otherwise suffer stack corruption.
2009-11-27 14:27:22 +00:00
Corinna Vinschen 3449d470ba * cygcheck.cc (dump_sysinfo): Fix typo in products. 2009-11-27 10:01:50 +00:00
Corinna Vinschen 7bdbf062cd * dtable.cc (dtable::stdio_init): Use GetCurrentProcess() rather than
hMainProc as process handle when duplicating the stdout handle.
	Explain why.  Add Win32 error code to debug output.
2009-11-26 10:58:06 +00:00
Corinna Vinschen 27bbefdefd * fhandler_socket.cc (fhandler_socket::fixup_before_fork_exec): Add
socket handle value to debug output.
	(fhandler_socket::fixup_after_fork): Ditto.  Make new socket handle
	OVERLAPPED, just as if it has been created with socket().
	* net.cc (fdsock): Close duplicated socket and explain why.  Disable
	the entire WSADuplicateSocket test for now and explain why.
2009-11-23 14:50:14 +00:00
Corinna Vinschen 013e402bfc * fhandler_socket.cc (fhandler_socket::set_close_on_exec): Only call
fhandler_base::set_close_on_exec for inheritable sockets.
2009-11-23 12:21:39 +00:00
Corinna Vinschen d9e9c7b5a7 * globals.cc (ro_u_dll): New R/O unicode string.
* syscalls.cc (nt_path_has_executable_suffix): Add ro_u_dll to
	blessed_executable_suffixes array.  Explain why.
2009-11-21 12:44:13 +00:00
Chris Sutcliffe fe6f5bbeaa 2009-20-10 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/shlobj.h (SHParseDisplayName): Fix definition.
2009-11-21 05:26:02 +00:00
Chris Sutcliffe 3cd3c5b30c 2009-20-10 Chris Sutcliffe <ir0nh34d@users.sf.net>
* include/w32api.h: Increment version to 3.14.
        * Makefile.in: Ditto.
2009-11-21 03:46:37 +00:00
Chris Sutcliffe bed4952298 2009-20-10 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/shlobj.h (SHParseDisplayName): Define.

        Thanks to James Roberts-Thomson for the report.
2009-11-21 03:25:23 +00:00
Chris Sutcliffe 03312ffc1f 2009-20-10 Chris Sutcliffe <ir0n3h4d@users.sourceforge.net>
* include/wingdi.h (ENHMFENUMPROC): Correct definition.

        Thanks to Alexander Vassilev for the report.
2009-11-21 00:55:51 +00:00
Chris Sutcliffe 0dcfbad035 2009-20-10 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/iprtrmib.h (MIB_IPADDRROW): Correct definition.

        Thanks to Thomas Denk for the report.
2009-11-21 00:44:50 +00:00
Chris Sutcliffe 67779b719c 2009-20-10 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/winbase.h (UnmapViewOfFile): Correct definition.

        Thanks to Dimitry Sibiryakov for the report.
2009-11-21 00:38:55 +00:00
Chris Sutcliffe 626e7233d9 2009-20-10 Aleksey Chernov <virxkane@users.sourceforge.net>
* include/sspi.h: Include ntsecapi.h to correct postgresql build error.
2009-11-20 23:59:11 +00:00
Chris Sutcliffe 547f15d128 2009-20-10 Heiko Hund <heiko@ist.eigentlich.net>
* include/commctrl.h (GetMUILanguage, InitMUILanguage): Add prototypes.
        * lib/comctl32.def (GetMUILanguage, InitMUILanguage): Define.
2009-11-20 23:54:02 +00:00
Chris Sutcliffe 21d105b7c6 2009-20-10 Michael James <james.me@gmail.com>
* include/wingdi.h (CLEARTYPE_QUALITY): Define.
        * include/winuser.h (WM_KEYLAST): Alternative definition when _WIN32_WINNT
        >= 0x0501.
        (WM_UNICHAR,UNICODE_NOCHAR): Define.
        * lib/comctl32.def (DefSubclassProc@16,GetWindowSubclass@16,
        RemoveWindowSubclass@12): Add exports.
        * lib/gdi32.def (GetDCBrushColor@4,GetDCPenColor@4): Add exports.
2009-11-20 23:46:05 +00:00
Chris Sutcliffe 64d9a4c6e6 2009-20-10 Jarkko Sakkinen <jarkko.sakkinen@iki.fi>
* include/winuser.h (WM_TOUCHMOVE, WM_TOUCHDOWN, WM_TOUCHUP,
        TOUCHEVENTF_DOWN, TOUCHEVENTF_INRANGE, TOUCHEVENTF_MOVE,
        TOUCHEVENTF_NOCOALESCE, TOUCHEVENTF_PALM, TOUCHEVENTF_PEN,
        TOUCHEVENTF_PRIMARY, TOUCHEVENTF_UP, TOUCHEVENTMASKF_CONTACTAREA,
        TOUCHEVENTMASKF_EXTRAINFO, TOUCHEVENTMASKF_TIMEFROMSYSTEM, TOUCHINPUT,
        CloseTouchInputHandle, GetTouchInputInfo, IsTouchWindow,
        RegisterTouchWindow, UnregisterTouchWindow): Define.
        * lib/user32.def (CloseTouchInputHandle, GetTouchInputInfo, IsTouchWindow,
        RegisterTouchWindow, UnregisterTouchWindow): Define.
2009-11-20 23:32:27 +00:00
Chris Sutcliffe 7c404cf4ed 2009-20-10 Dmitry Potapov <dpotapov@users.sourceforge.net>
* include/winver.h (VerQueryValue[AW]): Correct definition.
2009-11-20 23:16:40 +00:00
Chris Sutcliffe b87c3e2791 2009-20-10 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/shlobj.h (SHARD): Add enum.
        (SHARD_PATH): Define based on UNICODE.

        Thanks to Jacek Caban for the report.
2009-11-20 15:14:17 +00:00
Corinna Vinschen 9fa63f7a5e * flock.cc (fhandler_disk_file::lock): Disable a shortcut from the
original BSD code, but keep it in and documented why we can't use it.
2009-11-18 20:05:46 +00:00
Corinna Vinschen 7d5ae9ccf7 * overview2.sgml (ov-hi-files): Remove reference to root directory when
explaining fstab content.  Add paragraph about Extended Attributes.
	Discourage chroot.
2009-11-18 16:07:05 +00:00
Corinna Vinschen b1d699c434 * ntea.cc (read_ea): Always add length of "user." prefix, not only
on Samba.  Change comment.
2009-11-18 15:57:08 +00:00
Corinna Vinschen 7b426e9f4a * ntea.cc (read_ea): Try to open file first to have more sensible
error codes.  Always refuse non "user." EAs for Linux compatibility
	and return EOPNOTSUPP.  Fix handling of empty (== non-existant) EAs.
	Always prepend "user." prefix to EA names.
	(write_ea): Try to open file first to have more sensible error codes.
	Always refuse non "user." EAs for Linux compatibility and return
	EOPNOTSUPP.  Delay skipping "user." prefix until after potential call
	to read_ea.
2009-11-18 11:57:41 +00:00
Corinna Vinschen b14f53a8ec Reintegrate socket duplication via WSADuplicateSocket/WSASocket.
* autoload.cc (WSADuplicateSocketW): Define.
	(WSASocketW): Define.
	* dtable.cc (dtable::release): Call dec_need_fixup_before if necessary.
	(dtable::fixup_before_fork): New function.
	(dtable::fixup_before_exec): New function.
	* dtable.h (class dtable): Add member cnt_need_fixup_before.  Add
	declarations for above new functions.
	(dtable::dec_need_fixup_before): New inline method.
	(dtable::inc_need_fixup_before): New inline method.
	(dtable::need_fixup_before): New inline method.
	* fhandler.h (fhandler_base::fixup_before_fork_exec): New virtual
	method.
	(fhandler_base::need_fixup_before): New virtual method.
	(class fhandler_socket): Add member prot_info_ptr.
	(fhandler_socket::init_fixup_before): Declare.
	(fhandler_socket::need_fixup_before): New inline method.
	(fhandler_socket::fixup_before_fork_exec): Declare.
	(fhandler_socket::fixup_after_exec): Declare.
	* fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize
	prot_info_ptr to NULL.
	(fhandler_socket::~fhandler_socket): Free prot_info_ptr conditionally.
	(fhandler_socket::init_fixup_before): New method.
	(fhandler_socket::fixup_before_fork_exec): Ditto.
	(fhandler_socket::fixup_after_fork): Use WSASocketW to duplicate
	socket if necessary.
	(fhandler_socket::fixup_after_exec): New method.
	(fhandler_socket::dup): Use fixup_before_fork_exec/fixup_after_fork
	to duplicate socket if necessary.
	* fork.cc (frok::parent): Start child suspended if some fhandler
	needs fixup before fork.  If so, call dtable::fixup_before_fork after
	CreateProcess and resume child.
	* net.cc (fdsock): Try to find out if socket needs fixup before and
	initialize socket accordingly.  Add HUGE comment to explain what happens
	and why.
	* spawn.cc (spawn_guts): Start child suspended if some fhandler needs
	fixup before exec.  If so, call dtable::fixup_before_exec after
	CreateProcess.
2009-11-17 10:43:01 +00:00
Eric Blake d01a44977f Fix setenv and unsetenv corner cases.
* environ.cc (setenv): Detect invalid argument.
(unsetenv): Distinguish EFAULT from EINVAL.
2009-11-16 20:05:49 +00:00
Corinna Vinschen b755d497f5 * pathnames.sgml (pathnames-specialchars): Fix typos. 2009-11-16 12:30:00 +00:00
Corinna Vinschen 969afaf753 * Makefile.in (cygserver.exe): Link with -static to avoid linking
against cygstdc++-6.dll due to references to __cxa_pure_virtual.
2009-11-16 08:50:07 +00:00
Chris Sutcliffe 88dc5cc365 2009-14-09 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/wingdi.h (_devicemodeW, _devicemodeA): Correct definition.

        Thanks to Bruno Martinez for the report.
2009-11-14 19:58:41 +00:00
Chris Sutcliffe 5e80d7d546 2009-14-09 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/shlobj.h (IDO_SHGIOI_SHARE, IDO_SHGIOI_LINK, IDO_SHGIOI_SLOWFILE,
        IDO_SHGIOI_DEFAULT, SHGetIconOverlayIndexW, SHGetIconOverlayIndexA,
        SHGetIconOverlayIndex): Define.

        Thanks to Tim Kosse for report.
2009-11-14 19:47:23 +00:00
Chris Sutcliffe 8b121daba4 2009-11-13 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/io.h (_open_osfhandle): Correct definition.

        Thanks to Alexander Shaduri for the information.
2009-11-14 00:54:58 +00:00
Chris Sutcliffe 3d330d8115 2009-13-09 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/wincon.h (AttachConsole): Correct guard.

        Thanks to Alexander Shaduri for report.
2009-11-14 00:50:50 +00:00
Chris Sutcliffe 35d6a288b2 2009-13-09 Robert Moerland <rjmoerland@users.sourceforge.net>
* include/wininet.h (NTERNET_CACHE_ENTRY_INFOW): Correct definition.
        (DeleteUrlCacheEntryW, DeleteUrlCacheEntryA): Define.
2009-11-14 00:45:35 +00:00
Chris Sutcliffe 2142a1930c 2009-13-09 Jacky Lai <crazyjacky@users.sourceforge.net>
* include/winerror.h: Fix typos in macro names.
2009-11-13 23:58:58 +00:00
Chris Sutcliffe 9cd6116e56 2009-13-09 Jan Nijtmans <nijtmans@users.sourceforge.net>
* include/winuser.h (SendMessageTimeoutA, SendMessageTimeoutW): Correct
        definition.
2009-11-13 23:29:26 +00:00
Chris Sutcliffe 344af4f708 2009-11-09 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/winnt.h (PROCESS_SUSPEND_RESUME): Define.
2009-11-13 21:36:34 +00:00
Corinna Vinschen ab36239578 * net.cc (fdsock): Fill _rmem and _wmem with valid values returned
from getsockopt if setsockopt with desired values failed.
2009-11-13 12:35:53 +00:00
Corinna Vinschen 4ade241445 * new-features.sgml (ov-new1.7-os): Mention Windows 7 and 2008 R2.
(ov-new1.7-device): Add API get_avphys_pages, get_nprocs,
	get_nprocs_conf, and get_phys_pages.
2009-11-12 14:41:12 +00:00
Corinna Vinschen 339682e6de * sysconf.cc (get_nprocs): New function.
(get_nprocs_conf): Ditto.
	(get_avphys_pages): Ditto.
	(get_phys_pages): Ditto.
	* cygwin.din: Export them.
	* include/sys/sysinfo.h: New header, decalre above new functions.
	* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
	* posix.sgml: Mention them as GNU extensions.
2009-11-12 14:40:48 +00:00
Corinna Vinschen c08f09ab78 * fhandler.h (class fhandler_mailslot): Declare new private method
get_object_attr.
	* fhandler_mailslot.cc (fhandler_mailslot::get_object_attr): Implement.
	(fhandler_mailslot::open): Replace calls to path_conv::get_object_attr
	with calls to fhandler_mailslot::get_object_attr.
2009-11-11 18:16:57 +00:00
Corinna Vinschen afb7f5666d * getfacl.c (print_version): Fix copyright.
(main): Don't reuse local variables confusingly.  Don't print any file
	information if acl() fails.  Improve error message.  Always print a
	trailing empty line.  Set return code to 2 if accessing some file fails.
2009-11-11 10:12:35 +00:00
Corinna Vinschen 03c48ee2e0 * fhandler_console.cc (fhandler_console::read): Revert change from
2009-11-09.
2009-11-10 20:02:20 +00:00
Corinna Vinschen 3aec0f00b1 * fhandler_disk_file.cc (is_volume_mountpoint): Align check with
symlink_info::check_reparse_point().
	* path.cc (symlink_info::check_reparse_point): Rearrange slightly.
	Add code path for unrecognized repare point types.  Add comment.
2009-11-10 08:54:24 +00:00
Corinna Vinschen 16a72f7e4b * path.cc (symlink_info::check_reparse_point): Always check
SubstituteName for volume string to recognize volume mount points.
	Reuse subst when calling sys_wcstombs.
	* syscalls.cc (rename): Set errno to EBUSY when trying to rename
	volume mount points.  Explain why.
2009-11-09 19:46:36 +00:00
Corinna Vinschen ed66791aba * fhandler_console.cc (fhandler_console::read): Restrict generating
META key sequences to singlebyte input chars.
2009-11-09 15:38:36 +00:00
Corinna Vinschen aa9681ec35 * fhandler_disk_file.cc (fhandler_base::fstat_helper): Drop all "other"
permissions from st_mode, if the reading the file's security descriptor
	failed.  Explain why.
2009-11-08 10:22:28 +00:00
Corinna Vinschen b36d8c46e5 * globals.cc (ro_u_scr): New R/O unicode string.
(ro_u_sys): Ditto.
	* syscalls.cc (nt_path_has_suffix): Replace with ...
	(nt_path_has_executable_suffix): New function checking for explicit
	executable suffixes.
	(rename): Call nt_path_has_executable_suffix instead of
	nt_path_has_suffix.  Check oldpath for nt_path_has_executable_suffix
	as well to set old_explicit_suffix.
2009-11-06 20:51:03 +00:00
Corinna Vinschen 1636ce3b32 * transport_pipes.cc (transport_layer_pipes::transport_layer_pipes):
Check cygwin_internal for returning 0 rather than for != 0.
	(transport_layer_pipes::accept): Add debug output.
	(transport_layer_pipes::connect): Ditto.
2009-11-06 13:11:52 +00:00
Corinna Vinschen 74ad9cc012 * shared.cc (inst_root_inited): New static bool variable.
(init_installation_root): Set inst_root_inited to true.
	(memory_init): Print installation root debug output only if
	inst_root_inited is true.
2009-11-06 13:06:36 +00:00
Corinna Vinschen ac4ad8bffc * syscalls.cc (nt_path_has_suffix): New function.
(rename): Don't append .exe suffix if binary target name has any suffix
	at all.
2009-11-05 14:44:12 +00:00
Corinna Vinschen e807aacea9 * spawn.cc (dll_suffixes): Disable. Explain why.
(perhaps_suffix): Use stat_suffixes instead of dll_suffixes.
2009-11-05 09:59:18 +00:00
Corinna Vinschen 13e8e14ab5 * path.cc (read_mounts): Skip unnecessary test if path has been
fetched from loaded cygwin1.dll.
2009-11-04 17:09:32 +00:00
Corinna Vinschen b5f48aa961 * cygcheck.cc (cygwin_dll_path): New global variable.
(load_cygwin): Fetch cygwin DLL path and store in cygwin_dll_path.
	* strace.cc: Full ditto.
	* path.cc (read_mounts): First use the path stored in cygwin_dll_path,
	if available.  Then fall back to fetching own path.  Add comment.
	Drop printing warnings since they look funny in strace output.
2009-11-04 17:00:45 +00:00
Corinna Vinschen 44a019897f * path.cc (read_mounts): First get installation path from own path.
Check if cygwin1.dll exists in same directory.  Only if not, try to
	get installation path from setup registry key.  Add ample warnings.
2009-11-04 15:47:29 +00:00
Corinna Vinschen 73f2ecd19d * Makefile.in (cygpath.exe): Add -fno-threadsafe-statics to CXXFLAGS. 2009-11-04 14:14:52 +00:00
Corinna Vinschen 18f7c50401 * security.cc (alloc_sd): Re-introduce setting the SE_DACL_PROTECTED
flag.  Remove INHERITED_ACE flag from all inherited ACEs.  Add comment.
	Fix ace_off counter in unrelated ACE loop.
	* wincap.cc: Re-add has_dacl_protect throughout.
	* wincap.h: Ditto.
2009-11-03 09:31:45 +00:00
Corinna Vinschen 1bb3825949 * security.cc (alloc_sd): Re-enable generating default permission
entries for directories.
2009-11-02 20:50:15 +00:00
Corinna Vinschen df95867087 * dlfcn.cc (get_full_path_of_dll): Drop enforcing a .dll suffix.
(dlopen): If last path component has no dot, append one to override
	automatic .dll suffix in LoadLibrary.
2009-11-02 14:39:08 +00:00
Charles Wilson 599b80fc86 Final sync of pseudo-reloc.c with mingw64 and cygwin 2009-11-02 12:16:21 +00:00
Corinna Vinschen a657970571 * miscfuncs.h (transform_chars): Declare. Define inline variation here.
* mount.cc (mount_info::from_fstab): Remove extern declaration of
	transform_chars.
	* path.cc (tfx_chars): Move to strfuncs.cc.
	(transform_chars): Ditto.
	* strfunc.cc (tfx_chars): Moved here from path.cc.
	(transform_chars): Ditto.
	(sys_cp_wcstombs): Make UNICODE private use area conversion roundtrip
	save for all characters.
	(sys_cp_mbstowcs): Ditto, by removing special case for UTF-8 sequences
	representing U+f0XX UNICODE chars.  Fix typo in comment.
2009-11-02 11:42:04 +00:00
Corinna Vinschen 9725900d86 path.cc 2009-11-02 10:07:26 +00:00
Corinna Vinschen 0055caee0f * path.cc (tfx_chars): Constify. 2009-11-02 09:49:30 +00:00
Christopher Faylor 8a9358d0f7 * Makefile.in: Use utils mingw front-end to generate non-cygwin binary. 2009-11-01 17:22:44 +00:00
Corinna Vinschen 0de153c586 * new-features.sgml (ov-new1.7-misc): Add installation-specific
unique object names description.
2009-10-31 13:28:13 +00:00
Corinna Vinschen 34861325a5 * cygcheck.cc: Include cygprops.h.
(del_orphaned_reg): New option variable.
	(unique_object_name_opt): Ditto.
	(handle_reg_installation): New function.
	(print_reg_installations): Ditto.
	(del_orphaned_reg_installations): Ditto.
	(memmem): Ditto.
	(handle_unique_object_name): Ditto.
	(dump_sysinfo): Call print_reg_installations from here.
	(usage): Add usage for new options --delete-orphaned-installation-keys,
	--enable-unique-object-names, --disable-unique-object-names, and
	--show-unique-object-names.
	(longopts): Add new options --delete-orphaned-installation-keys,
	--enable-unique-object-names, --disable-unique-object-names, and
	--show-unique-object-names.
	(main): Handle new options.
	* utils.sgml (cygcheck): Change documentaion accordingly.
2009-10-31 13:26:37 +00:00
Corinna Vinschen b079a89e25 * transport_pipes.h (PIPE_NAME_PREFIX): New define.
(PIPE_NAME_SUFFIX): Ditto.
	(class transport_layer_pipes): Convert _pipe_name from char pointer
	to wchar_t array.
	* transport_pipes.cc (transport_layer_pipes::transport_layer_pipes):
	Accommodate the fact that _pipe_name is a wchar_t array, rather than
	a char pointer.
	(transport_layer_pipes::transport_layer_pipes): Initialize _pipe_name
	with variable pipe name based in installation key fetched from Cygwin
	DLL.
	(transport_layer_pipes::accept): Call CreateNamedPipeW explicitely.
	(transport_layer_pipes::connect): Call CreateFileW and WaitNamedPipeW
	explicitely.
2009-10-31 13:24:43 +00:00
Corinna Vinschen 526b0fbca3 * cygprops.h: New file.
* dtable.cc (handle_to_fn): Add check for correct installation_key
	string in object name for pipes and ttys.
	* external.cc (cygwin_internal): Add CW_GET_INSTKEY to allow fetching
	the installation_key from cygserver.
	* fhandler_fifo.cc (fhandler_fifo::fifo_name): Add installation_key
	to fifo name.
	* globals.cc: Include cygprops.h.
	(_RDATA): Move slightly and add comment.
	(cygwin_props): Define.
	* mount.cc (mount_info::init): Accommodate the fact that
	installation_root is now a global variable in DLL common shared memory,
	rather than a member of cygwin_shared.
	* pipe.cc (fhandler_pipe::create_selectable): Add installation_key to
	pipe name.
	* shared.cc (installation_root): Define here for storage in DLL
	common shared memory.
	(installation_key): Ditto.
	(installation_key_buf): Ditto.
	(init_installation_root): Convert from shared_info method to ordinary
	function.  Add initializing installation_key.  Invalidate
	installation_key depending of value of disable_key property.  Add
	comment to explain.
	(get_shared_parent_dir): Add installation_key to directory name.
	(get_session_parent_dir): Ditto.
	(shared_info::initialize): Move call to init_installation_root from
	here...
	(memory_init): ...to here.  Add debug output to print installation root
	and installation key.  Add comment to explain why.
	* shared_info.h (SHARED_INFO_CB): Recalculate.
	(CURR_SHARED_MAGIC): Ditto.
	(class shared_info): Remove definition of installation_root and
	declaration of init_installation_root.
	(init_installation_root): Declare.
	(installation_root): Declare.
	(installation_key): Declare.
	* uinfo.cc (pwdgrp::load): Accommodate the fact that installation_root
	is now a global variable in DLL common shared memory.
	* include/cygwin/version.h: Bump API minor number.
	(CYGWIN_INFO_INSTALLATIONS_NAME): Add.
	* include/sys/cygwin.h (cygwin_getinfo_types): Add CW_GET_INSTKEY.
2009-10-31 13:24:06 +00:00
Corinna Vinschen 7c16c02dbb * sec_helper.cc (security_descriptor::realloc): Call free first if
current security desriptor has been allocated by GetSecurityInfo.
2009-10-31 09:31:47 +00:00
Corinna Vinschen b42441d32b * sec_helper.cc (security_descriptor::free): If sd_size is 0, call
LocalFree instead of ::free.

	* sec_acl.cc: Throughout replace old ACE flag definitions with current
	definitions as used in MSDN man pages.
	* security.cc: Ditto.

	* fhandler.cc (fhandler_base::open): Make sure file has really been
	just created before fixing file permissions.  Add S_JUSTCREATED
	attribute to set_file_attribute call.
	* fhandler_disk_file.cc (fhandler_disk_file::mkdir): Always create dir
	with default security descriptor and fix descriptor afterwards.
	Add S_JUSTCREATED flag to set_file_attribute call.
	* fhandler_socket.cc (fhandler_socket::bind): Ditto for AF_LOCAL
	socket files.
	* path.cc (symlink_worker): Ditto for symlinks.
	* security.cc (get_file_sd): Call GetSecurityInfo rather than
	NtQuerySecurityObject.  Explain why.  Change error handling accordingly.
	(alloc_sd): Skip non-inherited, non-standard entries in ACL if
	S_JUSTCREATED attribute is set.  Explain why.  Minor format fixes.
	* security.h (S_JUSTCREATED): New define.
	(security_descriptor::operator=): New operator.
2009-10-30 19:58:53 +00:00
Corinna Vinschen 53be6f3df6 * fhandler_random.cc (fhandler_dev_random::lseek): Revert change from
2009-10-23.
2009-10-30 10:53:54 +00:00
Corinna Vinschen 460af5f9c0 * smallprint.cc (hex_str): New const string.
(__rn): Drop str and use hex_str instead.
	(__small_vsprintf): If 'l' modifier has been found, print subsequent
	multibyte or wide char string using the s, S, or W options in extended
	hex value layout.

	* fhandler_disk_file.cc (fhandler_disk_file::readdir): Print WCHAR
	and resulting multibyte filename in extended hex value layout in
	debug output.
2009-10-30 09:02:30 +00:00
Charles Wilson c16cd85665 Honor DESTDIR for winsup/mingw and winsup/w32api 2009-10-29 21:53:47 +00:00
Corinna Vinschen d952e44c44 * cygcheck.cc (pretty_id): Drop arguments. Don't change CYGWIN
environment variable.
	(dump_sysinfo): Don't tweak CYGWIN environment variable, just call
	pretty_id once.
2009-10-28 11:41:27 +00:00
Corinna Vinschen 757ee9af8b * pathnames.sgml: Add limitation of case sensitivity with CreateProcess. 2009-10-28 10:11:22 +00:00
Corinna Vinschen 641ba32982 * new-features.sgml (ov-new1.7-posix): Mention UTF-8 as "C" default
and the default locale "C.UTF-8".
	* setup2.sgml (setup-locale-ov): Ditto.
2009-10-28 10:09:54 +00:00
Charles Wilson 73ddc92062 Correct pseudo-reloc size bug wrt error messages 2009-10-26 14:50:09 +00:00
Charles Wilson 654d34dda5 Sync pseudo-reloc.c with mingw64 2009-10-26 13:47:13 +00:00
Christopher Faylor bfead37df4 * faq-setup.xml: Fix clean_setup.pl reference. 2009-10-26 11:57:33 +00:00
Christopher Faylor b8263d5874 * faq-setup.xml: Change clean_setup.pl reference. 2009-10-26 11:25:16 +00:00
Charles Wilson 15c59df67f Sync pseudo-reloc.c with mingw64 2009-10-25 23:37:48 +00:00
Corinna Vinschen e83fef9d35 * fhandler.cc (fhandler_base::open): Remove unused variables sa and sd. 2009-10-24 08:40:15 +00:00
Corinna Vinschen 1647bf67c1 * fhandler.cc (fhandler_base::open): Always create file with default
security descriptor and fix descriptor afterwards.  Change comment to
	explain why.
	* security.cc (alloc_sd): Drop setting the SE_DACL_PROTECTED flag.
	* wincap.cc: Remove has_dacl_protect throughout.
	* wincap.h: Ditto.
2009-10-24 08:26:01 +00:00
Charles Wilson 060a658fe1 Sync pseudo-reloc.c with cygwin/lib/ 2009-10-23 22:19:42 +00:00
Corinna Vinschen 959684bf05 * fhandler_random.cc (fhandler_dev_random::lseek): Allow negative
dummy file positions as on Linux.
2009-10-23 09:22:14 +00:00
Corinna Vinschen aa0937c308 * cygcheck.cc (dump_sysinfo): Update with latest NT 6.1 versions. 2009-10-20 15:26:33 +00:00
Corinna Vinschen a4f31f1b1b * registry.cc (reg_key::get_int): Add alternative implementation
taking WCHAR strings.
	(reg_key::set_int): Ditto.
	(reg_key::get_string): Ditto.
	(reg_key::set_string): Ditto.
	* registry.h (struct reg_key): Add prototypes for added methods.
2009-10-20 14:54:47 +00:00
Corinna Vinschen c94a1006c6 * smallprint.cc (__small_vsprintf): Simplify UNICODE string handling
and allow empty strings.
2009-10-20 14:52:43 +00:00
Corinna Vinschen cbea3f7d93 * fhandler_disk_file.cc (fhander_disk_file::readdir): Handle a status
code STATUS_NOT_SUPPORTED.  Add matching comment.
2009-10-20 10:12:05 +00:00
Corinna Vinschen 8d648dc555 * syscalls.cc (internal_setlocale): Only convert $PATH if there is a
$PATH.
2009-10-19 19:47:15 +00:00
Corinna Vinschen b3f5fb3718 * spawn.cc (av::fixup): Treat non-readable, but executable files as
Cygwin executables.
2009-10-19 08:33:00 +00:00
Corinna Vinschen a6f3658d44 * uinfo.cc (uinfo_init): Deimpersonate, don't reimpersonate, if
not in a setuid condition.
2009-10-18 09:07:13 +00:00
Corinna Vinschen 175e39bb7f * cygpath.cc (get_special_folder): Fetch path as WCHAR and convert
using my_wcstombs.
	(get_user_folder): Remove.
	(do_sysfolders): Use get_special_folder instead of get_user_folder.
	Fetch system paths as WCHAR and convert using my_wcstombs.
2009-10-15 11:40:02 +00:00