Commit Graph

822 Commits

Author SHA1 Message Date
Jon TURNEY 5c4129d937 Improve strace to log most Windows debug events
Not sure if this is wanted, but on a couple of occasions recently I have been
presented with strace output which contains an exception at an address in an
unknown module (i.e. not in the cygwin DLL or the main executable), so here is a
patch which adds some more information, including DLL load addresses, to help
interpret such straces.

v2:
Use NtQueryObject() for HANDLE -> filename conversion
Add new '-e' option to toggle this additional logging

2015-06-07  Jon Turney  <jon.turney@dronecode.org.uk>

	* strace.cc (proc_child): Log process and thread create and exit,
	and DLL load and unload.
	(GetFileNameFromHandle): New function.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-06-11 12:00:51 +01:00
Corinna Vinschen 7701a023ff Drop Windows 2000 considerations in ps, fix uid field length
* ps.cc (main): Widen UID field in long format to accommodate longer
	UIDs since Cygwin 1.7.34.  Remove Windows 2000 considerations.  Fix
	comments accordingly.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-06-10 11:07:27 +02:00
Corinna Vinschen 117ebc802f Bind mounts require POSIX paths
* path.cc (from_fstab_line): Don't convert slashes to backslashes for
	bind mounts.  Explain why.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-06-08 17:37:55 +02:00
Corinna Vinschen 68994d6828 Asia/Calcutta -> Asia/Kolkata (not on unicode.org)
* tzmap-from-unicode.org: Convert Calcutta to Kolkata.
        * tzmap.h: Regenerate.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-04-23 22:03:45 +02:00
Corinna Vinschen 3da543e5bd * getfacl.c (usage): Change --all to --access, --dir to --default.
Align text to output of Linux tool.
	(longopts): Add --access and --default options.
2015-02-28 13:13:19 +00:00
Corinna Vinschen 773f4fa586 * mkgroup.c (MAX_SID_LEN): Remove. Instead, use SECURITY_MAX_SID_SIZE
throughout.
	(enum_unix_groups): Introduce numeric_psid and rearrange code to avoid
	potential heap corruption.
	* mkpasswd.c: Ditto.
2015-02-25 20:18:29 +00:00
Ken Brown 1415f18720 * dump_setup.cc (check_package_files): Accommodate postinstall
files in any directory whose name contains "/postinstall/", not
just /etc/postinstall.
2015-02-17 23:36:23 +00:00
Corinna Vinschen a6791b3bc7 * regtool.cc (longopts): Add --force option.
(opts): Add -f option.
	(restore_flags): New variable.
	(usage): Clarify working of save action.  Add restore action.  Add
	description for -f/--force option.
	(set_privilege): Drop function.  The Cygwin DLL is doing that anyway.
	(cmd_save): Drop call to set_privilege.
	(cmd_restore): New function.
	(main): Handle -f/--force option.
2015-02-03 15:14:57 +00:00
Corinna Vinschen e7ead873a8 * setfacl.c (action_t): Add DeleteDef value.
(delacl): Take new parameter to differe between DeleteAll and DeleteDef.
	Extend conditional to handle DefaultDef.  Change comment accordingly.
	(setfacl): Call delacl in DefaultDef case as well.
	(usage): Add and describe -k option.  Add -k to require options.
	(longopts): Add --remove-default option.
	(opts): Add -k option.
	(main): Handle -k option.
2014-12-15 20:29:43 +00:00
Corinna Vinschen ce6c6a4d82 * tzmap-from-unicode.org: Create tzmap as const.
* tzmap.h: Regenerate.
2014-12-05 14:39:04 +00:00
Corinna Vinschen 4c2380d396 * Makefile.in: Add rules to create and depend on tzmap.h.
* tzmap-from-unicode.org: New script to create tzmap.h.
	* tzmap.h: New auto-generated file.
	* tzset.c: Drop tzmap from here and include tzmap.h instead.  Drop
	Windows 2000 considerations.
2014-12-05 13:41:52 +00:00
Corinna Vinschen 3bde24b892 * mkgroup.c (main): Call enum_local_groups with offset 0x30000 for local
machine, too.
2014-11-28 08:44:39 +00:00
Corinna Vinschen f3939c059c * mkgroup.c (main): Call enum_groups with offset 0x30000 for local
machine, same as from DB.
	* mkpasswd.c (enum_unix_users): Set pw_passwd field to '*'.
	(enum_users): Ditto.
	(main): Call enum_users with offset of 0x30000 for local machine,
	same as from DB.
2014-11-27 19:55:37 +00:00
Corinna Vinschen cfd6979c39 * passwd.c (GetPW): If server is NULL, and the user is not a local
user, try to fetch the DC to use as server.
	(ChangePW): Get Windows username via extra parameter.
	(usage): Reduce -d help text to reflect above change.
	(main): Fix typo in comment.  Call GetPW and ChangePW as per the
	changes above.
2014-11-24 11:07:32 +00:00
Corinna Vinschen 35983199f3 * mkgroup.c (usage): Fix language.
* mkpasswd.c (usage): Ditto.
2014-11-12 14:22:05 +00:00
Corinna Vinschen 4acb3408e9 * mkgroup.c (enum_unix_groups): Always print groupname with machine
prefix.
	(usage): Extend help output for -l option.
	(main): Drop superfluous goto and label.  Make machine prefixing for
	local machine when using -l option dependend on options in
	/etc/nsswitch.conf.
	* mkpasswd.c: Ditto.
2014-11-12 14:13:56 +00:00
Corinna Vinschen df59ab7e7a * cygcheck.cc (dump_sysinfo): Handle Windows 10/Server 2014(?). 2014-11-10 16:21:52 +00:00
Corinna Vinschen 1c53098be3 Add accidentally missing patch 2014-11-03 16:29:03 +00:00
Corinna Vinschen fcb1765e87 * mkgroup.c (enum_local_groups): Don't generate leading separator char
for builtin accounts.
2014-11-03 14:54:43 +00:00
Corinna Vinschen d5b68452aa * setfacl.c (setfacl): Fix bracketing in expression. 2014-10-29 10:24:49 +00:00
Corinna Vinschen 8170e43b48 * setfacl.c (usage): Add -b to require options. 2014-10-27 10:28:13 +00:00
Corinna Vinschen fc58f46dd6 * setfacl.c (action_t): Add DeleteAll value.
(delacl): New function to remove all ACL entries not representing POSIX
	permissions.
	(setfacl): Rearrange conditional expression into switch statement.
	Add DeleteAll case.
	(usage): Add and describe -b option.
	(longopts): Add --remove-all option.
	(opts): Add -b option.
	(main): Handle -b option.
2014-10-27 10:25:02 +00:00
Corinna Vinschen a208583750 * cygcheck.cc (CYGLSA64_DLL): Remove unused macro.
(dump_sysinfo): If COMSPEC isn't set in the MSVCRT environment, set it.
	Explain why.
2014-10-21 10:59:40 +00:00
Corinna Vinschen ef1e66cfbf * setfacl.c (addmissing): New function to add missing acl entries to
a modified acl per the rules set by aclcheck.
	(setfacl): Call addmissing unless action is Delete.
2014-09-03 12:44:05 +00:00
Corinna Vinschen 451e1f4879 * setfacl.c (getaclentry): Fix previous fix again. Allow lone 'm' as
well as any lone default entry if action is Delete.  Fix comments.
	(usage): Align usage text.
2014-09-03 09:32:53 +00:00
Corinna Vinschen 89d195a7d1 * setfacl.c (getaclentry): Fix return value in case of a lone 'm' if
action is Delete.  Drop requirement for a trailing colon if action is
	Delete.
2014-09-03 08:57:20 +00:00
Corinna Vinschen 9845fcbb6b * setfacl.c (usage): Drop outdated note that default ACEs are not
taken into account.
2014-08-31 19:20:04 +00:00
Corinna Vinschen c7953da22d * getfacl.c (usage): Add flags description.
(main): Print suid/sgid/vtx flags if available.
2014-08-31 13:46:34 +00:00
Corinna Vinschen 7e46c0af62 * configure.ac: Convert to new AC_INIT style.
* configure: Regenerate.
2014-08-15 21:24:35 +00:00
Corinna Vinschen fbf2e44799 * utils.xml: Move to ../doc. 2014-08-14 19:33:57 +00:00
Corinna Vinschen 5528975705 * passwd.c (usage): Rename DAYS to MINDAYS and MAXDAYS.
* utils.xml (passwd): Ditto.
2014-08-06 19:24:57 +00:00
Corinna Vinschen 03ad777ab0 Add missing utils.xml 2014-07-29 13:31:33 +00:00
Corinna Vinschen c72a0d361d * mkgroup.c (usage): Move info message that this /etc/group isn't really
required anymore more to the top of the usage output.
	* mkpasswd.c (usage): Ditto for /etc/passwd.  Drop old text from output.
2014-07-29 13:29:54 +00:00
Corinna Vinschen 1f4923ae73 * passwd.c (main): Fix typo in error output. 2014-06-16 13:27:08 +00:00
Jon TURNEY 2915feb81e * minidumper.cc (filter_minidump_type): New function.
(minidump): Change default dump type from MiniDumpNormal to
	something with more useful information without getting too
	big. Use filter_minidump_type() to filter out unsupported dump
	types.
2014-05-13 10:26:26 +00:00
Jon TURNEY 8f8e7757cf * Makefile.in (minidumper.exe): Link directly with dbghelp.
* minidumper.cc (minidump): Ditto.
2014-05-13 10:24:16 +00:00
Jon TURNEY 638f0ebf90 * minidumper.cc (minidump): Fix copy and paste error in checking
result of OpenProcess().
2014-04-21 12:02:59 +00:00
Corinna Vinschen 16c7ecbb9d Fix ChangeLog entry date. 2014-03-11 15:15:33 +00:00
Corinna Vinschen 16a976cff4 * mkgroup.c (domlist_t): Drop id_offset.
(get_dcname): Remove.
	(current_group): Remove.
	(enum_unix_groups): Simplify.  Change space to underscore in domain
	name.
	(enum_local_groups): Simplify to accommodate the fact that it's only
	called for foreign machines.
	(enum_groups): Ditto.
	(print_special_by_sid): Remove.
	(print_special_by_name): Remove.
	(usage): Align to new code.
	(fetch_primary_domain): Remove.
	(main): Use cygwin_internal CW_SETENT, CW_GETENT and CW_ENDENT method.
	Call enum_local_groups, enum_groups, and enum_unix_groups only for
	foreign machines.
	* mkpasswd.c (get_dcname): Remove.
	(current_user): Remove.
	(enum_unix_users): Simplify.  Change space to underscore in domain name.
	(enum_users): Simplify to accommodate the fact that it's only
	called for foreign machines.
	(print_special_by_sid): Remove.
	(usage): Align to new code.
	(longopts): Add -b/--no-builtin option.
	(opts): Add -b option.
	(print_special_by_name): Remove.
	(enum_std_accounts): Remove.
	(fetch_primary_domain): Remove.
	(main): Use cygwin_internal CW_SETENT, CW_GETENT and CW_ENDENT method.
	Call enum_users and enum_unix_users only for foreign machines.
	* utils.xml (mkgroup): Align documentation to new usage.
	(mkpasswd): Ditto.
2014-02-24 10:51:42 +00:00
Jon TURNEY bdcad00bdf * minidumper.cc (minidump): Fix -t option argument handling. 2014-02-23 11:34:31 +00:00
Jon TURNEY d0e5dd3abe 2014-02-07 Jon TURNEY <jon.turney@dronecode.org.uk>
* minidumper.cc: New file.
	* Makefile.in (CYGWIN_BINS): Add minidumper.
	* utils.xml (minidumper): New section.
2014-02-09 12:23:13 +00:00
Corinna Vinschen 8856f1f00e * cygcheck.cc (RtlGetVersion): Declare.
(dump_sysinfo): Call RtlGetVersion rather than GetVersionEx to get
	correct OS info even on Windows 8.1.  Don't check return value since
	RtlGetVersion never fails per MSDN.  Move fetching kernel32 module
	handle where it's really needed.  Drop temporary comment added by
	previous checkin.
2013-11-19 22:26:37 +00:00
Corinna Vinschen f8863cbe54 * cygcheck.cc (dump_sysinfo): Revert Windows 8.1 hack. It's not
working.  Add a (hopefully temporary) comment.
2013-11-19 20:43:04 +00:00
Corinna Vinschen 85cef403d8 Add missing entry 2013-11-19 17:49:35 +00:00
Corinna Vinschen d134686a10 * cygcheck.cc (dump_sysinfo): Drop code trying to fetch OSVERSIONINFO
if fetching OSVERSIONINFOEX failed.  Drop code handling unsupported
	platform IDs.  Add code to tweak dwMinorVersion on Windows 8.1 if no
	manifest is present.
2013-11-19 17:44:33 +00:00
Corinna Vinschen 700a3783ee * Makefile.in (cygcheck.exe): Link against wininet.dll.
(dumper.exe): Link against psapi.dll.
	* cygcheck.cc (_WIN32_WINNT): Define as 0x0602.
	(pInternetCloseHandle): Drop pointer.
	(PRODUCT_UNLICENSED): Drop definition.
	(PRODUCT_PROFESSIONAL_WMC): Ditto.
	(package_grep): Delete code loading wininet functions dynamically, just
	call functions directly.
2013-11-19 11:14:36 +00:00
Corinna Vinschen 32fefe6e24 * cygcheck.cc (dump_sysinfo): Distinguish Windows 8 and 8.1, as well
as Windows Server 2012 and 2012 R2.  Add missing commas in products
	array to avoid crashes.  Drop Windows NT4 and 2000 printouts.  Just
	call IsWow64Process, GetNativeSystemInfo, and GetDiskFreeSpaceEx
	directly, rather than loading them dynamically, since they are exported
	by all supported OS versions.  Fix questionable type usage in call to
	GetDiskFreeSpaceEx.
2013-11-19 10:43:10 +00:00
Christopher Faylor 2a6d6db8e2 winsup/ChangeLog:
2013-11-06  Christopher Faylor  <me.cygwin2013@cgf.cx>

	* configure.ac: Detect windows headers/libs after we've figured out the
	C compiler.
	* configure: Regenerate.
	* aclocal.m4: Regenerate.
	* configure.cygwin: Default to '.' if can't find a winsup directory.

winsup/cygserver/ChangeLog:
2013-11-06  Christopher Faylor  <me.cygwin2013@cgf.cx>

	* configure.ac: Detect windows headers/libs after we've figured out the
	C compiler.
	* configure: Regenerate.
	* aclocal.m4: Regenerate.

winsup/cygwin/ChangeLog:
2013-11-06  Christopher Faylor  <me.cygwin2013@cgf.cx>

	* configure.ac: Detect windows headers/libs after we've figured out the
	C compiler.
	* configure: Regenerate.
	* aclocal.m4: Regenerate.

winsup/utils/ChangeLog:
2013-11-06  Christopher Faylor  <me.cygwin2013@cgf.cx>

	* configure.ac: Detect windows headers/libs after we've figured out the
	C compiler.
	* configure: Regenerate.
	* aclocal.m4: Regenerate.
2013-11-07 00:19:52 +00:00
Christopher Faylor 9a2f0cff8f * dump_setup.cc (find_tar_ext): Generalize search for .tar extension, avoiding
looking for specific compression types.
2013-09-16 17:01:58 +00:00
Christopher Faylor 94f900f805 * cygcheck.cc (package_grep): Accommodate arch-specific package layout. 2013-08-23 19:56:26 +00:00
Corinna Vinschen 7df2c73d5d * Makefile.in (MINGW_LDFLAGS): Don't link against w32api libs. These
are only for Cygwin executables.
2013-07-31 09:58:55 +00:00
Christopher Faylor 40f11fc133 * cygcheck.cc (dll_info): Detect and report on symlinks. Output wrong
architecture message inline with stdout for clarity.
* path.cc (is_symlink): Always reset file pointer to beginning on exit.
(readlink): Assume that file pointer is set to the beginning.
2013-07-07 16:57:11 +00:00
Corinna Vinschen 733b554b20 * cygpath.cc (do_pathconv): when -p option is given, generate wide
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-06-26 13:10:35 +00:00
Corinna Vinschen 649619b56d Reinstantiate accidentally removed patch from 2009-05-16:
* Makefile.in (cygpath.exe): Link against cygwin.a before linking
	against ntdll.dll to avoid linking symbols defined in both DLLs
	from ntdll.
	(ps.exe): Ditto.
2013-05-21 09:32:12 +00:00
Warren Young a2a7aa3f4c - Added <?xml> and <!DOCTYPE> tags to the top of utils.xml and pretty-
printed it.
- Removed obsolete utils.sgml
- Added a ChangeLog entry for this replacement, which partially took
  place days ago.  This checkin formalizes the switch from SGML to
  DocBook XML for this file.
2013-05-10 15:58:48 +00:00
Warren Young 8142972d87 Modernized user guide, API reference, and FAQ generation. Overall
effect is to move away from DocBook SGML and DJ Delorie's doctool and
toward pure DocBook XSL.  (There remains just one use of doctool, and
we have plans for replacing it, too.)  See ChangeLog for details.
2013-05-01 23:30:25 +00:00
Corinna Vinschen 61522196c7 * Merge in cygwin-64bit-branch. 2013-04-23 09:44:36 +00:00
Yaakov Selkowitz 7e38f161ea * Makefile.in (CYGWIN_LDFLAGS): Replace -static-lib* with -static.
(MINGW_LDFLAGS): Ditto.
(ZLIB): Simplify accordingly.
2013-02-21 02:13:17 +00:00
Christopher Faylor df0f949cfd Update copyrights 2013-01-21 16:28:27 +00:00
Corinna Vinschen 783105ea4a * utils.sgml (mount): Document sparse mount option. 2012-12-14 11:11:17 +00:00
Christopher Faylor 29413f0630 * Makefile.in: Move CFLAGS and CXXFLAGS so that they can be manipulated by
Makefile.common.  Add -static-libstdc++ to *LDFLAGS.  Add dependencies for
loadlib.h.
* loadlib.h: Update copyright.
(_load_sys_library): Properly define set_dll_library as WINAPI to avoid stack
corruption.
2012-11-28 03:22:36 +00:00
Christopher Faylor 66444a6b40 * Makefile.in (ZLIBS): Common define to force static load.
(MINGW_LDFLAGS): Use static libgcc.
2012-11-27 21:32:36 +00:00
Christopher Faylor 1f3843930e * Makefile.in: Make sure that libz is always loaded staticly. 2012-11-27 16:14:52 +00:00
Christopher Faylor d4f4d1d0d6 ChangeLog:
2012-11-26  Christopher Faylor  <me.cygwin2012@cgf.cx>

	* configure.ac: Rename from configure.in.
	* configure.in: Delete.
	* configure: Regenerate.

cygserver/ChangeLog:
2012-11-26  Christopher Faylor  <me.cygwin2012@cgf.cx>

	* configure.ac: Rename from configure.in.
	* configure.in: Delete.
	* configure: Regenerate.

cygwin/ChangeLog:
2012-11-26  Christopher Faylor  <me.cygwin2012@cgf.cx>

	* configure.ac: Rename from configure.in.
	* configure.in: Delete.
	* configure: Regenerate.

doc/ChangeLog:
2012-11-26  Christopher Faylor  <me.cygwin2012@cgf.cx>

	* configure.ac: Rename from configure.in.
	* configure.in: Delete.
	* configure: Regenerate.

lsaauth/ChangeLog:
2012-11-26  Christopher Faylor  <me.cygwin2012@cgf.cx>

	* configure.ac: Rename from configure.in.
	* configure.in: Delete.
	* configure: Regenerate.

testsuite/ChangeLog:
2012-11-26  Christopher Faylor  <me.cygwin2012@cgf.cx>

	* configure.ac: Rename from configure.in.
	* configure.in: Delete.
	* configure: Regenerate.

utils/ChangeLog:
2012-11-26  Christopher Faylor  <me.cygwin2012@cgf.cx>

	* configure.ac: Rename from configure.in.
	* configure.in: Delete.
	* configure: Regenerate.
2012-11-26 19:50:45 +00:00
Corinna Vinschen 3afc3efbab * bloda.cc: Drop Mingw.org considerations.
* dump_setup.cc: Ditto.
	* strace.cc: Ditto.
2012-11-26 13:13:25 +00:00
Christopher Faylor 4c36016b57 ChangeLog:
2012-11-12  Christopher Faylor  <me.cygwin2012@cgf.cx>

	* Makefile.common: Revamp for new configury.  Add default compilation
	targets, include .E processing.  Add magic for allowing "CFLAGS" to
	control optimization options in "CXXFLAGS".
	* configure.cygwin: New include for Cygwin configure.in's.
	* acinclude.m4: Delete old definitions.  Implement AC_WINDOWS_HEADERS,
	AC_WINDOWS_LIBS, AC_CYGWIN_INCLUDES, target_builddir, winsup_srcdir.
	* aclocal.m4: Regenerate.
	* autogen.sh: New file.
	* ccwrap: New script.
	* c++wrap: New script.
	* config.guess: New script.
	* config.sub: New script.
	* configure: Regenerate.
	* configure.in: Eliminate LIB_AC_PROG_* calls in favor of standard.
	Delete ancient target test.
	* install-sh: New script.

cygserver/ChangeLog:
2012-11-12  Christopher Faylor  <me.cygwin2012@cgf.cx>

	* Makefile.in: Revamp for new configury.
	* configure.in: Revamp for new configury.
	* aclocal.m4: Regenerate.
	* configure: Ditto.
	* autogen.sh: New script.

cygwin/ChangeLog:
2012-11-22  Christopher Faylor  <me.cygwin2012@cgf.cx>

	* select.cc (select): Don't return -1 when we've timed out after
	looping.

2012-11-22  Christopher Faylor  <me.cygwin2012@cgf.cx>

	* Makefile.in: Revamp for new configury.
	(datarootdir): Add variable setting.
	(winver_stamp): Accommodate changes to mkvers.sh setting.
	(libc.a): Fix race when libm.a might not have been built yet.
	* configure.in: Revamp for new configury.
	* aclocal.m4: Regenerate.
	* configure: Ditto.
	* autogen.sh: New script.
	* mkvers.sh: Find include directives via CFLAGS and friends rather than
	assuming that w32api lives nearby.

utils/ChangeLog:
2012-11-12  Christopher Faylor  <me.cygwin2012@cgf.cx>

	* aclocal.m4: Regenerate.
	* configure: Ditto.
	* autogen.sh: New script.
	* configure.in: Revamp for new configury.
	* Makefile.in: Revamp for new configury.  Rename ALL_* to just *.
	Always use "VERBOSE" setting.
	(MINGW_CXX): Don't include CFLAGS in definition.
	(all): Define target first, before everything else so that it is the
	default.
	(ps.exe): Don't add useless -lcygwin.
	(ldh.exe): For consistency, add to existing MINGW_LDFLAGS rather than
	redefining them.
	(cygcheck.exe): Always include -lz for MINGW_LDFLAGS.  Don't try to
	figure out where to find it.
	(dumper.exe): Simplify check.  Assume libraries are installed rather
	than trying to retrieve from source tree.
	(install): Just use /bin/mkdir to create directories.
	(Makefile): Regenerate when standard dependencies change.
	* dump_setup.cc: Always include zlib.h.  Remove accommodations for it
	possibly not existing.
	* parse_pe.cc: Add define which allows building with installed
	binutils package.
	* dumper.cc: Ditto.
2012-11-23 13:22:47 +00:00
Corinna Vinschen 41783b90a2 * path.cc (vcygpath): Handle cygdrive prefix. 2012-11-09 08:53:01 +00:00
Corinna Vinschen 5b31f27f6d winsup:
* Makefile.common (zlib_source): Remove.
	(zlib_build): Remove.
	(bz2lib_source): Remove.
	(bz2lib_build): Remove.
	(w32api_source): Remove.
	(w32api_build): Remove.
	(w32api_lib): Remove.
	(mingw_build): Remove.
	(mingw_source): Remove.
	($(w32api_lib)/%.a): Remove rule.
	* Makefile.in (ZLIB): Remove.
	($(SUBDIRS)): Drop mingw check.
	(mingw): Remove rule.
	(install_mingw): Ditto.
	* configure.in: Remove support for mingw as build target.
	* configure: Regenerate.

utils:

	* Makefile.in ($(MINGW_BINS)): Drop -B$(mingw_build)/ from build
	expression.
2012-11-07 16:32:08 +00:00
Corinna Vinschen 4d586ac09e * Makefile.in (MINGW_CXX): Attach $(CFLAGS) to allow providing
build option tweaks to mingw compiler as well.
2012-11-05 11:15:23 +00:00
Corinna Vinschen 18b785b899 * configure.in: Add AC_NO_EXECUTABLES,
* configure: Regenerate.
2012-10-24 12:45:09 +00:00
Yaakov Selkowitz 7c61aa7ece * configure.in: Add check for MINGW_CXX. Remove libiconv check.
* configure: Regenerate.
	* Makefile.in: Remove references to mingw and w32api directories.
	Use MINGW_CXX instead of mingw script to build MINGW_BINS.
	Check for libiconv with $CC --print-file-name.
	* cygcheck.cc: Use relative include paths for Cygwin headers.
	* path.cc: Ditto.
	* strace.cc: Ditto
	* mingw: Remove.
2012-10-24 10:15:27 +00:00
Corinna Vinschen ae78ffd40a * Makefile.in (cygcheck.exe): Add temporary (1.7.17-only) hack to
allow cygcheck running on pre-Vista despite of the new w32api not
	matching the locally used w32api.
2012-10-19 11:58:48 +00:00
Corinna Vinschen f085c12fd7 * cygcheck.cc (dump_sysinfo): Convert "if/else if" chain to a switch
statement.  Drop "not yet supported" and "Server" from Windows 2012
	output string.
2012-10-09 12:47:40 +00:00
Corinna Vinschen 199a8245e0 * cygcheck.cc (dump_sysinfo): Drop "not yet supported" text from
Windows 8.  Update products array.
2012-09-02 10:06:12 +00:00
Corinna Vinschen 6e1e3bb8e5 * Makefile.in (cygcheck.exe): Link against psapi.dll.
* bloda.cc: Change include section to work with Mingw64 headers.
	Include psapi.h.  Use SystemProcessInformation instead of
	SystemProcessesAndThreadsInformation throughout and add define for
	w32api headers.  Ditto for PSYSTEM_PROCESS_INFORMATION vs.
	PSYSTEM_PROCESSES.
	(system_module_list): New type to replace SYSTEM_MODULE_INFORMATION.
	Change usage throughout accordingly.
	(get_module_list): Fetch module list using PSAPI functions
	EnumDeviceDrivers and GetDeviceDriverBaseNameA.
	* cygcheck.cc (max): Define as __max if not defined already.
	(alloca): Only define if not defined already.
	(handle_unique_object_name): Use explicit sharing flags rather than
	FILE_SHARE_VALID_FLAGS which officially is only available in DDK
	headers.
	(PRODUCT_ULTIMATE_E): Only define if not defined already.
	* dump_setup.cc: Change include section to work with Mingw64 headers.
	(NtQueryAttributesFile): Drop NTOSAPI aka DECLSPEC_IMPORT.
	* strace.cc: Change include section to work with Mingw64 headers.
	(alloca): Only define if not defined already.
2012-07-11 16:41:51 +00:00
Corinna Vinschen 9cfc9511cd * cygpath.cc: Change including headers to allow building against
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.
2012-07-06 14:52:33 +00:00
Corinna Vinschen 6a713dabad * cygcheck.cc (dump_sysinfo): Change "Server 8" to official
"Server 2012".
2012-06-03 16:45:27 +00:00
Corinna Vinschen 6428476bdd * mkpasswd.c (current_user): Actually *use* $HOME if it's available.
Add comment to explain what we're doing here.
2012-05-05 08:55:17 +00:00
Corinna Vinschen 036fb4772c * mkgroup.c (print_special_by_sid): Rename from print_special. Change
calls throughout.
	(print_special_by_name): New function.
	(main): Call print_special_by_name for TrustedInstaller account.
	* mkpasswd.c (print_special_by_sid): Rename from print_special.  Change
	calls throughout.
	(print_special_by_name): New function.
	(enum_std_accounts): Call print_special_by_name for TrustedInstaller
	account.
2012-04-05 13:37:32 +00:00
Yaakov Selkowitz 7ab41ee33a * pldd.c: Fix typo in license header. 2012-02-24 21:53:28 +00:00
Yaakov Selkowitz 769e28572c * pldd.c: Fix formatting. 2012-02-24 10:38:20 +00:00
Yaakov Selkowitz e2bf82d361 * Makefile.in (CYGWIN_BINS): Add pldd.
(pldd.exe): Add -lpsapi to ALL_LDFLAGS.
* pldd.c: New file.
* utils.sgml (pldd): New section.
2012-02-24 10:19:01 +00:00
Corinna Vinschen a442c9cddc * passwd.cc: Add -v option to print version information as well, since
it's used in older csih.
2012-02-09 10:11:26 +00:00
Corinna Vinschen 56f115b527 * utils.sgml: Fix typos. 2012-02-04 11:42:04 +00:00
Christopher Faylor 44e1d662cb * strace.cc (proc_child): Don't right-shift exit value.
(main): Call ExitProcess() to exit exactly the same way as any straced child.
2012-01-31 18:06:51 +00:00
Corinna Vinschen 54c743c8f8 * tzset.c: Throughout use wide characters to be locale agnostic.
(main): Call setlocale.
2012-01-29 12:06:23 +00:00
Corinna Vinschen 1b79b38101 * Makefile.in (CYGWIN_BINS): Add tzset.
* tzset.c: New tool, new file.
	* utils.sgml (tzset): New section.

	* new-features.sgml (ov-new1.7.10): Add tzset.

	* release/1.7.10: Add tzset.
2012-01-29 09:41:06 +00:00
Yaakov Selkowitz abd9714a7b * ldd.cc (start_process): Handle .oct and .so as DLLs. 2012-01-24 06:29:01 +00:00
Corinna Vinschen 185ad82d2d Don't leave Windows 2000 behind.
* Makefile.in (ps.exe): Revert previous change.
	* ps.cc: Include psapi.h again.
	(main): In CW_GETPINFO_FULL case.  Evaluate minimal process access mask
	required per OS and use that in OpenProcess call.  Use
	GetModuleFileNameExW on Windows 2000 or if fetching the drive mapping
	failed.  Handle empty process name.
2011-12-22 13:48:05 +00:00
Corinna Vinschen 1281d5fc02 * Makefile.in (ps.exe): Drop -lpsapi from ALL_LDFLAGS.
* ps.cc: Don't include psapi.h.
	(dosdevs): Drop.
	(unicode_buf): Define.
	(main): Simplify path evaluation in CW_GETPINFO_FULL case. Fetch drive
	map from Cygwin DLL.  Use it to convert NT device paths to Win32 paths.
2011-12-22 12:40:26 +00:00
Christopher Faylor 1b23b30b29 Clean up whitespace. 2011-12-17 23:39:47 +00:00
Corinna Vinschen 71148bfcd5 * Makefile.in (cygpath.exe): Add -luserenv to ALL_LDFLAGS.
* 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-12-02 16:15:26 +00:00
Corinna Vinschen 13a20f9565 * mkgroup.c: Drop support for NT4 domains.
* mkpasswd.c: Ditto.
	(psx_dir): Remove.
	(current_user): Drop support for -m option.  Use $HOME as is since it's
	a POSIX path anyway.
	(enum_users): Drop support for -m option.
	(usage): Mention -m option as ignored.
	(main): Drop support for -m option.  Mark ignored options as deprecated.
	* utils.sgml (mkpasswd): Remove description of -m option.
2011-12-01 13:06:13 +00:00
Corinna Vinschen c1af7c27eb * locale.cc (print_locale_with_codeset): Fetch Windows path as UNICODE
path and convert that to POSIX.
2011-11-28 17:58:48 +00:00
Corinna Vinschen c47ec78d7a * ps.cc: Remove all Win 9x considerations. Use psapi functions
directly.  Drop support for older Cygwin DLLs.  Just use progname_long
	as is since it's already a POSIX path now.  Rename "tty" to "pty" as in
	the Cygwin DLL.  Call setlocale to make sure wcstombs does the right
	thing according to the current locale.
	* Makefile.in (ps.exe): Link against psapi.dll.
2011-11-28 17:49:56 +00:00
Christopher Faylor 505bce274f * strace.cc (attach_process): Use NT_SUCCESS to figure out if
NtSetInformationProcess succeeded.
(handle_output_debug_string): Put back DebugActiveProcess since it seems to
still be needed (on my system at least).  Detect new format
_STRACE_INTERFACE_ACTIVATE_ADDR which informs whether this is a forked process
or not.  Use that to decide if forkdebug should be handled.
2011-11-24 21:54:41 +00:00
Christopher Faylor 07e7349db2 * strace.cc (handle_output_debug_string): Disable code which attempted to add
stuff in between '****' blocks since they no longer are the first thing output
by an straced process.
2011-11-14 17:31:20 +00:00
Corinna Vinschen 551a3d64c9 * cygcheck.cc (dump_sysinfo): Add Windows 8 recognition. Note as
unsupported.  Update products array.
2011-10-13 17:50:48 +00:00
Yaakov Selkowitz 14b9008cca * utils.sgml (getconf): Expand documentation. 2011-10-11 21:53:57 +00:00
Corinna Vinschen f213601cda * ldd.cc (VERSION): Remove. 2011-10-10 15:34:52 +00:00
Christopher Faylor c4fc42535c * ldd.cc: Update copyright. 2011-10-10 15:04:00 +00:00
Corinna Vinschen 92b499acff * Align usage output, version output, as well as usage and version
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.
2011-10-10 14:57:48 +00:00
Corinna Vinschen 9198ac4dc6 * locale.cc (usage): Restructure, rephrase, add new options. Drop
arguments, don't exit.
	(print_version): New function.
	(longopts): Add -f, -n, and -V options.  Reorder.
	(opts): Add -f, -n, and -V options.
	(main): Call GetSystemDefaultUILanguage for -s option.  Call
	GetUserDefaultUILanguage for -u option.  Add -f and -n options and
	call GetUserDefaultLCID and GetSystemDefaultLCID respectively.  Return
	0 after calling usage in -h case.  Add -V option and call print_version.
	Don't print full usage in default case, rather just a short help message
	similar to GNU tools.
	* utils.sgml (locale): Align to above changes.  Rephrase description.
2011-10-10 09:50:43 +00:00
Corinna Vinschen f818494c63 * cygcheck.cc (check_keys): Use UNICODE Win32 functions. 2011-10-10 09:42:00 +00:00
Jon TURNEY 02a7f96ef7 * strace.cc (attach_process): Try to turn off DEBUG_ONLY_THIS_PROCESS
if Attaching to a process with the trace-children flag set.
	(handle_output_debug_string): Apparently we don't need to explicitly
	attach for debugging when a child process starts
	* Makefile.in (strace.exe): Link with ntdll
2011-09-15 16:49:51 +00:00
Christopher Faylor 8f8977bb8b * Makefile.in: Check for header file existence when building dumper.exe too. 2011-08-21 19:36:52 +00:00
Corinna Vinschen 56a85b9cea * ps.cc (main): Don't overwrite process name, just attach <defunct>
to it for zombie processes.
2011-08-10 19:52:41 +00:00
Yaakov Selkowitz c769bdf5ac * Makefile.in (CYGWIN_BINS): Add getconf.
(getconf.c): New file.
2011-07-20 01:18:14 +00:00
Christopher Faylor d0009604ad * mingw: Force use of bash. 2011-06-14 15:04:04 +00:00
Christopher Faylor a4fddeb9f6 * ps.cc (ttynam): Accommodate new console numbering.
(main): Ditto.
2011-05-29 15:20:10 +00:00
Corinna Vinschen 3728c79d48 * locale.cc (print_locale_with_codeset): Align printing of locale names
to POSIX.
2011-05-03 10:34:25 +00:00
Corinna Vinschen 1122b3e64e * setfacl.c (getaclentry): Allow extra colon in mask and other entries. 2011-04-18 10:23:21 +00:00
Jon TURNEY cc00d3deb9 2011-04-12 Jon TURNEY <jon.turney@dronecode.org.uk>
* utils.sgml (strace): Fix a pair of exchanged lines in usage text.
2011-04-13 11:42:43 +00:00
Corinna Vinschen ff73fd1ec1 * passwd.c (main): Add the ability to specify a username for the -R
command.
	* utils.sgml: Document the aforementioned change.
2011-04-04 09:09:43 +00:00
Corinna Vinschen 51564c783f * regtool.cc (cmd_set): Avoid a compiler warning. 2011-03-30 08:22:59 +00:00
Corinna Vinschen d7d8e7ce07 * cygcheck.cc (handle_unique_object_name): Avoid a compiler warning.
(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.
2011-03-29 11:02:58 +00:00
Corinna Vinschen 471bbbe240 * setfacl.c (strchrnul): Drop local implementation. 2011-03-28 21:21:03 +00:00
Corinna Vinschen e99f262f7b * cygcheck.cc: Fix copyright dates. 2011-02-15 15:57:35 +00:00
Corinna Vinschen 0a18555e4f * cygcheck.cc (main): don't imply -d from -s option to cygcheck 2011-01-10 12:51:02 +00:00
Corinna Vinschen d7b90bae79 * setfacl.c (strchrnul): New function.
(getaclentry): Rewrite.
2010-12-11 20:47:01 +00:00
Corinna Vinschen ac5d7dcd18 * cygpath.cc (get_device_name): Fix path length test. 2010-12-06 13:40:24 +00:00
Christopher Faylor 418709899d * regtool.c (cmd_set): Write correct number of bytes for REG_MULTI_SZ case. 2010-10-31 01:41:19 +00:00
Corinna Vinschen d2cc418e6e * cygpath.cc (RtlEqualUnicodePathPrefix): New helper function.
(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-09-06 09:48:55 +00:00
Corinna Vinschen 552bc28f46 * ldh.cc (WinMain): Change DONT_RESOLVE_DLL_REFERENCES to
LOAD_WITH_ALTERED_SEARCH_PATH.
2010-08-28 12:12:53 +00:00
Corinna Vinschen 71d8f118da * loadlib.h: New header implementing safe LoadLibrary calls.
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-28 11:22:37 +00:00
Corinna Vinschen 708bbfd08e * cygpath.cc (get_device_name): Prefer the \\.\X: DOS device for
harddisks, if available.
2010-08-26 12:06:27 +00:00
Corinna Vinschen 16e1c98c1b * ldd.cc (report): Drop long pathname considerations which result in
invalid path, now that this is done in cygwin_conv_path.
2010-08-23 11:04:04 +00:00
Corinna Vinschen 5578c33733 * mount.cc (from_fstab): Fix potentially fatal typo. 2010-08-13 19:10:22 +00:00
Corinna Vinschen 68a178b37c * mount.cc (do_mount): Don't treat "bind" mount as remote mount.
(mount_entries): Drop the "bind" option from output.
	* utils.sgml (mount): Match examples to actual mount output.  Add
	"bind" option and add example.
2010-08-11 11:01:14 +00:00
Yaakov Selkowitz ac8050277c * mingw: Use sysroot, if present, for mingw_dir. 2010-08-11 03:01:55 +00:00
Corinna Vinschen 822b654fe0 * dump_setup.cc (tfx_chars): New WCHAR array, copied from Cygwin.
(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.
2010-07-21 10:30:53 +00:00
Christopher Faylor c8fe6dc446 * ldd.cc: Clean up formatting throughout.
(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.
2010-07-05 16:24:24 +00:00
Corinna Vinschen 96f1582977 * dump_setup.cc (dump_file): Read requested content from setup.rc
file created by newer setup.exe.
2010-07-05 12:28:48 +00:00
Corinna Vinschen 01798d4e59 * utils.sgml (locale): Change stray local cygdrive prefix to Cygwin's
default.
2010-06-29 15:12:52 +00:00
Corinna Vinschen 3db442e639 * utils.sgml (mount): Add description for "dos" and "ihash" mount
options.
2010-04-29 10:53:31 +00:00
Corinna Vinschen a361b4715f * path.cc: Include sys/cygwin.h if built for mount(1).
(struct opt): Add "dos" and "ihash" options.
	(from_fstab_line): Call cygwin_internal rather than read_flags if
	built for mount(1).
2010-04-29 10:39:35 +00:00
Corinna Vinschen a82a8dcb4e * mount.cc (oopts): Remove entirely.
(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).
2010-04-29 08:50:23 +00:00
Corinna Vinschen 22b6e8101e * locale.cc (print_lc_xxx_charset): Remove.
(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.
2010-04-28 10:00:40 +00:00
Corinna Vinschen 0b66e4d7aa * locale.cc (print_charmaps): Add EUC-CN and GB2312. 2010-03-27 21:08:02 +00:00
Corinna Vinschen 708d2a1e64 * regtool.cc (find_key): Fix allocation size of "value". 2010-03-24 19:52:00 +00:00
Corinna Vinschen 536ad25322 * locale.cc (add_locale_alias_locales): Always use loc_num at function
start to avoid confusing bsearch.
2010-03-23 21:26:03 +00:00
Corinna Vinschen 1399e29a1f * locale.cc: Revert accidental checkin of unfinished changes. 2010-03-23 21:20:31 +00:00
Corinna Vinschen 1d4c87a15d * locale.cc (print_locale_with_codeset): Drop redundant name parameter.
Simplify creating locale string.  Add "@" in case of a modifier.
	(print_locale): Drop name parameter in calls to
	print_locale_with_codeset.
2010-03-23 21:01:01 +00:00
Yaakov Selkowitz e5ddf94aa1 * utils.sgml (kill): Add SIGIO, SIGCLD, and SIGPWR. 2010-02-26 10:47:05 +00:00
Corinna Vinschen a8260e19f9 * utils.sgml (locale): Change description of -a and -av to match
latest changes.
2010-02-25 16:42:59 +00:00
Corinna Vinschen a2036998b1 * locale.cc (printlocale): Remove.
(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.
2010-02-23 14:07:08 +00:00
Christopher Faylor dbf41aeeff * strace.cc (mnemonic_table): Add "special" mask option.
(usage): Document it.
* utils.sgml: Ditto.
2010-02-22 20:39:18 +00:00
Corinna Vinschen 80206d7f71 * cygpath.cc (do_pathconv): Fix erroneously printing native NT path
prefix introduced by previous patch.
2010-02-22 17:40:46 +00:00
Corinna Vinschen bd87c87f81 * locale.cc (lc_time_names): Add "date_fmt" entry. 2010-02-22 10:56:00 +00:00
Christopher Faylor 3afd8b74d9 Update copyright 2010-02-19 20:01:49 +00:00