Commit Graph

170 Commits

Author SHA1 Message Date
Corinna Vinschen 94a23f4860 * passwd.c: Rearrange includes to avoid unnecessary warnings.
(GetPW): Add parameter to (dis)allow printing of Windows username.
	Use defines instead of numerical constants where possible.
	Try avoiding impersonation problem.  Rearrange to print Windows
	username only if it's different from Cygwin username.
	(ChangePW): Use defines instead of numerical constants where possible.
	(main): Call GetPW with additional parameter.  Change error text.

	* passwd.c (GetPW): Handle case of user-edited /etc/passwd
	with cygwin_internal (CW_EXTRACT_DOMAIN_AND_USER, ...).
2002-06-14 11:31:33 +00:00
Christopher Faylor 548e0dad4b * path.cc (cygpath): Change MOUNT_AUTO to MOUNT_CYGDRIVE.
(getmntent): Ditto.
2002-06-09 05:08:44 +00:00
Christopher Faylor 94cc482c64 * mount.cc (main): Use default system/user flag for cygdrive stuff, too.
(change_cygdrive_prefix): Change MOUNT_AUTO to MOUNT_CYGDRIVE.
* umount.cc (remove_cygdrive_prefix): Ditto.
(main): Use default system/user flag for cygdrive stuff, too.
2002-06-09 04:54:32 +00:00
Christopher Faylor 60a3d46123 * mount.cc (opts): Remove '-i' option.
(usage): Ditto.
(main): Ditto.
(longopts): Remove --import-old-mounts option.
2002-06-09 00:33:27 +00:00
Christopher Faylor 2bd6505b39 * cygpath.cc: Add option to output windows paths in different formats: "dos"
and "mixed".
(main): Process options.
(doit): Check new options flags.
2002-06-07 19:25:26 +00:00
Corinna Vinschen 381fb8baa1 * regtool.cc (Fail): Be more verbose.
(find_key): Add support for remote registry access.
	(usage): Document it.
	* utils.sgml: Document it.
2002-06-07 11:12:16 +00:00
Christopher Faylor b841df7954 * strace.cc (main): Make toggle a local variable. 2002-06-07 01:37:20 +00:00
Christopher Faylor 80082f1ec4 * strace.cc (toggle): New global variable.
(error): Use exit instead of ExitProcess so that stdio buffers get flushed.
(create_child): Remove command line error checking.
(dostrace): Ditto.
(dotoggle): New function.
(usage): Add entry for new option -T|--toggle.  Alphabetize.
(longopts): Add new option -T|--toggle.
(opts): Ditto.
(main): Handle new -T|--toggle option.  Move all command line checking here
from other functions.
* utils.sgml: Update section for strace.
2002-06-07 01:36:17 +00:00
Christopher Faylor ba692ae9c0 * strace.cc (version): New global variable.
(usage): Accomodate stdout output.
(print_version): New function.
2002-06-06 02:55:10 +00:00
Christopher Faylor c240a7fcde * ssp.c (version): New global variable.
(longopts): Ditto.
(opts): Ditto.
(run_program): Correct cmd_line typos to cmdline.
(usage): New function.  Standardize usage output.  Add ssp.txt to --help
output.
(print_version): New function.
(main): Accommodate getopt.
2002-06-06 00:36:12 +00:00
Christopher Faylor e6cd2312d6 * umount.cc (version): New global variable.
(longopts): Accommodate new --version option.
(opts): Ditto.
(usage): Standardize usage output.
(print_version): New function.
(main): Accommodate --help, --version options.
2002-06-04 01:31:28 +00:00
Christopher Faylor 9bd0241009 * regtool.cc (prog_name): New global variable.
(longopts): Ditto.
(opts): Ditto.
(usage): Standardize usage output.  Rearrange/add descriptions.
(print_version): New function.
(main): Accomodate longopts and new --help, --version options.  Add check for
(_argv[optind+1] == NULL).
2002-06-03 02:57:55 +00:00
Christopher Faylor f69af9b3d2 * strace.cc (forkdebug): Make true by default.
(attach_process): Use window pid if cygwin pid isn't available (yet).
(create_child): Use either DEBUG_ONLY_THIS_PROCESS or DEBUG_PROCESS,
exclusively.  (Suggested by Conrad.Scott@dsl.pipex.com)
2002-06-02 17:46:38 +00:00
Christopher Faylor dfe569334a * mkpasswd.cc (main): Don't reset to binmode if stdout is a terminal. 2002-05-30 19:35:51 +00:00
Christopher Faylor b050246c00 * mount.cc (main): Make -b the default. 2002-05-30 03:42:19 +00:00
Corinna Vinschen 50674f2dc3 * ps.cc (main): Use uid or uid32 member of struct external_pinfo
dependent of the value of the struct's version member.
2002-05-29 20:10:27 +00:00
Corinna Vinschen 642745443f * ps.cc (main): Change print format for uid to unsigned. Use uid32
member of struct external_pinfo instead of uid.
2002-05-29 15:07:14 +00:00
Corinna Vinschen f59faec485 * passwd.c (prog_name): New global variable.
(longopts): Ditto.
	(opts): Ditto.
	(usage): Standardize output. Accomodate new options.
	(print_version): New function.
	(main): Accomodate longopts and new --help, --version options.
2002-05-29 07:13:09 +00:00
Corinna Vinschen 6c5e0401d4 * ps.cc (usage): Fix typo. 2002-05-28 14:59:36 +00:00
Christopher Faylor ad39fa8cb0 * ps.cc (prog_name): New global variable.
(longopts): Ditto.
(opts): Ditto.
(usage): New function.
(print_version): New function.
(main): Accomodate longopts and new --help, --version options.
2002-05-28 03:38:36 +00:00
Christopher Faylor d73f9745f1 * strace.cc (attach_process): Don't tell process to start stracing here.
(proc_child): Do it here, instead, after first debug event.  This should work
around inexplicable races with DebugActiveProcess.
(dostrace): Pass any pid argument to proc_child.
2002-05-27 01:49:08 +00:00
Christopher Faylor 8b3e5e2d6e Fix typos. 2002-05-24 21:11:43 +00:00
Corinna Vinschen f1b53fa94c * setfacl.c (usage): Standardize usage output. Change return type to
static void.
        (print_version): New function.
        (longopts): Added longopts for all options.
        (main): Accommodate changes in usage function and new version option.
2002-05-24 14:40:14 +00:00
Corinna Vinschen 82d178a405 * getfacl.c (usage): Standardize usage output. Change return type to
static void.
	(print_version): New function.
	(longopts): Added longopts for all options.
	(main): Accommodate new help and version options.
2002-05-23 10:56:57 +00:00
Christopher Faylor ff7b1ed927 fix typo. 2002-05-23 04:48:03 +00:00
Christopher Faylor 8704ad9da9 * mount.cc (version) New global variable.
(usage) Standardize usage output.  Accomodate new version option.
(print_version) New function.
(longopts) Accomodate new version option.
(opts) Ditto.
(main) Ditto.
2002-05-23 04:19:07 +00:00
Corinna Vinschen 5bb52de4e2 * cygpath.cc (usage): Change usage output slightly.
* cygpath.cc (main): Add option l to support conversion to
	Windows long file names.  Refactured code for capital options.
	Support of options from file for capital options.
	(dowin): New function.  Refactured from main.
	(doit): Call long path conversion.
	(get_long_name): New function.
	(get_long_paths): New function.
	(get_long_path_name_w32impl): New function.  Reimplementation
	of Windows API function GetLongPathName (only 98/Me/2000/XP or
	higher).
	(get_short_name): Call GetShortPathName only once.
	(get_short_paths): Fix calculating buffer size.
	* utils.sgml: Update cygpath section for l option.
2002-05-22 10:05:41 +00:00
Christopher Faylor cf737d6b32 * strace.cc (add_child): Use calloc since new requires working libstdc++.a.
(fhandler_disk_file::fstat): Ditto for delete/free.
2002-05-18 21:05:10 +00:00
Corinna Vinschen e355de817c * cygpath.cc (get_short_paths): Fix more error checking.
(get_short_name): Ditto.

	* cygpath.cc (main): Add option H to show the Windows' profiles
	directory.  Support short names for options DPSW.  Clean up
	copied code lines.
	* utils.sgml: Update cygpath section for H option and s support.
2002-05-15 11:36:00 +00:00
Corinna Vinschen 5588e28765 * cygpath.cc (get_short_name): Fix error checking. 2002-05-14 16:07:26 +00:00
Christopher Faylor ef48a2cad3 * kill.cc (prog_name) New global variable.
(usage) Standardize usage output.  Add descriptions.
(print_version) New function.
(longopts) Accomodate new version option.
(opts) Ditto.
(main) Ditto.
2002-05-13 23:42:32 +00:00
Christopher Faylor 6eabab557a * kill.cc (listsig): Display numeric id when given symbolic input. 2002-05-13 05:35:44 +00:00
Christopher Faylor 30feaa22dd * kill.cc (usage): Show new options. Allow specification of output stream.
(main): Implement 'h' option.
2002-05-13 05:23:37 +00:00
Christopher Faylor 65791b5de3 Update ChangeLog with missing entry. 2002-05-13 05:18:34 +00:00
Christopher Faylor c49fa76263 * Makefile.in (kill.exe): Add as a specific target.
* kill.cc (longopts): New.
(opts): Ditto.
(get_sig): Accept const char * parameter.  Return -1 on unknown signal.
(test_for_unknown_sig): New function.
(listsig): New function.
(main): Use getopt_long for option parsing.  Implement -l, and -s options.  Use
test_for_unknown_sig() to test for signal validity.
2002-05-13 05:13:58 +00:00
Christopher Faylor 48897dfeb9 * mount.cc (do_mount): Default to non-exec option for remote drives. Report
warnings before attempting a mount.
(longopts): Add no-executable option.
(mount_commands): Ditto.
(opts): Ditto.
(usage): Ditto.  Indicate that system mount is now the default.
(main): Accommodate no-executable option.  Make system mount the default.
* umount.cc (usage): Indicate that system umount is now the default.
(main): Make system umount the default.
2002-05-12 04:29:54 +00:00
Christopher Faylor 84d06cb64d * dumper.cc (usage) Standardize usage output. Generalize to allow use for
help.
(longopts) New struct.  Added longopts for all options.
(print_version) New function.
(main) Change getopt to getopt_long.  Accommodate new help and version options.
2002-05-08 01:55:56 +00:00
Corinna Vinschen eccebec08d * mkgroup.c (main): Change call to exit() to a return statement.
* mkpasswd.c (main): Ditto.

	* mkpasswd.c (usage): Simplify usage output.  Generalize to allow use
	for help. Correct '?' typo to 'h'.
	(longopts): Add version option.
	(opts): Add 'v' version option.
	(print_version): New function.
	(main): Accommodate new version option.  Accommodate usage parameter
	changes.
2002-04-29 10:21:54 +00:00
Christopher Faylor 7a9f3efb1b * mkgroup.c (usage): Use one just fprintf + string concatenation for output
message.
(print_version): Add void to function type and update copyright.
2002-03-19 15:48:40 +00:00
Corinna Vinschen 22a9157c7c * mkgroup.c (usage): Simplify usage output. Generalize to allow use
for help. Correct '?' typo to 'h'.
	(longopts): Add version option.
	(opts): Add 'v' version option.
	(print_version): New function.
	(main): Accommodate new version option.  Accommodate usage parameter
	changes.  Use usage to output help message.
2002-03-19 15:28:13 +00:00
Corinna Vinschen eeec2a4835 2002-03-15 Corinna Vinschen <corinna@vinschen.de>
* mkgroup.c (main): When generating group 513, check for computer's
	primary domain instead of current user's domain.

2002-03-14  Corinna Vinschen  <corinna@vinschen.de>

	* mkgroup.c (main): When generating group 513, check for domain SID
	if computer name isn't mapped to a SID.
2002-03-15 14:53:55 +00:00
Christopher Faylor af53a09c70 * kill.cc (usage): Move to top of file.
(getsig): Ditto.
(forcekill): Ditto.
2002-03-11 18:33:02 +00:00
Christopher Faylor b56dedef3e * cygcheck.cc: Reformat. 2002-03-07 03:13:17 +00:00
Christopher Faylor b9262dd919 * cygcheck.cc (longopts): Use correct short option for --version. 2002-03-07 03:06:28 +00:00
Christopher Faylor 6a34460970 * cygpath.cc: Reformat.
* cygpath.cc (print_version): New function.
(main): Accommodate new version function.  Initialize 'o' to prevent warning.
* cygcheck.cc (main): Eliminate non-GNU formatting glitch.
2002-03-07 03:00:14 +00:00
Christopher Faylor 67763c0ca2 * ssp.c (help_desk): Fix compiler warning. Christopher Faylor <cgf@redhat.com>
Change appropriate globals to statics throughout.
* cygcheck.cc (usage): Simplify usage output.  Generalize to allow use for
help.
(longopts): Add version option.
(opts): Add 'V" version option.
(print_version): New function.
(main): Accommodate new version option.  Accommodate usage parameter changes.
Use usage to output help message.
* Makefile.in (CXXFLAGS): Add override so that HAVE_DECL_GETOPT is defined.
(libbfd): Use -B rather than -L so that bfd from build directory is correctly
found.
(libintl): Ditto.
2002-02-27 16:10:17 +00:00
Christopher Faylor cf75300efa * mount.cc (usage): Fix typo in output. 2002-02-15 23:03:14 +00:00
Christopher Faylor ed25e9e18c * strace.cc (attach_process): Change CW_STRACE_ON to CW_STRACE_TOGGLE. 2002-02-14 21:51:32 +00:00
Corinna Vinschen 29a1ad942e * mkpasswd.c (main): Set default home path for 9x/Me if --path-to-home
isn't given.
2002-01-31 12:43:29 +00:00
Corinna Vinschen 9783296270 * passwd.cc (ChangePW): Add parameter to differ between called for
checking old password and called for changing password.  If called
	for checking old password, return non-zero only if password is surely
	incorrect.
	(main): Call ChangePW() with additional parameter.
2002-01-30 11:57:16 +00:00