Commit Graph

7393 Commits

Author SHA1 Message Date
Corinna Vinschen db917b216e * wchar.h: Replace UINT with unsigned int. 2009-03-24 13:33:57 +00:00
Corinna Vinschen 10558efdef * wchar.h: Remove erroneous "C" specifier from extern declaration. 2009-03-24 13:21:23 +00:00
Corinna Vinschen 1c6743b74d * cygwinenv.sgml: Move "codepage:xxx" to the removed options section.
Change text accordingly.
	* new-features.sgml: Try to explain new way to define character sets.
2009-03-24 12:37:02 +00:00
Corinna Vinschen 161211d186 * ctype.cc (_CTYPE_DATA_0_127): Add _B class to TAB character.
(__ctype_default): New character class array for default ASCII
	character set.
	(__ctype_iso): New array of character class array for ISO charsets.
	(__ctype_cp): Ditto for singlebyte Windows codepages.
	(tolower): Implement as distinct function to support any singlebyte
	charset.
	(toupper): Ditto.
	(__set_ctype): New function to copy singlebyte character classes
	corresponding to current charset to ctype_b array.
	Align copyright text to upstream.
	* dcrt0.cc (dll_crt0_1): Reset current locale to "C" per POSIX.
	* environ.cc (set_file_api_mode): Remove.
	(codepage_init): Remove.
	(parse_thing): Remove "codepage" setting.
	(environ_init): Set locale according to environment settings, or
	to current codepage, before converting environment to multibyte.
	* fhandler.h (fhandler_console::write_replacement_char): Drop argument.
	* fhandler_console.cc (dev_console::str_to_con): Call sys_cp_mbstowcs
	rather than MultiByteToWideChar.
	(fhandler_console::write_replacement_char): Always print a funny
	half filled square if a character isn't in the current charset.
	(fhandler_console::write_normal): Convert to using __mbtowc
	rather than next_char.
	* fork.cc (frok::child): Drop call to set_file_api_mode.
	* globals.cc (enum codepage_type) Remove.
	(current_codepage): Remove.
	* miscfuncs.cc (cygwin_wcslwr): Unused, dangerous.  Remove.
	(cygwin_wcsupr): Ditto.
	(is_cp_multibyte): Remove.
	(next_char): Remove.
	* miscfuncs.h (is_cp_multibyte): Drop declaration.
	(next_char): Ditto.
	* strfuncs.cc (get_cp): Remove.
	(__db_wctomb): New function to implement _wctomb_r functionality for
	doublebyte charsets using WideCharToMultiByte.
	(__sjis_wctomb): New function to replace unusable newlib function.
	(__jis_wctomb): Ditto.
	(__eucjp_wctomb): Ditto.
	(__gbk_wctomb): New function.
	(__kr_wctomb): Ditto.
	(__big5_wctomb): Ditto.
	(__db_mbtowc): New function to implement _mbtowc_r functionality for
	doublebyte charsets using MultiByteToWideChar.
	(__sjis_mbtowc): New function to replace unusable newlib function.
	(__jis_mbtowc): Ditto.
	(__eucjp_mbtowc): Ditto.
	(__gbk_mbtowc): New function.
	(__kr_mbtowc): New function
	(__big5_mbtowc): New function
	(__set_charset_from_codepage): New function.
	(sys_wcstombs): Reimplement, basically using same wide char to multibyte
	conversion as newlib's application level functions.  Plus extras.
	Add lengthy comment to explain.  Change return type to size_t.
	(sys_wcstombs_alloc): Just use sys_wcstombs.  Change return type to
	size_t.
	(sys_cp_mbstowcs): Replace sys_mbstowcs, take additional codepage
	argument.  Explain why.  Change return type to size_t.
	(sys_mbstowcs_alloc): Just use sys_mbstowcs.  Change return type to
	size_t.
	* wchar.h: Declare internal functions implemented in strfuncs.cc.
	(wcscasecmp): Remove.
	(wcsncasecmp): Remove.
	(wcslwr): Remove.
	(wcsupr): Remove.
	* winsup.h (codepage_init): Remove declaration.
	(get_cp): Ditto.
	(sys_wcstombs): Align declaration to new implementation.
	(sys_wcstombs_alloc): Ditto.
	(sys_cp_mbstowcs): Add declaration.
	(sys_mbstowcs): Define as inline function.
	(sys_mbstowcs_alloc): Align declaration to new implementation.
	(set_file_api_mode): Remove declaration.
	* include/ctype.h (isblank): Redefine to use _B character class.
	(toupper): Remove ASCII-only definition.
	(tolower): Ditto.
2009-03-24 12:18:34 +00:00
Corinna Vinschen 6a32d500a9 * sec_auth.cc (str2buf2uni): Remove.
* security.h (str2buf2uni): Remove declaration.
2009-03-24 10:53:57 +00:00
Corinna Vinschen 0258b68722 * include/mntent.h: Remove declarations of nonexistant addmntent
and hasmntopt.  Update and clarify the /etc/mtab comment.
2009-03-24 09:19:37 +00:00
Corinna Vinschen 6199f417ab * passwd.c (usage): Change description for -d option according to
previous change.
	(main): Fix typo.
	* utils.sgml: Add missing description for passwd -d option.
2009-03-23 20:40:17 +00:00
Corinna Vinschen 0e0f5748e0 * passwd.c (caller_is_admin): New function to test if calling user
is an administrator by inspecting user token.
	(main): Drop fetching caller info from logonserver.  Only fetch
	server from environment when trying to change password for own
	account.  Drop admin check entirely in case of doing account
	maintainance.  Otherwise replace check for admin by result of
	caller_is_admin call.
2009-03-23 16:37:49 +00:00
Corinna Vinschen 7d2e8c04f2 * smallprint.cc (__small_vsprintf): Handle NULL PWCHAR and
PUNICODE_STRING arguments.
	(__small_vswprintf): Ditto.
2009-03-23 15:48:16 +00:00
Corinna Vinschen 1199a53979 * include/asm/byteorder.h (__constant_ntohs): Remove declaration.
(__constant_ntohl): Ditto.
2009-03-23 14:26:55 +00:00
Corinna Vinschen 9a1109002a * cygwin.din: Export wordexp, wordfree.
* posix.sgml: Move them to SUSv4 list.
	* include/cygwin/version.h: Bump API minor number.
2009-03-23 09:46:38 +00:00
Corinna Vinschen ab1739c0b9 * include/sys/un.h: #include <string.h> for strlen. 2009-03-23 08:45:18 +00:00
Corinna Vinschen a26691a67c * passwd.c (main): Always get logonserver from environment and
use when fetching user info for caller.
2009-03-22 19:18:26 +00:00
Corinna Vinschen 35aeac58b0 * ldd.cc: Fix compiler warning.
* passwd.c: Use mbstowcs instead of MultiByteToWideChar throughout.
	(main): Call setlocale.  Fix a bug in fetching the logon server from
	the environment.
2009-03-22 10:09:01 +00:00
Corinna Vinschen 576cc648d3 * cygserver-config: Remove misleading text describing the
"CYGWIN=server" setting for the client.
2009-03-20 11:54:16 +00:00
Corinna Vinschen d09a742ef4 * dlfcn.cc (get_full_path_of_dll): Revert patch from 2008-07-16. 2009-03-19 18:16:07 +00:00
Corinna Vinschen a9a520b62b * cygwin.din: Export log2, log2f as functions.
* posix.sgml: Add them to SUSv4 list.
	* include/cygwin/version.h: Bump API minor number.
2009-03-19 09:22:01 +00:00
Christopher Faylor f48bb39e20 *** empty log message *** 2009-03-18 14:47:13 +00:00
Christopher Faylor c4509a7ac2 Re-add inexplicably missing ldh.cc. 2009-03-18 14:46:24 +00:00
Corinna Vinschen 9e112520ff * sec_auth.cc (lsaauth): Remove local definitions of struct
_TOKEN_LINKED_TOKEN and TokenLinkedToken in favor of definitions
	from winnt.h.
	(lsaprivkeyauth): As in lsaauth, fetch linked token if available and
	return that in favor of default token.
2009-03-18 13:58:35 +00:00
Corinna Vinschen da413e0a39 * winnt.h: Add Vista token security extensions.
(SID_HASH_SIZE): Define.
	(TOKEN_MANDATORY_POLICY_OFF, TOKEN_MANDATORY_POLICY_NO_WRITE_UP,
	TOKEN_MANDATORY_POLICY_NEW_PROCESS_MIN,
	TOKEN_MANDATORY_POLICY_VALID_MASK): Define.
	(SID_HASH_ENTRY): Define.
	(struct _SID_AND_ATTRIBUTES_HASH): Define.
	(struct _TOKEN_LINKED_TOKEN): Define.
	(struct _TOKEN_MANDATORY_LABEL): Define.
	(struct _TOKEN_MANDATORY_POLICY): Define.
	(struct _TOKEN_ELEVATION): Define.
	(struct _TOKEN_ACCESS_INFORMATION): Define.
	(enum _TOKEN_INFORMATION_CLASS): Conditionally define new Vista token
	information enumeration values.
2009-03-18 13:47:18 +00:00
Corinna Vinschen 49536558ef * cygwin-ug-net.in.sgml: Update date.
* cygwinenv.sgml: Fix codepage:utf8 text in terms of setting
	environment variables.
	* new-features.sgml: New file describing new Cygwin 1.7 features.
	Layout is preliminiary only.
	* overview.sgml: Insert content of new-features.sgml.
2009-03-18 11:29:27 +00:00
Corinna Vinschen 1233ba242b * overview2.sgml: Remove reference to CYGWIN=binmode.
* textbinary.sgml: Ditto.  Rephrase certain paragraphs to match
	Cygwin 1.7 behaviour.  Add popen(3) and pipe(2) behaviour.  Make
	quite clear that binmode is preferred.  Add *mode.o files to
	description for developers.
2009-03-18 11:05:45 +00:00
Christopher Faylor 2e13058eac * ldd.cc (load_dll): Start helper program rather than ldd.exe.
(set_entry_point_break): Rename from get_entry_point.
(print_dlls): Rename from print_dlls_and_kill_inferior.  Avoid printing
specific dll name if we're looking at a dll.
(report): Always dump dlls on process exit.  Don't allow thread creation.
Accommodate get_entry_point rename.
(start_process): Start process with DEBUG_ONLY_THIS_PROCESS.
(longopts): Eliminate "dll" option.
(main): Ditto.
* ldd.cc: Use wide character Win32 paths throughout.
(load_dll): Fix size expression (add fn) in realloc.
2009-03-18 04:19:05 +00:00
Corinna Vinschen 99438c631a * errno.cc (_sys_errlist): Add ESTRPIPE. 2009-03-15 13:46:56 +00:00
Corinna Vinschen 19b3c04bb0 * cygwin.din: Export wcsdup.
* posix.sgml: Add wcsdup to SUSv4 list.
	* include/cygwin/version.h: Bump API minor number.
2009-03-15 13:45:02 +00:00
Corinna Vinschen 7b011fb192 * include/inttypes.h: Remove "l" size specifier from all 16 and 32 bit
definitions.
2009-03-15 13:29:04 +00:00
Christopher Faylor d5e4f55b14 * ldd.cc (longopts): Add --dll option.
(get_module_filename): Generalized wrapper function which avoid path length
restrictions.
(load_dll): Handle special-case of inspecting a DLL.
(start_process): Accept an output parameter "isdll".  Detect when file to start
is a DLL and start a wrapper instead.
(print_dlls_and_kill_inferior): When dealing with a DLL, avoid printing
everything before the DLL itself first appears.  (This is not strictly correct
and should be fixed eventually)
(report): Deal with DLLs.  Don't set a breakpoint for DLLs, just let captive
ldd process terminate normally.  Pass dll info to print_dlls_and_kill_inferior.
(main): Handle special-case "--dll" option by loading the DLL and exiting.
2009-03-14 18:40:59 +00:00
Christopher Faylor 6612934a40 * path.cc (warn_msdos): Don't warn about MS-DOS filenames encountered during
initialization.
2009-03-14 18:35:26 +00:00
Corinna Vinschen 5c8c49cc43 * path.cc (from_fstab): Use wcstombs/mbstowcs instead of
WideCharToMultiByte/MultiByteToWideChar to accommodate current locale.
2009-03-14 14:58:05 +00:00
Corinna Vinschen 26fb7ef5e4 * wide_path.h (class wide_path): New class to convert Windows path
to WCHAR win32 path, including long path conversion if necessary.
	* cygcheck.cc: Use class wide_path throughout to call Win32 functions
	taking potentially long filenames.
	(display_error): Use snprintf rather than sprintf.
	(display_error_fmt): Ditto.
	(dump_sysinfo): Use FindFirstFileW/FindNextFileW.
	* cygpath.cc: Use class wide_path throughout to call Win32 functions
	taking potentially long filenames.
	(get_device_name): Raise buffer size to take long pathnames.
	(get_short_paths): Convert to using GetShortPathNameW.
	(get_short_name): Ditto.
	(get_long_path_name_w32impl): Convert to equivalent of GetLongPathNameW.
	(get_long_name): Convert to using GetLongPathNameW.
	(do_sysfolders): Raise buffer size for POSIX pathname to PATH_MAX.
	(do_pathconv): In case of POSIX->Win32 conversion, convert to wchar_t
	Win32 path name and drop long pathname prefix if possible.
	(main): Call setlocale to accommodate wide char/multibyte conversions.
2009-03-14 14:56:20 +00:00
Corinna Vinschen 01cdb57d40 * gendef: Remove STABS directives. 2009-03-14 09:14:47 +00:00
Christopher Faylor 962acfe58a * ldd.cc: Rework to detect missing DLLs.
(start_process): Change to expect windows filename as input.
(tocyg): New function - convert cygwin fn to windows fn.
(print_dlls_and_kill_inferior): Accept extra argument denoting whether to open
input and look for nonexistent DLLs.  Use tocyg to convert filename and pass it
to start_process.
(report): Flag when an DLL-not-found exception occurs and pass this information
to print_dlls_and_kill_inferior.
(filelist): New structure.
(saw_file): New function.
(dump_import_directory): Ditto.
(map_file): Ditto.
(skip_dos_stub): Ditto.
(get_directory_index): Ditto.
(process_file): Ditto.
2009-03-14 06:46:00 +00:00
Corinna Vinschen ad2c5ad9d2 * mktemp.cc: Remove STABS specific link-time warning. Align copyright
text to upstream.
2009-03-13 20:49:42 +00:00
Corinna Vinschen 8c0b8bc352 * flock.cc: Fix lockf copyright to latest version. 2009-03-13 09:33:55 +00:00
Corinna Vinschen 752c477b42 * fhandler_disk_file.cc (path_conv::isgood_inode): Move to be defined
earlier.
	(get_ino_by_handle): Take additional path_conv argument, accommodate
	throughout.  Only use FileId if isgood_inode check is true.
	(fhandler_base::open_fs): Simplify setting ino due to above change.
	(readdir_get_ino): Make sure to return always a non-zero inode number.
	(fhandler_disk_file::readdir): Always open file in dir with
	FILE_OPEN_REPARSE_POINT so as not to open wrong file.
	Drop call to isgood_inode here.
	* path.cc (symlink_info::check): Call fs.update in case we're fetching
	file information from call to NtQueryDirectoryFile.
2009-03-12 22:03:28 +00:00
Corinna Vinschen fc69f1aed5 * flock.cc (fhandler_disk_file::lock): Don't test file open mode in
case of flock-type locks.  Explain why.
2009-03-12 18:30:29 +00:00
Corinna Vinschen 2e0b52c9d8 * gethostby_helper: Fix typos in DEBUGGING case. 2009-03-12 15:54:49 +00:00
Corinna Vinschen cab0758eb2 * cygwin.din: Export wcscasecmp, wcsncasecmp.
* posix.sgml: Move wcscasecmp, wcsncasecmp to SUSv4 list.
	* include/cygwin/version.h: Bump API minor number.
2009-03-11 13:00:28 +00:00
Corinna Vinschen 32382e935a * cygwin.din: Export wscanf, fwscanf, swscanf, vwscanf, vfwscanf,
vswscanf.
	* posix.sgml: Move fwscanf, swscanf, vwscanf, vfwscanf, vswscanf
	to SUSv4 list.
	* include/cygwin/version.h: Bump API minor number.
2009-03-11 12:03:44 +00:00
Corinna Vinschen 71d13bca55 * fhandler.h (fhandler_socket::wait_for_events): Take additional
parameter "dontwait".
	* fhandler_socket.cc (fhandler_socket::wait_for_events): Act as if the
	socket is non-blocking if dontwait is true.
	(fhandler_socket::recv_internal): Use incoming MSG_DONTWAIT flag to
	set the wait_for_events dontwait parameter.
	(fhandler_socket::send_internal): Ditto.  Optimize code slightly.
	* include/cygwin/socket.h (MSG_DONTWAIT): Define.
	* include/cygwin/version.h: Bump API minor number.
2009-03-09 14:40:45 +00:00
Corinna Vinschen c47426aedb * cygwin.din: Export wcsftime.
* posix.sgml: Move wcsftime to SUSv4 list.
	* include/cygwin/version.h: Bump API minor number.
2009-03-09 13:22:37 +00:00
Corinna Vinschen f9f478ad80 * pathnames.sgml: Try to be more clear explain raw devices. 2009-03-09 10:23:44 +00:00
Corinna Vinschen 313fb10ba2 * utils.sgml: Fix typo. 2009-03-09 09:20:38 +00:00
Christopher Faylor 9caeaa61c0 * cygcheck.cc (usage): Fix typo. 2009-03-08 21:13:26 +00:00
Corinna Vinschen 6f57cb4a52 * cygwin.din: Export gethostbyname2.
* net.cc: define _CYGWIN_IN_H and include resolv.h.
	(realloc_ent): New function.
	(dup_ent): Call realloc_ent.
	(memcpy4to6): New function.
	(dn_length1): New function.
	(gethostby_helper): New function.
	(gethostbyname2): New function.
	* posix.sgml: Add gethostbyname2.
	* include/cygwin/version.h: Bump API minor number.
	* libc/minires.c (get_options): Look for "inet6" and apply bounds
	to "retry" and "retrans".
	(res_ninit): Set the default options at the beginning.
	(dn_expand): Fix "off by one".
2009-03-06 16:31:26 +00:00
Corinna Vinschen 45e20e47ba * cygwin.din: Export wprintf, fwprintf, swprintf, vwprintf, vfwprintf,
vswprintf.  Sort.
	* posix.sgml: Move fwprintf, swprintf, vwprintf, vfwprintf, vswprintf
	to SUSv4 list.  Sort SUSv4 list.
	* include/cygwin/version.h: Bump API minor number.
2009-03-06 10:09:55 +00:00
Chris Sutcliffe 6e0e5a4fc2 2009-03-05 Kai Tietz <kai.tietz@onevision.com>
* pseudo-reloc.c: Rewrite to enable pseudo_reloc version 2.
2009-03-05 14:48:38 +00:00
Corinna Vinschen 06281845fb * dcrt0.cc (disable_dep): Disable. Explain why.
(dll_crt0_0): Disable calling disable_dep.  Explain why.
2009-03-04 11:45:58 +00:00
Corinna Vinschen 2895b8b502 * net.cc: Include asm/byteorder.h.
(htonl): Move to end of file.  Add comment to explain why.  Align
	definition to POSIX.  Use related macro from asm/byteorder.h.
	(ntohl): Ditto.
	(htons): Ditto.
	(ntohs): Ditto.
	* include/asm/byteorder.h: Revert previous patch.
2009-03-03 11:44:18 +00:00