Commit Graph

7092 Commits

Author SHA1 Message Date
Christopher Faylor fbf39a58cb * fhandler.cc (fhandler_base::wait_overlapped): Always assume that bytes will
be non-NULL.  Distinguish input result from result derived from WFMO and
GetOverlappedResult or res can never be -1.  Only raise SIGPIPE when writing.
* fhandler.h (fhandler_base::wait_overlapped): Pass first argument by value.
* fhandler_fifo.cc (fhandler_fifo::wait): Pass in dummy byte count to
wait_overlapped.
* pipe.cc (DEFAULT_PIPEBUFSIZE): Define to 65536 explicitly.
2008-08-20 02:25:06 +00:00
Corinna Vinschen ec8a7e416f * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Drop fattr variable
and use FILE_ATTRIBUTE_DIRECTORY directly in call to NtCreateFile.
	* posix_ipc.cc (ipc_mutex_init): Fix format string when creating IPC
	object name.
	(ipc_cond_init): Ditto.
	* security.cc (alloc_sd): Add parentheses to fix setting initial
	owner_allow value.
2008-08-19 09:46:31 +00:00
Christopher Faylor 46c6def37f * fhandler.cc (fhandler_base::wait_overlapped): Don't treat ERROR_BROKEN_PIPE
as a non-error.  Do raise SIGPIPE when it is detected.
2008-08-19 02:56:28 +00:00
Corinna Vinschen bba4895394 * mkgroup.c (enum_local_groups): Use NetLocalGroupGetInfo to find out
if a group exists, rather than just allocating a buffer and going ahead.
2008-08-18 12:56:59 +00:00
Corinna Vinschen 2d1bfd524d * mkgroup.c (enum_local_groups): Call print_win_error with GetLastError
as argument when LookupAccountXXX failed.
	(enum_groups): Ditto.
2008-08-18 12:42:44 +00:00
Corinna Vinschen 5a62582162 * mkgroup.c (enum_local_groups): Return failure if looking for a single
group succeeded.  Add comment.
2008-08-18 08:58:21 +00:00
Corinna Vinschen 096df1774b * mkgroup.c (main): Keep correctly track of optional arguments.
* mkpasswd.c (main): Ditto.
2008-08-18 08:52:49 +00:00
Corinna Vinschen 01dd3162ff * mkgroup.c (main): Always unset environment variable POSIXLY_CORRECT.
Keep track of optional argumnts and fix up optind afterwards.
	* mkpasswd.c (main): Ditto.
2008-08-18 08:33:48 +00:00
Christopher Faylor c7aa4aec42 * cygcheck.cc (print_version): Update copyright dates. 2008-08-17 17:15:41 +00:00
Christopher Faylor 95141e7835 * mkpasswd.c (main): Avoid printing system accounts when a single user name has
been requested.
2008-08-17 17:00:50 +00:00
Christopher Faylor 6510edf4bc * Makefile.in (ALL_LDFLAGS): Add --enable-auto-import option to quiet ld
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.
2008-08-17 16:45:44 +00:00
Corinna Vinschen 9258eca9d4 * mkgroup.c (fetch_current_pgrp_sid): New function to fetch primary
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.
2008-08-15 13:08:47 +00:00
Corinna Vinschen 2bd94f906d * mount.cc (mount_info::get_mounts_here): Don't subtract 2 from
Length if it's 0 anyway.
2008-08-15 12:33:26 +00:00
Corinna Vinschen 975f052c60 * mount.cc (mount_info::create_root_entry): Create default cygdrive
prefix with MOUNT_NOPOSIX flag.
2008-08-15 12:06:38 +00:00
Corinna Vinschen 2b41d940ca * path.cc (symlink_info::check): Don't use eabuf when trying to open
file a second time.  Call NtOpenFile instead of NtCreateFile in this
	case.
2008-08-15 10:19:12 +00:00
Keith Marshall d434b57f86 Add missing dependencies for building libmingwex.a. 2008-08-14 15:13:18 +00:00
Corinna Vinschen 39f50e387b * fhandler_disk_file.cc (fhandler_disk_file::link): Fix linking
against symlinks.
2008-08-14 15:00:52 +00:00
Corinna Vinschen 88797e5979 * external.cc (cygwin_internal): Call set_security_attribute with
additional path_conv argument.
	* fhandler.cc (fhandler_base::open): Ditto.
	* fhandler_disk_file.cc (fhandler_disk_file::fchmod): Never set DOS
	R/O attribute when using ACLs.
	(fhandler_disk_file::mkdir): Ditto.  Set
	security descriptor on remote dirs after creating the dir, same as in
	fhandler_base::open.
	* fhandler_socket.cc (fhandler_socket::bind): Ditto for remote AF_LOCAL
	socket files.
	* path.cc (symlink_worker): Ditto. for remote symlinks.
	* security.cc (alloc_sd): Take additional path_conv argument.
	Accommodate throughout.  Drop setting FILE_WRITE_EA/FILE_READ_EA
	flags unconditionally (was only necessary for "ntea"). Don't set
	FILE_READ_ATTRIBUTES and FILE_WRITE_ATTRIBUTES unconditionally on
	Samba.  Add comment to explain.  Drop useless setting of
	STANDARD_RIGHTS_WRITE, it's in FILE_GENERIC_WRITE anyway.
	Remove FILE_READ_ATTRIBUTES bit from FILE_GENERIC_EXECUTE so as not
	to enforce read permissions on Samba.
	(set_security_attribute): Take additional path_conv argument.
	* security.h (set_security_attribute): Change prototype accordingly.
2008-08-14 14:05:04 +00:00
Corinna Vinschen 56d8179570 * mount.cc (NT_MAX_PATH): Define.
(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.
2008-08-13 16:35:04 +00:00
Corinna Vinschen 04a6c4efd7 * pathnames.sgml: Move description for (cyg,not)exec mount options
from utils.sgml here.  Clarify nouser mount points.
2008-08-13 16:34:49 +00:00
Corinna Vinschen 452f665fb1 * mount.cc (fillout_mntent): Always print noumount option last. 2008-08-13 15:30:52 +00:00
Corinna Vinschen aed2404c0d * mount.cc (fillout_mntent): Print options as taken in fstab and mount. 2008-08-13 15:11:25 +00:00
Corinna Vinschen 5a58591f45 * cyglsa-config: Copy the DLL instead of moving. 2008-08-13 11:05:25 +00:00
Corinna Vinschen 69d704beff * dll_init.cc: Throughout convert to use long pathnames.
* dll_init.h (struct dll): Change name to WCHAR, change operator [] to
	take PWCHAR argument.
2008-08-13 08:25:44 +00:00
Keith Marshall e587bc0e7d Add replacements for remaining members of printf() family. 2008-08-11 22:41:55 +00:00
Corinna Vinschen 0ea2c19934 * syscalls.cc (rename): If newpath doesn't exist, check if .exe suffix
in oldpath has been omitted before appending .exe to newpath.
2008-08-11 15:05:25 +00:00
Corinna Vinschen 36f17b4b40 * fhandler_floppy.cc (fhandler_dev_floppy::raw_read): Don't set
eom_detected when EOF is detected, thus returning 0 instead of
	setting errno to ENOSPC.
2008-08-09 11:09:02 +00:00
Corinna Vinschen b2d3f28fda * fhandler.cc (fhandler_base::open): Use Samba workaround generally
for all remote filesystems supporting ACLs.  Change comment and
	explain why.  Refer to the discussion which led to this.
2008-08-07 16:20:03 +00:00
Brian Dessent af15c95e70 * config/i386/profile.h (mcount): Mark asms volatile. 2008-08-05 19:20:58 +00:00
Christopher Faylor 53364a1fae * dll_init.cc (dll_global_dtors): Add an additional test to avoid walking the
linked list if it is empty.
(dll_list::detach): Don't set dll_global_dtors_recorded if we aren't actually
going to record any dlls.
2008-08-05 14:26:47 +00:00
Christopher Faylor bee18f45fd Changes suggested by Dave Korn.
* dcrt0.cc (cygwin_exit): Remove (hopefully) extraneous call to
dll_global_dtors.
* dll_init.cc (dll_global_dtors): Run destructors in reverse dependency/load
order.
* dll_init.h (dll_list): Add dll_global_dtors as a friend.
2008-08-04 15:55:32 +00:00
Christopher Faylor ea8432dfb1 * cygcheck.cc (load_cygwin): Duplicate argv list since it disappears when
cygwin1.dll is unloaded.
2008-08-04 15:30:06 +00:00
Christopher Faylor b23b171641 * dcrt0.cc (dll_crt0_1): Add a symbol denoting return from call to main().
* exceptions.cc (stack_info::walk): Stop walking the stack when we hit
_cygwin_exit_return rather than just blindly stopping when PC becomes zero.
2008-08-01 19:12:49 +00:00
Corinna Vinschen 3462d736b6 * path.cc (symlink_info::check): Handle (and explain) a special case
when accessing files matching DOS device names on SMB shares.
2008-07-31 14:48:28 +00:00
Corinna Vinschen 9fe98985b3 * spawn.cc (spawn_guts): Check constructed short pathname for being
a DOS device name and fall back to long path name, if so.
2008-07-31 14:41:19 +00:00
Corinna Vinschen d79a78e5c8 * fhandler_disk_file.cc (fhandler_base::fstat_by_name): Check for
file systems incapable of handling FileIdBothDirectoryInformation
	correctly.
	(fhandler_disk_file::opendir): Ditto.
	* path.cc (fs_info::update): Always clear at the start.
	Rearrange to make certain tests only on non-Samba, non-NFS remote
	drives.
	Add test for file systems known to be incapable of handling
	FileIdBothDirectoryInformation correctly.  Right now that's just
	"UNIXFS".
	* path.h (struct fs_info): Add has_buggy_fileid_dirinfo flag and
	accessor methods.
	(class path_conv): Add has_buggy_fileid_dirinfo method.
2008-07-30 14:41:59 +00:00
Corinna Vinschen b54881352d * sec_auth.cc (extract_nt_dom_user): Return domain and user name as
WCHAR.
	(cygwin_logon_user): Accommodate above change.  Convert password to
	WCHAR and call LogonUserW.
	* external.cc (cygwin_internal): Accommodate above change.
	* security.h (extract_nt_dom_user): Change prototype accordingly.
2008-07-30 12:10:20 +00:00
Christopher Faylor e3e942ac00 * Makefile.in: Link cygcheck with -lntdll even without mingw-zlib. 2008-07-30 06:07:42 +00:00
Christopher Faylor a010e6abed * cygwin.din (_getutline): Remove.
* lib/bsdlib.cc (login): Make argument const as per linux.
(logout): Ditto.
* syscalls.cc (getutid): Ditto.
(getutline): Ditto.
(pututline): Ditto.
(getutxent): Add comment mentioning non-thread-safety.
(getutxid): Ditto.
(getutxline): Ditto.
(pututxline): Ditto.
* sys/utmp.h: Declare arguments to various functions as const as per linux.
Remove bogus _getutline definition.
2008-07-30 04:58:24 +00:00
Christopher Faylor dbfc6f0e78 (missing changelog entry)
* include/cygwin/version.h: Add comment indicating that current API number bump
also has another consequence.
2008-07-30 01:37:55 +00:00
Christopher Faylor f5b18cbef7 * include/cygwin/version.h: Add comment indicating that current API number bump
also has another consequence.
2008-07-29 14:07:21 +00:00
Corinna Vinschen f9afd0ced7 * Makefile.in (DLL_OFILES): Remove v8 regexp files.
(OBSOLETE_FUNCTIONS): Remove v8 regexp functions.
	(NEW_FUNCTIONS): Remove POSIX regex functions.
	* cygwin.din: Export POSIX regex functions with their correct symbol
	name.  Export with posix_ prefix for backward compatibility.
	* syscalls.cc (regfree): Remove ancient fake function.
	* regex/regex.h: Remove renaming regex functions within Cygwin.
	* regexp/*: Remove.
	* include /cygwin/version,.h: Bump API minor number.
2008-07-29 10:40:37 +00:00
Keith Marshall f2cb69fd8e Replace __mingw_snprintf() with new generic family implementation; likewise, replace __mingw_vsnprintf(). 2008-07-28 23:24:20 +00:00
Keith Marshall 8c7a3134dd Lay foundations for new printf() function family implementation. 2008-07-28 22:57:43 +00:00
Christopher Faylor 038af33480 * dcrt0.cc (dll_crt0_0): Remove calling malloc_init and
user_shared_initialize_1 from here.
(dll_crt0_1): Remove dynamically_loaded check.  Just call malloc_init and
user_shared_initialize unconditionally.
* shared.cc (user_shared_create): Rename from user_shared_initialize.
(user_shared_initialize): Rename from user_shared_initialize_1.  Move complete
user_shared content initialization code here from user_shared_create.
* syscalls.cc (seteuid32): Remove call to user_shared_initialize_1.  That is
implied by the "true" argument to user_shared_create().
2008-07-27 22:31:48 +00:00
Christopher Faylor b58e5f427a * mount.cc (mount_info::init): Add location where we're looking for fstab to
temporary message.
* lib/cygwin_crt0.c (cygwin_crt0): Simplify by eliminating accommodations for
ancient cygwin DLLs.
* lib/crt0.h: Include <windows.h> directly since it is needed.
2008-07-27 16:59:07 +00:00
Christopher Faylor 34aa62035b * cygcheck.cc (load_cygwin): Free the cygwin dll after we're done with it. 2008-07-27 14:53:42 +00:00
Christopher Faylor 904413e731 * shared_info.h (shared_destroy): Declare.
* shared.cc (shared_destroy): Define new function to destroy shared memory
regions.
* init.cc (dll_entry): Call shared_destroy when dll detaches from the process.
2008-07-27 14:52:46 +00:00
Corinna Vinschen bfd2b1c930 * fhandler_socket.cc (fhandler_socket::send_internal): Send never more
then 64K bytes at once.  For blocking sockets, loop until entire data
	has been sent or an error occurs.
	(fhandler_socket::sendto): Drop code which sends on 64K bytes.
	(fhandler_socket::sendmsg): Ditto.
2008-07-27 10:20:49 +00:00
Christopher Faylor 34cc372abe * fhandler_tty.cc (fhandler_pty_master::setup): Reorganize so that all
operations for each end of the pipe are grouped together.
2008-07-26 19:35:21 +00:00