summaryrefslogtreecommitdiffstats
path: root/winsup/utils
Commit message (Collapse)AuthorAgeFilesLines
...
* * cygcheck.cc (pathlike::check_existence): Remove class name from declaration.Christopher Faylor2008-09-128-50/+77
| | | | | | | | | | | | | | | | | | | | | (display_internet_error): Use proper format specifier for DWORD. (environ): Remove unneeded declaration. (main): Use brace around nested if to avoid an overly-helpful compiler warning. * dump_setup.cc (parse_filename): Reorganize nested if to avoid an overly-helpful compiler warning. * path.cc (GUID_shortcut): Use braces around part of initializer which needs them. (conv_fstab_spaces): Parenthesize assignment in while loop to avoid a compiler warning. (struct opt): Make static. * ps.cc (main): Reorganize nested if to avoid an overly-helpful compiler warning. * regtool.cc: Make some anonymous structs static to avoid a compiler warning. * ssp.c (lookup_thread_id): Initialize *tix to zero to avoid potential uninitialized use. * strace.cc (add_child): Use proper format specifier for DWORD. (remove_child): Ditto. (proc_child): Ditto.
* * cygcheck.cc (nuke): Use malloc rather than alloca for environment variables.Christopher Faylor2008-08-273-6/+15
| | | | | | (load_cygwin): Ditto. * dump_setup.cc (parse_filename): Cosmetic changes. (get_packages): Ditto.
* * mkgroup.c (enum_local_groups): Don't skip printing groups whenCorinna Vinschen2008-08-253-8/+14
| | | | | | | | | print_current is set and group SID is not curr_pgrp. (enum_groups): Ditto. (main): Fix condition when SYSTEM group gets printed. * mkpasswd.c (enum_users): Don't skip printing users when print_current is set and user SID is not curr_user. (main): Allow printing standard accounts even when print_current is set.
* * mkgroup.c (enum_local_groups): Use NetLocalGroupGetInfo to find outCorinna Vinschen2008-08-182-4/+8
| | | | if a group exists, rather than just allocating a buffer and going ahead.
* * mkgroup.c (enum_local_groups): Call print_win_error with GetLastErrorCorinna Vinschen2008-08-182-4/+10
| | | | | as argument when LookupAccountXXX failed. (enum_groups): Ditto.
* * mkgroup.c (enum_local_groups): Return failure if looking for a singleCorinna Vinschen2008-08-182-1/+9
| | | | group succeeded. Add comment.
* * mkgroup.c (main): Keep correctly track of optional arguments.Corinna Vinschen2008-08-183-2/+7
| | | | * mkpasswd.c (main): Ditto.
* * mkgroup.c (main): Always unset environment variable POSIXLY_CORRECT.Corinna Vinschen2008-08-183-0/+16
| | | | | Keep track of optional argumnts and fix up optind afterwards. * mkpasswd.c (main): Ditto.
* * cygcheck.cc (print_version): Update copyright dates.Christopher Faylor2008-08-172-1/+5
|
* * mkpasswd.c (main): Avoid printing system accounts when a single user name hasChristopher Faylor2008-08-172-1/+6
| | | | been requested.
* * Makefile.in (ALL_LDFLAGS): Add --enable-auto-import option to quiet ldChristopher Faylor2008-08-174-111/+162
| | | | | | | | | | | | | | | | | | | warnings. * mkgroup.c: Change all global variables and most functions to static. (enum_local_groups): Add a print_current parameter to control whether entries for everything should be printed or just the current user. (enum_groups): Ditto. (main): Move call fetch_current_pgrp_sid earlier to avoid a NULL deference when no command line arguments are specified. Accommodate argument changes to above functions. Avoid printing SYSTEM account when print_current is specified. Issue error when extra stuff is found on the command line. * mkpasswd.c: Change all global variables and most functions to static. (enum_users): Add a print_current parameter to control whether entries for everything should be printed or just the current user. (main): Move call fetch_current_user_sid earlier to avoid a NULL deference when no command line arguments are specified. Accommodate argument change to above function. Avoid printing standard accounts when print_current is specified. Issue error when extra stuff is found on the command line.
* * mkgroup.c (fetch_current_pgrp_sid): New function to fetch primaryCorinna Vinschen2008-08-153-52/+117
| | | | | | | | | | | | | | | | | | group SID from user token. (current_group): Move up in file. Move fetching primary group SID to fetch_current_pgrp_sid. (enum_local_groups): Check if current SID is the same as current user's primary group SID. (enum_groups): Ditto. (main): Call fetch_current_pgrp_sid before enumerating groups. Call current_group only if current group hasn't been enumerated already. * mkpasswd.c (fetch_current_user_sid): New function to fetch current user SID from user token. (current_user): Move fetching current user SID to fetch_current_user_sid. (enum_users): Check if current SID is the same as current user's SID. (main): Call fetch_current_user_sid before enumerating users. Call current_user only if current user hasn't been enumerated already.
* * mount.cc (NT_MAX_PATH): Define.Corinna Vinschen2008-08-134-280/+168
| | | | | | | | | | | | | | | | | | | | | | | | (longopts): Rename mount-commands option to mount-entries. (opts): Remove removed options. (struct opt): Move up in file to allow using it in usage. (usage): Change text for --mount-entries option. Remove -X option. Add valid options output. (main): Remove handling -b option. (convert_spaces): New static function to convert spaces to "\040" string. (mount_entries): Renamed from mount_commands. Rewrite to emit /etc/fstab compatible output. (show_cygdrive_info): Print "nouser" rather than "system". * umount.cc (longopts): Remove remove-all-mounts, remove-cygdrive-prefix, remove-system-mounts, system and user options. (opts): Remove A, c, s, S, u options. (usage): Remove text for all removed options. (main): Remove handling for all removed options. (remove_all_mounts): Remove. (remove_all_system_mounts): Remove. (remove_cygdrive_prefix): Remove. * utils.sgml: Fix mount and umount documentation. Move description of (cyg,not)exec options to mount table section.
* * cygcheck.cc (load_cygwin): Duplicate argv list since it disappears whenChristopher Faylor2008-08-042-2/+14
| | | | cygwin1.dll is unloaded.
* * Makefile.in: Link cygcheck with -lntdll even without mingw-zlib.Christopher Faylor2008-07-302-2/+7
|
* * cygcheck.cc (load_cygwin): Free the cygwin dll after we're done with it.Christopher Faylor2008-07-272-26/+32
|
* * mount.cc: Remove non-unix-like options (-x,-t,b) throughout.Christopher Faylor2008-07-254-1835/+2600
| | | | | | (oopts): Use boolean constants for slightly increased clarity. * configure.in: Remove apparently unneeded program_transfer_name code. * configure: Regenerate.
* * utils.sgml: Remove useless text.Corinna Vinschen2008-07-252-10/+6
|
* * mkgroup.c (main): Fix test for duplicate domain/machine request.Corinna Vinschen2008-07-233-9/+32
| | | | * mkpasswd.c (main): Ditto.
* * mkgroup.c: Rework to allow per-domain/per-machine id_offset.Corinna Vinschen2008-07-234-166/+192
| | | | | | | | | Add -b option to skip builtin groups. (main): Simplify code. * mkpasswd.c: Rework to allow per-domain/per-machine id_offset. (main): Simplify code. * utils.sgml: Explain changed mkgroup/mkpasswd -d/-D/-l/-L options. Add mkgroup -b option.
* * mkgroup.c: Consolidate variable names.Corinna Vinschen2008-07-234-44/+323
| | | | | | | | | | | | | | | | | | (enum_unix_groups): New function. (print_special): Use LookupAccountSidW instead of LookupAccountSidA. (current_group): Ditto. (usage): Add -U option. (longopts): Add --unix option. (opts): Add -U option. (main): Handle -U option. Call enum_unix_groups if set. * mkpasswd.c: Consolidate variable names. (current_user): Use LookupAccountSidW instead of LookupAccountSidA. (enum_unix_users): New function. (usage): Add -U option. (longopts): Add --unix option. (opts): Add -U option. (main): Handle -U option. Call enum_unix_groups if set. * utils.sgml: Add -U option text to mkgroup and mkpasswd description.
* * mkgroup.c (enum_groups): Create full qualified groupname usingCorinna Vinschen2008-07-223-2/+10
| | | | | domain or servername, depending on printing domain or machine accounts. * mkpasswd.c (enum_users): Ditto for users.
* * mkgroup.c (main): Remove special root group code. Only printCorinna Vinschen2008-07-222-24/+22
| | | | SYSTEM group in case of printing local machine or local domain groups.
* * Makefile.in (cygcheck.exe): Link against ntdll.Corinna Vinschen2008-07-229-928/+925
| | | | | | | | | | | | | | | | | | | | * 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.
* * mount.cc (do_mount): Remove MOUNT_ENC code.Corinna Vinschen2008-07-173-27/+10
| | | | | | | (oopts): Remove "managed" option. (mount_commands): Drop "managed" handling. * path.cc (oopts): Remove "managed" option. (getmntent): Remove MOUNT_ENC code.
* * utils.sgml: Add id's to all examples.Corinna Vinschen2008-07-172-13/+17
|
* * mkgroup.c: Use statically linked functions throughout, except forCorinna Vinschen2008-07-093-341/+276
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DsGetDcNameW. Reformat. Convert to use WCHAR for names throughout. Use defines instead of constants throughout. (MAX_SID_LEN): Define. (load_netapi): Just load DsGetDcNameW pointer. (psx_dir): Remove. (uni2ansi): Remove. (enum_local_users): Take server name and use in Net... call. (DBGSID): Define datastructure. (MAX_BUILTIN_SIDS): Define. (builtin_sid_list): Define global sid list. (builtin_sid_cnt): Define counter for global sid list. (enum_local_groups): Take server name and use in Net... and Lookup... calls. Take offset argument. Use MAX_PREFERRED_LENGTH in call to NetLocalGroupEnum. Check for duplicate builtin groups. (enum_users): Take server name and use in Net... call. (usage): Change text slightly. (print_version): Fix copyright. (main): Call enum_local_groups for domains as well. * mkpasswd.c: Use statically linked functions throughout, except for DsGetDcNameW. Reformat. Convert to use WCHAR for names throughout. Use defines instead of constants throughout. (MAX_SID_LEN): Define. (load_netapi): Just load DsGetDcNameW pointer. (uni2ansi): Use wcstombs. (current_user): Replace "unused_by_nt/2000/xp" by just "unused". (enum_users): Ditto. (print_version): Fix copyright.
* * setfacl.c (setfacl): Change from void to int. Return 2 in case ofCorinna Vinschen2008-05-222-7/+20
| | | | | error. (main): Return with error code from setfacl.
* * Makefile.in (CYGWIN_BINS): Remove ipcrm and ipcs.Corinna Vinschen2008-05-154-1054/+7
| | | | | * ipcrm.c: Remove. * ipcs.c: Remove.
* * mount.cc (usage): Mark -s and -u as ignored.Corinna Vinschen2008-04-232-15/+15
| | | | | | (print_version): Simplify printing copyright dates. (main): Remove default_flag. Dont set flags on -s and -u options. (mount_commands): Drop handling -s and -u options.
* * cygcheck.cc (dump_sysinfo): Fix multiple Cygwin DLL test.Corinna Vinschen2008-04-223-116/+339
| | | | | | | | | | | | | | | | | | | | | | | | | | | * path.cc: Fetch mount points from fstab files instead of from registry. Use adapted functions copied from Cygwin DLL. (mnt_t): Drop issys member. Define as "mnt_t" instead of "struct mnt_t" subsequently. (max_mount_entry): New variable. (unconvert_slashes): Move to earlier location in file. Make inline. (find2): Remove. (get_cygdrive0): Remove. (get_cygdrive): Remove. (skip_ws): New function. (find_ws): Ditto. (conv_fstab_spaces): Ditto. (read_flags): Ditto. (from_fstab_line): Ditto. (get_user): Ditto. (from_fstab): Ditto. (mnt_sort): Ditto. (read_mounts): Drop old registry code. Fetch "Software\Cygwin\Setup\rootdir" value from HKCU or HKLM key. Use rootdir extracted from module path as fallback. Call from_fstab for nouser and user mount points. (setmntent): Check max_mount_entry to test if read_mounts must be called. (getmntent): Use MOUNT_SYSTEM flag instead of mnt_t's issys member.
* * path.cc: Include malloc.h for alloca.Brian Dessent2008-03-162-48/+53
| | | | | | (is_symlink): Rewrite. Just read the whole file in memory rather than by parts. Account for an ITEMIDLIST if present, as well as the new style of Cygwin shortcut supporting targets > MAX_PATH.
* * cygpath.cc (do_sysfolders): Use cygwin_conv_path.Corinna Vinschen2008-03-126-29/+53
| | | | | | | | | | | | (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.
* * cygcheck.cc (find_app_on_path): Make buffer SYMLINK_MAX + 1Brian Dessent2008-03-112-3/+8
| | | | chars.
* * cygcheck.cc (dirname): New static function.Brian Dessent2008-03-114-31/+100
| | | | | | | | | | | | | | (find_app_on_path): Use SYMLINK_MAX. Resolve symlink relative to link's location. Adjust to the fact that cygpath already normalizes its return value. * path.cc (rel_vconcat): Add cwd parameter, and use it instead of calling GetCurrentDirectory() if possible. Rename throughout. (vcygpath): Rename from cygpath and accept cwd and va_list. Pass cwd on to rel_vconcat(). (cygpath_rel): New front end for vcygpath. (cygpath): Ditto. * path.h (cygpath_rel): Declare. (SYMLINK_MAX): Define to 4095.
* * Makefile.in (install): Don't install the testsuite.Brian Dessent2008-03-092-1/+5
|
* * Makefile.in: Add a 'check' target that builds and runsBrian Dessent2008-03-095-13/+309
| | | | | | | | | | | | | | | | | | | | | testsuite.exe from path-testsuite.o and testsuite.o. * path.cc: Include testsuite.h. (struct mnt): Change to a mnt_t typedef and don't define mount_table when TESTSUITE is defined. (find2): Don't include when TESTSUITE is defined to avoid warning. (get_cygdrive0): Ditto. (get_cygdrive): Ditto. (read_mounts): Provide empty implementation when TESTSUITE is defined. (vconcat): Use the isslash macro. (unconvert_slashes): New helper to convert to backslashses. (rel_vconcat): Handle relative paths more gracefully. (cygpath): Skip a leading "./" sequence. Avoid double-slashes. Normalize final output to backslashes and remove redundant path sequences. * testsuite.cc: New file implementing testsuite driver. * testsuite.h: New header implementing harness mount table and series of tests.
* * Makefile.in: Reorganize considerably, using GNU make'sBrian Dessent2008-03-082-149/+87
| | | | static pattern rules and target-specific variables.
* * mkpasswd.c (main): Simplify generating SYSTEM entry. Add entriesCorinna Vinschen2008-02-282-15/+10
| | | | for LocalService and NetworkService accounts. Change comments.
* * cygcheck.cc (dump_sysinfo): Always try to get a OSVERSIONINFOEXCorinna Vinschen2008-01-132-59/+126
| | | | | | first. Load kernel32.dll earlier. Make osname a buffer. Simplify Non-NT code. Use GetProductInfo in Vista/2008 case. Clean up non-Vista version info. Exit early if not on NT.
* * bloda.cc (enum bad_app): Add BYTEMOBILE.Dave Korn2007-12-292-1/+15
| | | | | (dodgy_app_detects[]): Add FILENAME entry to detect bmnet.dll. (big_list_of_dodgy_apps[]): Add description for BYTEMOBILE.
* * Makefile.in (cygcheck.exe): Don't link to ntdll.Brian Dessent2007-12-213-12/+42
| | | | | | | | * bloda.cc (pNtQuerySystemInformation): Add. (pRtlAnsiStringToUnicodeString): Add. (get_process_list): Use function pointers for NT functions. (dump_dodgy_apps): Skip dodgy app check on non-NT platforms. Use GetProcAddress for NT-specific functions.
* * regtool.cc (opts): Add missing 'W'.Corinna Vinschen2007-12-072-1/+5
|
* * ps.cc: Include limits.h.Corinna Vinschen2007-12-062-3/+14
| | | | | | (main): Set file name buffer size to PATH_MAX. Use progname or progname_long member of struct external_pinfo dependent of the value of the struct's version member.
* 2007-08-31 Dave Korn <dave.korn@artimi.com>Dave Korn2007-08-312-1/+6
| | | | | * mkgroup.c (enum_groups): Use MAX_PREFERRED_LENGTH in netgroupenum call so that it will automatically size returned buffer sufficiently.
* * Makefile.in (cygcheck.exe): Add bloda.o as prerequisite, adjustingDave Korn2007-08-034-5/+438
| | | | | | | | dependency-filtering $(wordlist ...) call appropriately. Link ntdll. (bloda.o): New rule to build bloda.o * cygcheck.cc (dump_sysinfo): Call bloda function dump_dodgy_apps(). * bloda.cc: New file implements detection of applications from the Big List Of Dodgy Apps.
* Add missing ChangeLog entry.Corinna Vinschen2007-07-241-0/+1
|
* * dumper.cc: Change license to plain GPLv2 + later.Corinna Vinschen2007-07-245-10/+386
| | | | | * dumper.h: Ditto. * parse_pe.cc: Ditto.
* * strace.cc (create_child): Don't convert a path from cygwin format unless itChristopher Faylor2007-07-232-1/+7
| | | | has a slash.
* * strace.cc (usage): Add missing description for -q.Christopher Faylor2007-07-102-1/+6
|