Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-01-21cygpath: Avoid returning SysWOW64Corinna Vinschen
On Cygwin 32 running under WOW64: When case-correcting the path fetched with -S, the underlying Windows function fetching the normalized path returns the real path C:\Windows\SysWOW64 instead of the path redirection enabled C:\Windows\System32 path. This breaks using the result of `cygpath -S' to fetch the POSIX path of the network related files under SYSTEMROOT\drivers\etc. This path is in fact under the *real* C:\Windows\System32 and only mapped into the 32 bit C:\Windows\System32 (aka C:\Windows\SysWOW64) via path redirection. Sounds messy? This patch checks if we're running under WOW64. If so, it changes the path returned by GetSystemDirectoryW from "system32" to "Sysnative". This in turn is changed to "System32" by NtQueryInformationFile, so we're back to what we need. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-01-07cygpath: Try to return system directories with correct caseCorinna Vinschen
* cygpath.cc (do_sysfolders): Drop lame workaround to fix case of directory returned by GetSystemDirectoryW. Try to fix case of any path returned by this function in case it has to return a POSIX path to support case-sensitivity. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-12-06Allow cygwin_conv_path(3) and cygpath(1) to emit /proc/cygdrive prefixed pathCorinna Vinschen
* include/sys/cygwin.h (CCP_PROC_CYGDRIVE): New flag. * mount.cc (mount_info::cygdrive_posix_path): Take flag values rather than just a trailing_slash_p bool. Emit /proc/cygdrive path if CCP_PROC_CYGDRIVE flag is given. (mount_info::conv_to_posix_path): Take flag values rather than just a keep_rel_p bool. Rename _p variables. Print flag value as hex in debug_printf. Call cygdrive_posix_path with flag values. * mount.h (mount_info::cygdrive_posix_path): Accommodate above change in declaration. (mount_info::conv_to_posix_path): Ditto. * fhandler_process.cc (format_process_exename): Accommodate change to mount_info::conv_to_posix_path. * path.cc (cygwin_conv_path): Ditto. * cygpath.cc (absolute_flag): Initialize to CCP_RELATIVE to simplify expressions. (cygdrive_flag): New global flag. (long_options): Add --proc-cygdrive option. (options): Add -U option. (usage): Add description for -U option. (do_sysfolders): Or cygdrive_flag to cygwin_conv_path call. (do_pathconv): Simply or absolute_flag to conv_func. Or cygdrive_flag to conv_func. (do_options): Initalize absolute_flag to CCP_RELATIVE. Initialize new cygdrive_flag. Set absolute_flag to CCP_ABSOLUTE on -a. Set cygdrive_flag to CCP_PROC_CYGDRIVE on -U. * new-features.xml (ov-new2.4): Document cygpath -U option. * utils.xml (cygpath): Ditto. * path.xml (func-cygwin-path): Add CCP_PROC_CYGDRIVE description. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2013-06-26 * cygpath.cc (do_pathconv): when -p option is given, generate wideCorinna Vinschen
path without long path prefixing. * wide_path.h (wide_path::wide_path): Allow extra bool parameter to specify whether or not performing Windows long path prefixing.
2013-01-21Update copyrightsChristopher Faylor
2012-07-06 * cygpath.cc: Change including headers to allow building againstCorinna Vinschen
Mingw64 headers. Include ntdef.h and ntdll.h rather than ddk headers. Define _WIN32_WINNT and WINVER as 0x0602. (RtlEqualUnicodePathPrefix): Drop definition. Pulled in from ntdll.h now. (get_device_name): s/Zw/Nt. * dumper.cc: Include sys/param.h (dumper::dump_memory_region): Use MIN rather than min. * locale.cc: Include stdlib.h. Define _WIN32_WINNT and WINVER as 0x0602. * ps.cc: Include ntdef.h and ntdll.h rather than ddk headers. * regtool.cc (regDeleteKeyEx): Drop WINADVAPI qualifier.
2011-12-18Clean up whitespace.Christopher Faylor
2011-12-02 * Makefile.in (cygpath.exe): Add -luserenv to ALL_LDFLAGS.Corinna Vinschen
* cygpath.cc: Throughout, use cygwin_conv_path WIN_W rather than WIN_A conversion. (get_long_path_name_w32impl): Remove. (get_long_name): Drop pre-Windows 2000 accommodations. Just call GetLongPathNameW here directly. (get_special_folder): Convert first parameter to WCHAR buffer pointer. Drop conversion of result from WCHAR * to char *. (do_sysfolders): Accommodate change to get_special_folder and only convert result to char * last. Drop pre-Windows 2000 accommodations and just call GetProfilesDirectoryW directly. Replace call to GetWindowsDirectoryW with call to GetSystemWindowsDirectoryW. Just call GetShortPathNameW directly. (do_pathconv): Simplify buffer handling.
2011-10-10 * Align usage output, version output, as well as usage and versionCorinna Vinschen
option handling to use the same style throughout all Cygwin utils. Throughout use program_invocation_short_name to refer to current process name in Cygwin executables. * utils.sgml: Align documentation to above change. Add missing sections for getconf, ldd, and setmetamode. * strace.cc (proc_child): Avoid compiler warning.
2010-12-06 * cygpath.cc (get_device_name): Fix path length test.Corinna Vinschen
2010-09-06 * cygpath.cc (RtlEqualUnicodePathPrefix): New helper function.Corinna Vinschen
(HARDDISK_PREFIX): Move. (GLOBALROOT_PREFIX): Define. (get_device_name): Take GLOBALROOT_PREFIX into account. Improve check for path to allow filesystem access via block devices. Potentially drop \\.\ prefix if resulting path is a valid DOS pathname. (do_pathconv): Make sure to drop \\?\ prefix only if path is actually a filesystem based path. (print_version): Fix copyright.
2010-08-28 * loadlib.h: New header implementing safe LoadLibrary calls.Corinna Vinschen
Include throughout files using LoadLibrary function. * cygcheck.cc (dump_sysinfo): Retrieve kernel32.dll handle via GetModuleHandle, rather than using LoadLibrary. * cygpath.cc (get_long_name): Ditto. (do_sysfolders): Append .dll suffix in LoadLibrary call. * ldh.cc (WinMain): Use LoadLibraryExW with DONT_RESOLVE_DLL_REFERENCES to avoid loading malicious library code. * locale.cc (print_locale_with_codeset): Change way to retrieve kernel32.dll path.
2010-08-26 * cygpath.cc (get_device_name): Prefer the \\.\X: DOS device forCorinna Vinschen
harddisks, if available.
2010-02-22 * cygpath.cc (do_pathconv): Fix erroneously printing native NT pathCorinna Vinschen
prefix introduced by previous patch.
2010-02-13 * cygpath.cc (do_pathconv): Fix potential crash.Corinna Vinschen
2010-01-16 * cygpath.cc (get_mixed_name): Drop function. Replace with call toCorinna Vinschen
convert_slashes throughout. (do_sysfolders): Free allocated buffer. (do_pathconv): Fix freeing last buffer.
2010-01-07 * cygpath.cc: Throughout, free obsolete path buffers.Corinna Vinschen
2010-01-07 * cygpath.cc (main): Remove enforcing "en_US.UTF-8" locale.Corinna Vinschen
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.
2009-10-15 * cygpath.cc (get_special_folder): Fetch path as WCHAR and convertCorinna Vinschen
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-05-17 * cygpath.cc (codepage): New variable.Corinna Vinschen
(long_options): Add --codepage option. (options): Add -C option. (usage): Add -C/--codepage description. (my_wcstombs): New function. Use througout instead of wcstombs. (do_options): Handle -C/--codepage option. * utils.sgml (cygpath): Add description for new -C/--codepage option.
2009-05-15 * cygpath.cc (main): Only setlocale for LC_CTYPE category. FallbackCorinna Vinschen
to UTF-8 if locale is "C". * ldd.cc (main): Ditto. * mkgroup.c (main): Ditto. * mkpasswd.c (main): Ditto. * passwd.c (main): Ditto.
2009-04-15 * cygpath.cc (do_pathconv): Only skip \\?\ prefix if it's reallyCorinna Vinschen
given. Do backslash to slash conversion for mixed paths after handling \\?\ prefix.
2009-03-14 * wide_path.h (class wide_path): New class to convert Windows pathCorinna Vinschen
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.
2008-07-22 * Makefile.in (cygcheck.exe): Link against ntdll.Corinna Vinschen
* bloda.cc: Use statically linked functions throughout. * cygpath.cc: Drop 9x considerations. * mkgroup.c: Revamp. Redefine -l and -d options to take optional machine and domain parameters. Redefine -c to work always, using token information. Add -L, -D, -C to create unique groupnames in domain\group syntax. Add -S option to define domain\group separator char. Ignore -u and -s options. * mkpasswd.c: Revamp. Redefine -l and -d options to take optional machine and domain parameters. Redefine -c to work always, using token information. Add -L, -D, -C to create unique usernames in domain\user syntax. Add -S option to define domain\user separator char. Ignore -g and -s options. Prefer to take homedir from $HOME over $HOMEDRIVE/$HOMEPATH. * path.cc (oopts): Add "acl", "noacl", "posix=0" and "posix=1" options. (getmntent): Accomodate throughout. * ps.cc: Fix copyright dates. * utils.sgml: Fix text for mkgroup and mkpasswd.
2008-03-12 * cygpath.cc (do_sysfolders): Use cygwin_conv_path.Corinna Vinschen
(do_pathconv): Use cygwin_conv_path and cygwin_conv_path_list. * dumper.cc (main): Use cygwin_conv_path. Allocate target path dynamically. * mkpasswd.c (current_user): Use cygwin_conv_path. (enum_users): Ditto. * ps.cc (NT_MAX_PATH): Define. (main): Use cygwin_conv_path. * regtool.cc (find_key): Ditto. Allocate target path dynamically. (cmd_save): Ditto.
2007-05-29 * cygpath.cc (do_options): Allow outputflag combined with otherCorinna Vinschen
basic flags. Only check options_from_file_flag if reading options from command line. (main): Check for NULL argz vector. Don't free argz vector prematurely. Don't force flag combination in !options_from_file_flag case.
2007-05-23 * cygpath.cc: Include argz.h.Corinna Vinschen
(options_from_file_flag): Move from main to global static variable. (mode_flag): Ditto. (do_sysfolders): Rename from dowin and accommodate throughout. Don't exit from here. (do_pathconv): Rename from doit and accommodate throughout. (print_version): Change copyright. (do_options): New function, centralizing option processing. Rework checking options for correctness. (action): New function, centralizing calling worker functions. (main): Simplify. Move option processing to do_options. Move calling worker functions to action. Rework getting arguments from files.
2007-03-31* utils/cygpath.cc (get_long_path_name_w32impl): Close handles returned byChristopher Faylor
FindFirstFile.
2007-01-09 * cygpath.cc (usage): Add -O and -F, remove tabs.Corinna Vinschen
(get_special_folder): New function. (get_user_folder): New function. (dowin): Add -O and -F, better -D, -P error handling. (main): Add -O and -F. * utils.sgml (cygpath): Document -O and -F.
2006-08-02 * Makefile.in (cygpath.exe): Add rule to link cygpath against ntdll.dll.Corinna Vinschen
* cygpath.cc: Include DDK headers. (RtlAllocateUnicodeString): New static inline function. (get_device_name): New static function to evaluate DOS path from native NT path. (get_device_paths): New function to do the same for path lists. (doit): Call get_device_paths/get_device_name where appropriate.
2006-07-31 * cygpath.cc (get_long_name): Fallback to get_long_path_name_w32impl.Corinna Vinschen
2006-07-28 * cygpath.c (get_long_name): Cover the case that GetLongPathNameCorinna Vinschen
doesn't return valid information for non-existant files. Just return incoming filename in that case.
2006-02-17 * cygpath.cc (get_long_name): Load GetLongPathNameA instead of incorrectCorinna Vinschen
GetLongPathName. (doit): Create mixed filename after converting to short or long pathname respectively.
2006-01-18* cygpath.cc (dowin): Remove stray debugging printf statement.Dave Korn
2005-11-22* Makefile.in: Link cygcheck with libwininet.a.Christopher Faylor
* cygcheck.cc: Add includes. (grep_packages): New global variable. (display_internet_error): New function. (safe_chars): New global variable. (base_url): Ditto. (package_grep): New function. (usage): Reword --help output for clarity. Document new argument. (longopts): Add 'package-query' option. (opts): Add 'p' option, reorder to be consistent with 'longopts'. (main): Accommodate new option. * utils.sgml (cygcheck): Update --help output. Document new -p option.
2005-05-17* cygcheck.cc (cygwin_internal): Define as a "C" function.Christopher Faylor
* strace.cc (cygwin_internal): Ditto. * cygpath.cc (print_version): Update copyright.
2005-03-06* cygpath.cc (usage): Pass in one more copy of program_name to printf to avoidChristopher Faylor
a SEGV.
2005-02-24* cygpath.cc (usage): Clarify help output to indicate acceptanceJoshua Daniel Franklin
of multiple file names as arguments.
2004-03-16* cygpath.cc (usage): Don't issue helpful message if -i is used.Christopher Faylor
(from Igor Pechtchanski)
2004-02-25* cygpath.cc (long_options): Add "mode" option.Christopher Faylor
(options): Ditto. (usage): Report on new option. (report_mode): New function. (main): Implement -M option.
2004-02-21* Makefile.in (build_dumper): Detect missing iconv library.Christopher Faylor
* cygpath.cc (dowin): Report on filename conversion errors. (doit): Ditto. * strace.cc (main): Use symbolic constant for _STRACE_ALL when setting mask.
2004-01-22 * cygpath.cc (dowin): Revert accidental checkin from November.Corinna Vinschen
2003-11-07 * cygpath.cc (main): Allow multiple pathnames on command line.Corinna Vinschen
2003-10-17revert accidental checkinChristopher Faylor
2003-10-17* cygcheck.cc (pretty_id): Don't exec if `id' program is not found.Christopher Faylor
2003-09-11* Makefile.in (cygcheck.o): Use MINGW_CXX for compilation.Christopher Faylor
* cygcheck.cc: Just include <getopt.h> rather than cygwin version. (pretty_id): Avoid compiler warnings. * cygpath.cc (usage): Ditto.
2003-06-13Throughout, always return error when GetShortPathName returns 0.Christopher Faylor
2003-04-27* cygcheck.cc (usage) Add description output.Joshua Daniel Franklin
2003-02-13* cygpath.cc (doit): Allocate more space for non-path filename.Christopher Faylor
2002-10-31* cygpath.cc (get_long_path_name_w32impl): Define similarly to GetLongPathName.Christopher Faylor
(get_long_name): Correctly prototype GetLongPathName. (get_long_paths): Implement using get_long_name to cut down on code duplication. (doit): Do various things to make path output work predictably.