(dump_sysinfo): Ditto.
* loadlib.h (_load_sys_library): Mark as used, to avoid a compiler
warning.
* path.cc (oopt): Gurad with !FSTAB_ONLY to avoid a compiler warning.
(read_flags): Ditto.
(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.
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.
(transform_chars): New function, copied from Cygwin.
(simple_nt_stat): New function to check file existance using native
NT function. Explain why.
(directory_exists): Call simple_nt_stat.
(file_exists): Ditto.
(head): Move earlier.
(saw_file): Ditto.
(print_dlls): Reset head here. Record seen dll names so they will not
potentially be printed later.
(process_file): Remove clearing of head here.
(usage): Call cygwin_internal (CW_LST_MNT_OPTS) to create list of
mount options.
(print_version): Fix copyright date.
(main): Replace option processing loop with single call to
cygwin_internal (CW_CVT_MNT_OPTS).
(enum type_t): Change according to the fact that nl_langinfo now returns
all locale category values.
(lc_ctype_names): Add new category members. Redefine for exclusive
nl_langinfo usage.
(lc_numeric_names): Ditto.
(lc_time_names): Ditto.
(lc_collate_names): Ditto.
(lc_monetary_names): Ditto.
(lc_messages_names): Ditto.
(print_lc): Change switch according to new type_t values.
(loc_t): New type to keep locale information for printing.
(print_codeset): New function to print codeset as on Linux.
(print_locale_with_codeset): New function to print single locale.
Print verbose style as the Linux locale(1) tool.
(print_locale): New function to print single locale plus its UTF-8
variation, if available.
(compare_locales): New helper function for bsearch and qsort on loc_t.
(add_locale): New function to store locale in loc_t array.
(add_locale_alias_locales): New function to store locales from
locale.alias file in loc_t.
(print_all_locales): Call add_locale instead of printlocale.
Call add_locale_alias_locales, sort locales alphabetically and print
them.
semicolon-separated strings.
(enum type_t): New type is_sepstrings_linf.
(lc_time_names): Change type of era and alt_digits entry to
is_sepstrings_linf.
(print_lc): Add case for is_sepstrings_linf and call print_lc_mstrings
in that case.
* 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.
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.
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.
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.
(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.
(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.
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.
name isn't found and return 0 to allow searching to proceed. Always
return 0 or 1, not -1.
(enum_groups): Avoid error message if given group name isn't found.
* mkpasswd.c (enum_users): Ditto.
of path.cc for usage in mount.
(mount.exe): Add dependency to path-mount.o.
* mount.cc (force): Convert to bool value. Accommodate throughout.
(from_fstab): New function.
(do_mount_from_fstab): New function.
(longopts): Add --all option.
(opts): Add -a option.
(usage): Document -a/--all option.
(main): Handle -a option as well as single parameter.
* path.cc: Add FSTAB_ONLY conditional to allow building path-mount.o.
(mount_table): Remove static storage class.
(max_mount_entry): Ditto.
(root_here): Unused. Remove.
(from_fstab_line): Remove static.
* path.h (struct mnt_t): Define here rather than in path.cc.
(from_fstab_line): Declare.
(mount_table): Declare.
(max_mount_entry): Declare.
* utils.sgml (mount): Document -a/--all option and mounting of single
path from fstab files.
"override" entries.
(from_fstab_line): Handle mount points same as Cygwin itself. Use
"cygdrive prefix" as posix name of cygdrive prefix.
(from_fstab): Add auto entries for /usr/bin and /usr/lib. Add
MOUNT_AUTOMATIC and MOUNT_IMMUTABLE flags to default root dir entry.
Use "cygdrive prefix" as posix name of default cygdrive prefix.
(getmntent): Allocate smaller buffers. Align output closer to output
of mount(1).
2009-05-13 Corinna Vinschen <corinna@vinschen.de>
Christopher Faylor <me+cygwin@cgf.cx>
* mount.cc (mount_info::got_usr_bin): Define.
(mount_info::got_usr_lib): Ditto.
(mount_info::root_idx): Ditto.
(mount_info::create_root_entry): Create root entry as immutable and
flag as automatic.
(mount_info::init): Remove "Huh? No /etc/fstab..." warning.
Unconditionally call from_fstab for user and system tables. Fill in
/usr/bin and /usr/lib if they have not been specified in /etc/fstab.
(oopts): Alphabetize. Add "override" option to allow overriding
immutable mount points.
(mount_info::add_item): Accommodate new MOUNT_IMMUTABLE flag intended
for root mount.
(mount_info::add_item): Detect "/usr/bin", "/usr/lib", and "/" and set
appropriate global state.
(fillout_mntent): Add ,auto to mount points added by Cygwin DLL.
(mount): Remove masking of MOUNT_SYSTEM. Allow user to shoot
themselves. Add comment.
* mount.h (mount_info::got_usr_bin): Declare.
(mount_info::got_usr_lib): Ditto.
(mount_info::root_idx): Ditto.
* include/sys/mount.h: Reformat enum.
Add MOUNT_{OVERRIDE,IMMUTABLE,AUTOMATIC}.
doc ChangeLog
2009-05-13 Corinna Vinschen <corinna@vinschen.de>
Christopher Faylor <me+cygwin@cgf.cx>
* pathnames.sgml (mount-table): Sort mount options and add override
option. Add description of root mount handling.
utils ChangeLog
2009-05-13 Corinna Vinschen <corinna@vinschen.de>
Christopher Faylor <me+cygwin@cgf.cx>
* mount.cc (oopts): Sort. Add override option. Add dummy "auto"
option for consistency.
(mount_entries): Avoid adding auto-mounted entries to -m output.
* utils.sgml: Sort mount options. Add description of override option.
* ps.cc (main): Enable SE_DEBUG_NAME privilege if Windows processes
have to be enumerated. Workaround EnumProcessModules problem when
running under WOW64 and use NtQueryInformationProcess to fetch
process image name.
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.