Commit Graph

7215 Commits

Author SHA1 Message Date
Chris Sutcliffe 07aed2eee8 2008-09-06 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* Makefile.in: Adjust to new naming standard for MinGW while maintaining old
        naming standard for Cygwin.
2008-09-07 02:07:29 +00:00
Keith Marshall f43d60be62 Reimplement getopt.c to add getopt_long_only() function. 2008-08-31 22:27:58 +00:00
Keith Marshall 31966e0931 Erase all file content, preparatory to rewrite. 2008-08-31 22:26:52 +00:00
Chris Sutcliffe 34d29530d9 2008-08-30 Bo Yang <techrazy@users.sourceforge.net>
* include/sspi.h: Fix PSecurityFunctionTableW structure.
2008-08-30 23:19:14 +00:00
Chris Sutcliffe 953c58045b 2008-08-29 Andy Grover <andy.grover@oracle.com>
* include/ddk/scsi.h: Define READ_TOC formats.

        * lib/ddk/scsiport.def (ScsiPortGetDeviceBase): Fix export.
2008-08-30 23:14:26 +00:00
Chris Sutcliffe 1c931bf118 2008-08-29 Andy Grover <andy.grover@oracle.com>
* include/ddk/ndis.h (NDIS_MINIPORT_MAJOR_VERSION, NDIS_MINIPORT_MINOR_VERSION,
        struct NDIS_TASK_OFFLOAD_HEADER, PROTOCOL_RESERVED_SIZE_IN_PACKET,
        NdisGetFirstBufferFromPacketSafe, NdisMIndicateReceivePacket,
        NdisSetPacketPoolProtocolId, NdisMInitializeTimer, NdisMSetPeriodicTimer,
        NdisMCancelTimer): Define.
        (enum NDIS_ENCAPSULATION, struct NDIS_ENCAPSULATION_FORMAT): move in file.
        (struct _NDIS_PACKET): Define using _ANONYMOUS_UNION and ANONYMOUS_STRUCT to
        eliminate warnings.
        (NdisReinitializePacket): Rename from NdisReinitializePacketCounts.
        * lib/ddk/ndis.def (NdisInitAnsiString, NdisInitUnicodeString, NdisMCancelTimer,
        NdisMInitializeTimer, NdisMSetPeriodicTimer, NdisSetPacketPoolProtocolId):
        Export.
2008-08-30 23:08:11 +00:00
Chris Sutcliffe 1138964dd8 2008-08-29 Andy Grover <andy.grover@oracle.com>
* include/ddk/winddk.h (RtlStringCbCopyA, RtlStringCbPrintfA,
        RtlStringCbVPrintfA): define in terms of POSIX string functions.
2008-08-30 23:03:37 +00:00
Chris Sutcliffe ce11563e34 2008-08-29 Andy Grover <andy.grover@oracle.com>
* include/ddk/winddk.h (KeRaiseIrql): Define.
        (KfRaiseIrql, KfLowerIrql): remove incorrect definitions.
2008-08-30 22:58:51 +00:00
Keith Marshall 20167d0a5f Implement conditional replacement for printf() family functions. 2008-08-30 17:27:18 +00:00
Chris Sutcliffe 782ac76f36 2008-08-29 Andy Grover <andy.grover@oracle.com>
* include/ddk/winddk.h (KeFlushQueuedDpcs, KeMemoryBarrier): Define.
        (KeGetCurrentProcessorNumber): Fix incorrect member reference.
        (InterlockedIncrement, InterlockedDecrement): fix warning.
        * lib/ddk/ntoskrnl.def (KeFlushQueuedDpcs, KeMemoryBarrier): Export.
        (KeNumberProcessors): Export.
2008-08-30 02:16:11 +00:00
Christopher Faylor 5f05c64ce4 * fhandler_tty.cc (close_maybe): Check for both types of invalid handle before
attempting CloseHandle.
(fhandler_pty_master::setup): Only set inheritance on pty handles, not tty
handles.
2008-08-27 21:55:19 +00:00
Keith Marshall 05a6cb1bb2 Avoid access violations, passing NULL to printf( "...%s..." ). 2008-08-27 20:23:42 +00:00
Christopher Faylor 25687b0f76 * cygcheck.cc (nuke): Use malloc rather than alloca for environment variables.
(load_cygwin): Ditto.
* dump_setup.cc (parse_filename): Cosmetic changes.
(get_packages): Ditto.
2008-08-27 20:11:11 +00:00
Christopher Faylor 7e73b9cfd7 * shared_info.h (shared_info::create_root_entry): Remove extraneous
mount_info:: from declaration.
2008-08-26 16:56:30 +00:00
Corinna Vinschen a5d4ae5c5b * fhandler.h (class fhandler_pipe): Rename read and write
declarations to raw_read and raw_write.
	* pipe.cc (fhandler_pipe::raw_read): Rename from read.
	(fhandler_pipe::raw_write): Rename from write.
2008-08-26 15:39:17 +00:00
Chris Sutcliffe a47ee4d624 2008-08-22 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/shlwapi.h (ASSOCF_INIT_NOREMAPCLSID, ASSOCF_INIT_BYEXENAME,
        ASSOCF_OPEN_BYEXENAME, ASSOCF_INIT_DEFAULTTOSTAR,
        ASSOCF_INIT_DEFAULTTOFOLDER, ASSOCF_NOUSERSETTINGS, ASSOCF_NOTRUNCATE,
        ASSOCF_VERIFY, ASSOCF_REMAPRUNDLL, ASSOCF_NOFIXUPS, ASSOCF_IGNOREBASECLASS,
        ASSOCF_INIT_IGNOREUNKNOWN): Define.
2008-08-26 03:34:10 +00:00
Christopher Faylor 30caac0569 add comments 2008-08-25 17:27:06 +00:00
Corinna Vinschen 328b090f29 * mkgroup.c (enum_local_groups): Don't skip printing groups when
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.
2008-08-25 09:38:14 +00:00
Chris Sutcliffe 41e29fbdcf 2008-08-22 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/commctrl.h (LVN_MARQUEEBEGIN): Define.

        Thanks to Tim Kosse <botg at users dot sf dot net>.
2008-08-22 23:54:47 +00:00
Chris Sutcliffe 5f8dcee09f 2008-08-22 Bo Yang <techrazy@users.sourceforge.net>
* include/winnt.h (OWNER_SECURITY_INFORMATION, GROUP_SECURITY_INFORMATION,
        DACL_SECURITY_INFORMATION, SACL_SECURITY_INFORMATION): Correct.
        * include/winnt.h (OWNER_SECURITY_INFORMATION, GROUP_SECURITY_INFORMATION,
        DACL_SECURITY_INFORMATION, SACL_SECURITY_INFORMATION,
        LABEL_SECURITY_INFORMATION, UNPROTECTED_SACL_SECURITY_INFORMATION,
        UNPROTECTED_DACL_SECURITY_INFORMATION, PROTECTED_SACL_SECURITY_INFORMATION,
        PROTECTED_DACL_SECURITY_INFORMATION): Define.
2008-08-22 23:02:50 +00:00
Christopher Faylor 8b2ed8e20a * fhandler.cc (fhandler_base::wait_overlapped): Reorganize again to accommodate
what appears to be an MSDN hint about not resetting the overlapped event prior
to calling GetOverlappedResult.
2008-08-22 04:06:01 +00:00
Corinna Vinschen 7d0a7940e6 * path.cc (symlink_info::check_shortcut): If file can't be opened,
treat it as non-symlink rather than generating an EIO error.
	(symlink_info::check_sysfile): Ditto.
2008-08-20 10:53:54 +00:00
Chris Sutcliffe 236c21ee9e 2008-08-19 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/wtsapi32.h (_WTS_INFO_CLASS, _WTS_CONNECTSTATE_CLASS,
        WTSQuerySessionInformation, WTSFreeMemory): Define.
2008-08-20 02:30:05 +00:00
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
Corinna Vinschen e643b202e6 * dcrt0.cc (dll_crt0_1): Call malloc_init and user_shared_initialize_1
only in non-dynamically loaded case.
2008-07-26 08:32:28 +00:00
Chris Sutcliffe b73c0b890e 2008-07-25 Bo Yang <techrazy@users.sourceforge.net>
* lib/gdi32.def (SetLayout): Export.
2008-07-25 22:13:22 +00:00
Chris Sutcliffe b6e1c2af52 2008-07-25 Bo Yang <techrazy@users.sourceforge.net>
* include/wincrypt.h  (struct _CRYPT_KEY_PROV_PARAM,
        struct _CRYPT_KEY_PROV_INFO, CertGetCertificateContextProperty,
        CryptEnumKeyIdentifierProperties, CryptAcquireCertificatePrivateKey,
        CertCreateCertificateContext, CryptGetKeyIdentifierProperty,
        CertSetCertificateContextProperty, CertCompareCertificateName,
        CryptSetKeyIdentifierProperty, CertOIDToAlgId, CryptGetDefaultProviderA,
        CryptGetDefaultProviderW and many corresponding macroes): Define.
        * lib/crypt32.def  (Export the above 11 functions): Export.
        * include/winerror.h  (CRYPT_E_NOT_FOUND and other crypt related
        macroes): Define.
2008-07-25 22:09:36 +00:00
Corinna Vinschen 1d011c0a68 * dcrt0.cc (dll_crt0_0): Call malloc_init and user_shared_initialize_1
here in case we're dynamically loaded.  Explain why.
	(dll_crt0_1): Call user_shared_initialize_1 from here.
	* mount.cc (is_native_path): New inline function testing for native
	and long Win32 path prefix.
	(is_unc_share): Remove long WIn32 path prefix test.
	(mount_info::create_root_entry): Use PATH_MAX buffer.
	(mount_info::init): Ditto.
	(mount_info::add_item): Test for is_native_path as well.
	* path.cc (normalize_win32_path): Simplify native path prefix code.
	* shared.cc (user_shared_initialize_1): New function taking user
	shared initialization code relying on malloc and cygtls.
	(user_shared_initialize): Move mountinfo initialization to
	user_shared_initialize_1.
	* shared_info.h (user_shared_initialize_1): Declare.
	* syscalls.cc (seteuid32): Call user_shared_initialize_1 after user
	changed.
2008-07-25 15:23:56 +00:00
Christopher Faylor 5f853b3fc5 * mount.cc: Remove non-unix-like options (-x,-t,b) throughout.
(oopts): Use boolean constants for slightly increased clarity.
* configure.in: Remove apparently unneeded program_transfer_name code.
* configure: Regenerate.
2008-07-25 15:03:25 +00:00
Corinna Vinschen e93f946aa7 * utils.sgml: Remove useless text. 2008-07-25 07:08:56 +00:00
Chris Sutcliffe 9c7041ca01 2008-07-24 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/winuser.h (MENUGETOBJECTINFO, MNGO_NOINTERFACE, MNGO_NOERROR,
        MNGOF_TOPGAP, MNGOF_BOTTOMGAP): Define.
2008-07-25 01:50:35 +00:00
Chris Sutcliffe f42ef1eba7 2008-07-24 techrazy <techrazy@users.sourceforge.net>
* include/wingdi.h (OUT_PS_ONLY_PRECIS): Define.
2008-07-25 01:19:11 +00:00
Corinna Vinschen e0fa82235a * mount.cc (mount_info::from_fstab): Change system_printf to
debug_printf on NtOpenFile failure.
2008-07-24 18:32:41 +00:00
Corinna Vinschen 520fcc9747 * shared.cc (user_shared_initialize): Fetch potentially changed Cygwin
username from /etc/passwd before loading mount table.
	(shared_info::init_installation_root): New function fetching Cygwin's
	installation root dir and storing as native NT path in global shared
	memory.
	(shared_info::initialize): Call init_installation_root exactly once at
	first startup.
	* shared_info.h (SHARED_INFO_CB): Accommodate change to shared_info.
	(CURR_SHARED_MAGIC): Ditto.
	(class shared_info): Add installation_root member.
	(shared_info::init_installation_root): Declare.

	* grp.cc (pwdgrp::read_group): Call pwdgrp::load with native WCHAR path.
	* passwd.cc (pwdgrp::read_passwd): Ditto.  Avoid recursion.
	(etc::init): Take POBJECT_ATTRIBUTES instead of path_conv.
	* path.h (etc::init): Change prototype accordingly.
	* pwdgrp.h (class pwdgrp): Store path as UNICODE_STRING/PWCHAR instead
	of as path_conv.
	(pwdgrp::load): Accommodate prototype.
	* uinfo.cc (pwdgrp::load): Change argument type from char to wchar_t.
	Create native NT path here instead of calling path_conv.

	* mount.cc (find_root_from_cygwin_dll): Drop in favor of global
	initializaion in shared_info.
	(mount_info::init): Fetch native NT root dir from cygwin_shared.
	(mount_info::from_fstab): Expect native NT path and use native NT
	functions to access file.  Convert username part in user fstab path
	according to special char transformation rules.
	* path.cc (tfx_chars): Convert slash to backslash.
	(transform_chars): Implement for path given as PWCHAR.
	(transform_chars): PUNICODE_STRING version calls PWCHAR version.
	Remove useless commented code.
2008-07-24 18:25:52 +00:00
Corinna Vinschen 854c14daa4 * include/lmaccess.h (struct _USER_INFO_4): Define.
(struct _USER_INFO_23): Define.
	(struct _GROUP_INFO_3): Define.
2008-07-24 09:01:12 +00:00
Corinna Vinschen f36c78a487 * mkgroup.c (main): Fix test for duplicate domain/machine request.
* mkpasswd.c (main): Ditto.
2008-07-23 20:12:12 +00:00
Corinna Vinschen f9519bcd1a * mkgroup.c: Rework to allow per-domain/per-machine id_offset.
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.
2008-07-23 18:09:50 +00:00
Corinna Vinschen 0bdab5c8a9 * mkgroup.c: Consolidate variable names.
(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.
2008-07-23 11:41:10 +00:00
Corinna Vinschen 02151f07e6 * spawn.cc (spawn_guts): Fix previous patch for UNC paths. 2008-07-23 10:17:04 +00:00
Corinna Vinschen 7e1fdc9e2c * mkgroup.c (enum_groups): Create full qualified groupname using
domain or servername, depending on printing domain or machine accounts.
	* mkpasswd.c (enum_users): Ditto for users.
2008-07-22 20:47:14 +00:00
Corinna Vinschen 4aeb44ee37 * mkgroup.c (main): Remove special root group code. Only print
SYSTEM group in case of printing local machine or local domain groups.
2008-07-22 20:12:02 +00:00
Corinna Vinschen 73814f5ee2 Remove erroneous ChangeLog entry. 2008-07-22 17:31:35 +00:00
Corinna Vinschen 19dc8ba9b2 * spawn.cc (spawn_guts): Remove long path prefix from win32 path
before calling CreateProcess if path length is < MAX_PATH.
2008-07-22 16:59:59 +00:00
Corinna Vinschen a1e1990348 * Makefile.in (cygcheck.exe): Link against ntdll.
* 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.
2008-07-22 14:40:05 +00:00
Corinna Vinschen 737a72dd0e * include/ctype.h: Declare __ctype_ptr__ to keep newlib build happy. 2008-07-22 10:38:18 +00:00
Corinna Vinschen 0485c2ceec * Makefile.in (cygcheck.exe): Link against ntdll.
* bloda.cc: link against ntdll functions statically.
	* cygpath.cc (get_user_folder): Drop 9x code.
	(print_version): Fix copyright.
	* mkgroup.c: Remove 9x code.
	* mkpasswd.c: Ditto.
	* path.cc (oopts): Add new mount options.
	* ps.cc: Fix copyright.
2008-07-21 13:44:42 +00:00
Corinna Vinschen 5a3ed02610 * autoload.cc (WNetGetProviderNameA): Define.
(WNetGetResourceParentA): Remove.
	* fhandler_netdrive.cc (struct net_hdls): New structure to keep
	WNet handles.  Stored in dir->__handle throughout.
	(thread_netdrive): Rewrite to enumerate all servers in all accessible
	domains and workgroups.
	(fhandler_netdrive::readdir): Simplify toplevel code.  Lowercase all
	server names in toplevel.
	(fhandler_netdrive::rewinddir): Close all WNet handles and free
	net_hdls structure.
2008-07-19 12:26:09 +00:00
Corinna Vinschen 8d7e80c2e1 * fhandler.cc (fhandler_base::open): Rename x to fh. On Samba, always
create file with NULL security descriptor and set the permissions
	afterwards.  Explain why.
2008-07-18 12:21:22 +00:00
Corinna Vinschen d83c6a77d2 * cygwinenv.sgml: Move binmode option to list of removed options. 2008-07-18 08:17:28 +00:00
Corinna Vinschen fd8e5366aa * environ.cc (known): Remove "binmode" option.
* fhandler.cc (binmode): Remove.
	(fhandler_base::set_flags): Accommodate binmode removal.
	* path.h (path_conv::set_binary): Remove.
	* pipe.cc (pipe): Create pipes always as binary pipes.
	* winsup.h (binmode): Remove declaration.
2008-07-18 08:16:40 +00:00
Corinna Vinschen 874149c80c * mount.cc (do_mount): Remove MOUNT_ENC code.
(oopts): Remove "managed" option.
	(mount_commands): Drop "managed" handling.
	* path.cc (oopts): Remove "managed" option.
	(getmntent): Remove MOUNT_ENC code.
2008-07-17 15:07:48 +00:00
Corinna Vinschen 5fc03e3d73 * mount.cc (mount_info::from_fstab_line): Default to binary mount. 2008-07-17 14:14:34 +00:00
Corinna Vinschen 85f1119b7b * Revamp documentation for Cygwin 1.7, part 1. 2008-07-17 11:49:45 +00:00
Corinna Vinschen b2dab9e8bc * utils.sgml: Add id's to all examples. 2008-07-17 10:32:03 +00:00
Corinna Vinschen a0c53f920f * path.cc (allow_winsymlinks): Revert default to create system bit
symlinks for speed.
2008-07-16 21:08:22 +00:00
Corinna Vinschen e4b575030b Add case-sensitivity.
Unconditionally handle mount points case-sensitive.
	Unconditionally handle virtual paths case-sensitive.
	Unconditionally handle registry paths case-insensitive.
	Otherwise, accommodate case-sensitivity of given path throughout.
	* cygheap.cc (cygheap_root::set): Get additional caseinsensitive
	parameter and store it.
	* cygheap.h (struct cygheap_root_mount_info): Add member
	caseinsensitive.
	* dlfcn.cc (get_full_path_of_dll): Drop PC_NOFULL parameter from call
	to path_conv::check.
	* environ.cc (pcheck_case): Remove.
	(check_case_init): Remove.
	(known): Drop "check_case" option.
	* exceptions.cc (open_stackdumpfile): Add comment.
	* fhandler.cc (fhandler_base::get_default_fmode): Call pathmatch
	instead of strcasematch.
	* fhandler_disk_file.cc: Accommodate case-sensitivity of given path
	throughout.
	(__DIR_mounts::check_mount): Unconditionally check virtual paths
	case-sensitive.
	(fhandler_disk_file::link): Drop case clash handling.
	(fhandler_disk_file::open): Ditto.
	(fhandler_disk_file::readdir_helper): Drop managed mount code.
	* mount.cc: Remove managed mount code and datastructures.
	(struct opt): Remove "managed" option.  Add "posix=0" and "posix=1"
	options.
	(fillout_mntent): Remove "managed" output.  Add "posix" output.
	* path.cc (struct symlink_info): Remove case_clash member and
	case_check method.
	(pcheck_case): Remove.
	(path_prefix_p): Take additional bool parameter "caseinsensitive".
	(pathnmatch): Ditto.
	(pathmatch): Ditto.
	(mkrelpath): Ditto.
	(fs_info::update): Set caseinsensitive flag according to file system
	name and FILE_CASE_SENSITIVE_SEARCH flag.  Add comment.
	(tfx_chars_managed): Remove.
	(transform_chars): Drop "managed" parameter.  Always use tfx_chars.
	(get_nt_native_path): Drop "managed" parameter.  Make sure drive letters
	are always upper case.
	(getfileattr): Change second parameter to denote caseinsensitivity.
	(path_conv::check): Initialize caseinsensitive to OBJ_CASE_INSENSITIVE.
	Set caseinsensitive according to global obcaseinsensitive flag, file
	system case sensitivity and MOUNT_NOPOSIX mount flag.
	Drop case_clash and all the related code.
	(symlink_worker): Drop case clash handling.
	(symlink_info::set): Drop setting case_clash.
	(symlink_info::case_check): Remove.
	(cwdstuff::set): Add comment.
	(etc::init): Take path_conv instead of PUNICODE_STRING as parameter to
	allow case sensitivity.
	* path.h (enum pathconv_arg): Drop PC_SYM_IGNORE.
	(enum case_checking): Remove.
	(enum path_types): Drop PATH_ENC, add PATH_NOPOSIX flag.
	(struct fs_info): Add caseinsensitive flag and accessor methods.
	(class path_conv): Add caseinsensitive member and define
	objcaseinsensitive method.  Drop case_clash member and isencoded method.
	(pathmatch): Change prototype according to above change.
	(pathnmatch): Ditto.
	(path_prefix_p): Ditto.
	(get_nt_native_path): Ditto.
	(class etc): Ditto.
	(fnunmunge): Remove prototype.
	* shared.cc (shared_info::init_obcaseinsensitive): Initialize
	obcaseinsensitive flag from obcaseinsensitive registry value.
	(shared_info::initialize): Call init_obcaseinsensitive here by the
	first process creating the shared memory.
	* shared_info.h (mount_item::fnmunge): Remove.
	(shared_info::obcaseinsensitive): Rename from obcaseinsensitivity.
	(shared_info::init_obcaseinsensitive): Declare.
	* syscalls.cc (try_to_bin): Add comment.
	* include/sys/mount.h (MOUNT_ENC): Remove flag.
	(MOUNT_NOPOSIX): Add flag.
2008-07-16 20:20:45 +00:00
Corinna Vinschen bed5a336c4 * cyglsa-config: Always create a /bin/cyglsa directory and copy the
LSA DLL there.  Register this copy in the registry.
2008-07-16 19:33:54 +00:00
Corinna Vinschen 80f6f52cb1 * fhandler_tape.cc (mtinfo::initialize): Remove synchronization stuff.
Just initialize drive data.
	* mtinfo.h (MTINFO_MAGIC): Remove.
	(MTINFO_VERSION): Remove.
	(class mtinfo): Remove magic and version members.
	* shared.cc (shared_info::initialize): Move call to
	get_session_parent_dir so that the dir creation is only called once.
	Move call to mt.initialize so that it's called only by the first
	process creating the shared memory.
	* shared_info.h (SHARED_INFO_CB): Accommodate change to shared_info.
	(CURR_SHARED_MAGIC): Ditto.
	(class shared_info): Add obcaseinsensitivity member.
2008-07-15 11:42:45 +00:00
Corinna Vinschen dc4b5caedc * cyglsa.c: Include ntddk.h again, but only if __MINGW32__ is defined.
* cyglsa64.dll: Regenerate.
	* make-64bit-version-with-visual-c.bat: Fix comment.
2008-07-15 09:43:48 +00:00
Corinna Vinschen 3e153bcd55 * fhandler.cc (fhandler_base::fpathconf): On _PC_POSIX_PERMISSIONS
and _PC_POSIX_SECURITY, return true for NFS, too.
2008-07-14 20:46:27 +00:00
Corinna Vinschen e2406d71aa Throughout drop allow_ntsec and allow_smbntsec handling.
* environ.cc (set_ntsec): Remove.
	(set_smbntsec): Remove.
	(known): Remove ntsec and smbntsec options.
	* external.cc (check_ntsec): Return true if no filename is given.
	* mount.cc (oopts): Add "acl" and "noacl" options.  Set MOUNT_NOACL
	flag accordingly.
	(fillout_mntent): Handle MOUNT_NOACL flag.
	* path.h (enum path_types): Add PATH_NOACL.
	* security.cc (allow_ntsec): Remove.
	(allow_smbntsec): Remove.
	* security.h (allow_ntsec): Drop declaration.
	(allow_smbntsec): Drop declaration.
	* include/sys/mount.h (MOUNT_NOACL): Define.
2008-07-14 20:22:03 +00:00
Corinna Vinschen bf216dcad6 * miscfuncs.cc (cygwin_strncasecmp): Fix bug which results in
prematurely truncated strings.  Simplify target length argument to
	sys_mbstowcs.
2008-07-14 19:58:16 +00:00
Corinna Vinschen 88d1b6df94 * autoload.cc (GetExtendedTcpTable): Define.
* fhandler_socket.cc (address_in_use): Take const struct sockaddr
	pointer as argument.  Implement additional AF_INET6 table check.
	(fhandler_socket::bind): Drop AF_INET test before calling
	address_in_use.
	* net.cc (ipv4_getnameinfo): Return EAI_FAMILY instead of 1 if
	called with unsupported af_family.
2008-07-14 15:56:11 +00:00
Corinna Vinschen c0bb6b5bd6 * include/iphlpapi.h (GetExtendedTcpTable): Add prototype.
* include/iprtrmib.h (TCP_TABLE_CLASS, MIB_TCPROW_OWNER_PID,
	MIB_TCPTABLE_OWNER_PID, MIB_TCP6ROW_OWNER_PID,
	MIB_TCP6TABLE_OWNER_PID): Define.
	* lib/iphlpapi.def (GetExtendedTcpTable): Export.
2008-07-14 15:55:48 +00:00
Corinna Vinschen 5a0c7f1df9 * cyglsa.c: Don't include ntddk.h.
(RtlInitEmptyUnicodeString): Use Visual-C compatible "__inline" instead
	of "inline".
	(uni_alloc): Change second argument to USHORT.
	(printf): Move definition of ap to make Visual-C++ happy.
	(LsaApLogonUserEx): Compute size of datastructure returned to
	LSA on 64 bit systems correctly to avoid heap corruption.
	* cyglsa64.dll: Regenerate.
	* make-64bit-version-with-visual-c.bat: Accommodate newer Microsoft
	toolchains.  Add more comment.
	* mslsa.def: Export LsaApLogonUserEx instead of LsaApLogonUser.
2008-07-13 13:14:41 +00:00
Eric Blake 25dab6dc60 Fix usage of recently fixed Interlocked* functions.
* winbase.h (ilockincr, ilockdecr, ilockexch, ilockcmpexch): Add
volatile qualifier, to match Interlocked* functions.
2008-07-12 18:09:17 +00:00
Corinna Vinschen 84e2d2e6cf * select.cc (peek_pipe): Temporarily revert patch from 2008-05-30. 2008-07-11 16:37:29 +00:00
Corinna Vinschen 824fe06cbe * cyglsa.c (LsaApLogonUserEx): Accommodate the fact that authinf->domain
and authinf->username are now of type WCHAR.  Change sam_username and
	sam_u size to be deifned in terms of MAX_DOMAIN_NAME_LEN instead of
	INTERNET_MAX_HOST_NAME_LENGTH.
2008-07-11 10:00:38 +00:00
Corinna Vinschen 9a51257715 Change length for domain buffers from INTERNET_MAX_HOST_NAME_LENGTH to
MAX_DOMAIN_NAME_LEN throughout.
	* cyglsa.h (CYG_LSA_MAGIC): New value.
	(cyglsa_t): Define username and domain as WCHAR arrays.
	* errno.cc (errmap): Add mapping for ERROR_NONE_MAPPED.
	* sec_auth.cc: Drop 'w' prefix from WCHAR string variable names where
	appropriate.
	(extract_nt_dom_user): Prefer resolving by SID before resolving by
	domain\name pair.
	(cygwin_logon_user): Don't print cleartext password in debug output.
	Change comment.
	(get_user_groups): Revert calls to LookupAccountNameW to use NULL
	server instead of explicit server name, according to MSDN.
	(get_user_local_groups): Ditto.
	(get_server_groups): Fetch domain and user name from usersid per
	LookupAccountSidW instead of calling extract_nt_dom_user.
	(lsaauth): Fetch domain and user name from usersid per LookupAccountSidW
	instead of calling extract_nt_dom_user.
	* sec_helper.cc (cygpriv): Convert to wchar_t pointer array.
	(privilege_luid): Convert first parameter to  PWCHAR.
	(privilege_name): Return wchar_t pointer.
	(set_privileges): Accommodate debug output.
	* security.h (privilege_luid): Change prototype accordingly.
2008-07-11 10:00:36 +00:00
Corinna Vinschen ce96cfb292 * cyglsa.c: Revamp debugging output.
(LsaApInitializePackage): Open debugging output file here.
	(LsaApLogonUserEx): Replace LsaApLogonUser.  Add debugging output.
	Create machine name for accounting.  Add (disabled) code to fetch
	a token from GetAuthDataForUser/ConvertAuthDataToToken.
	* cyglsa.din: Relace LsaApLogonUser with LsaApLogonUserEx.
2008-07-10 18:05:03 +00:00
Corinna Vinschen c68cb84e88 * cyglsa.h (SECURITY_STRING): Define.
(enum _SECPKG_NAME_TYPE): Define.
	(struct _SECPKG_CALL_INFO): Define.
	(struct _LSA_SECPKG_FUNCS): Extend to full size.  Define unused
	functions lazily.
	(cygprf_t): Define.
	* sec_auth.cc (lsaauth): Use actual primary group if no admins group.
	Add (disabled) code to fetch token from profil data.
2008-07-10 18:01:25 +00:00
Corinna Vinschen 9035519215 * sec_auth.cc (verify_token): Allow builtin groups missing in a token
and it's still valid.  Explain why.
2008-07-09 15:45:08 +00:00
Corinna Vinschen 375a780e06 * mkgroup.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.
	(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.
2008-07-09 14:32:29 +00:00
Corinna Vinschen 5558de95e5 * autoload.cc (DsGetDcNameW): Replace DsGetDcNameA.
* dcrt0.cc (child_info_spawn::handle_spawn): Drop artificial
	supplementary group list from calling setgroups in parent.
	* grp.cc (internal_getgroups): Drop 9x-only code.  Reformat.
	* sec_auth.cc (get_logon_server): Do everything in WCHAR only.
	(get_user_groups): Ditto.  Use wlogonserver in LookupAccountNameW
	calls, too.
	(is_group_member): Get logon server as first argument and use in call
	to NetLocalGroupGetMembers.
	(get_user_local_groups): Get logon server as first argument and use in
	calls to NetLocalGroupEnum and LookupAccountNameW.  Revamp to work
	more correctly in domain environments.
	(get_server_groups): Accommodate aforementioned changed function calls.
	* security.h (get_logon_server): Change prototype accordingly.
	* uinfo.cc (cygheap_user::env_logsrv): Accommodate changed
	get_logon_server call.
2008-07-09 11:58:38 +00:00
Corinna Vinschen 8f7208243e * grp.cc (internal_getgroups): Also add integrity-enabled groups. 2008-07-09 09:14:12 +00:00
Corinna Vinschen 2827371898 * sec_auth.cc (verify_token): Disable code which returns false if
the token contains additional groups not requested by setgroups.
	Explain why.
2008-07-09 08:10:25 +00:00
Corinna Vinschen 23672785ee * fhandler_socket.cc (fhandler_socket::bind): Don't run explicit
local socket test in SO_REUSEADDR case on systems supporting
	enhanced socket security.  Explain why.  Only call address_in_use
	for AF_INET sockets.
	* net.cc (cygwin_setsockopt): Don't call setsockopt to set SO_REUSEADDR
	on systems supporting enhanced socket security.  Add comment.
	* wincap.h (wincaps::has_enhanced_socket_security): New element.
	* wincap.cc: Implement above element throughout.
2008-07-08 20:12:46 +00:00
Corinna Vinschen b8fbf5d4c4 * net.cc (ipv6_inited): Make NO_COPY. 2008-07-08 12:37:44 +00:00
Danny Smith 6f6b4e11cb 2008-07-06 Gregory McGarry <gregorymcgarry@users.sourceforge.net>
* include/ctype.h (_imp____mb_cur_max): Correct spelling.
	(_imp____mb_cur_max_dll): Likewise.
2008-07-07 07:58:33 +00:00
Danny Smith 608d5d8f36 * include/stdio.h (swprintf, vswprintf): Guard with #ifndef __STRICT_ANSI__
* include/wchar.h (swprintf, vswprintf): Likewise.
2008-07-04 03:55:50 +00:00
Corinna Vinschen bb82bbe6ff * path.cc (path_conv::is_binary): Fix test. Add comment. 2008-07-02 14:00:27 +00:00
Keith Marshall 278101de7f Add _get_output_format(), _set_output_format() for MSVCRT >= MSVCR80 2008-07-01 22:57:24 +00:00
Christopher Faylor 4534778c4c * Makefile.in: Temporarily add ability to generate pdfs. 2008-07-01 17:17:31 +00:00
Christopher Faylor 3236e43753 * effectively.sgml: Correct subject-verb agreement, missing verb
(typo), preposition and (definite vs indefinite) article use.
2008-06-27 00:34:02 +00:00
Brandon Sneed 8b79fb163b 2008-06-25 Brandon Sneed <nivenh@sourceware.org>
* include/winbase.h (GetProcessHandleCount, GetSystemRegistryQuota,
	GetThreadIOPendingFlag): Modified to rely on _WIN32_WINNT 0x0501 instead
	of 0x0502.
	Bug reported by Thomas Denk.
2008-06-25 21:21:08 +00:00
Brandon Sneed 854c27dd8d 2008-06-25 Brandon Sneed <nivenh@sourceware.org>
* include/winbase.h (InterlockedIncrement, InterlockedDecrement,
	InterlockedCompareExchange, InterlockedExchange,
	InterlockedCompareExchangePointer, InterlockedExchangeAdd,
	InterlockedExchangePointer): Modified from PLONG to LONG volatile *.
2008-06-25 20:53:31 +00:00
Corinna Vinschen 7b3e3bfd49 * net.cc (cygwin_bindresvport_sa): Fix usage of last_used_bindresvport. 2008-06-24 13:13:44 +00:00
Corinna Vinschen 3db08eeece * include/limits.h (PATH_MAX): Add comment.
* include/cygwin/config.h (__FILENAME_MAX__): Define as 4096.  Add
	comment.
2008-06-21 20:24:45 +00:00
Danny Smith 31558344b0 Committed as obvious.
* lib/ddk/hal.def (HalTranslateBusAddress): Correct suffix.
	* lib/ddk/ntoskrnl.def (MmAllocateContiguousMemory): Correct suffix.
	Bug reported by Brian Hawley.
2008-06-20 03:19:15 +00:00
Christopher Faylor 2d03477142 * faq-using.xml: Add more words about multiple cygwins. 2008-06-20 01:46:34 +00:00
Corinna Vinschen 83e80c9178 * fhandler_tty.cc (fhandler_pty_master::setup): Fix pipe inheritance. 2008-06-19 19:50:47 +00:00
Christopher Faylor 4f1ed68c5c * strsig.cc (strsignal): Return non-const buffer to allow building with recent
newlib change.
2008-06-19 00:02:13 +00:00
Corinna Vinschen e4278ecbd2 * sec_auth.cc (DsGetDcNameA): Drop declaration.
(DS_FORCE_REDISCOVERY): Drop definition.
2008-06-17 18:54:16 +00:00
Corinna Vinschen d7d60d10a1 * include/dsgetdc.h (DS_FORCE_REDISCOVERY, DS_FORCE_REDISCOVERY,
DS_DIRECTORY_SERVICE_REQUIRED, DS_DIRECTORY_SERVICE_PREFERRED,
	DS_GC_SERVER_REQUIRED, DS_PDC_REQUIRED, DS_BACKGROUND_ONLY,
	DS_IP_REQUIRED, DS_KDC_REQUIRED, DS_TIMESERV_REQUIRED,
	DS_WRITABLE_REQUIRED, DS_GOOD_TIMESERV_PREFERRED, DS_AVOID_SELF,
	DS_ONLY_LDAP_NEEDED, DS_IS_FLAT_NAME, DS_IS_DNS_NAME,
	DS_RETURN_DNS_NAME, DS_RETURN_FLAT_NAME): Define.
	(DsGetDcNameW, DsGetDcNameA): Declare.
	(DsGetDcName): Define.
	* lib/netapi32.def (DsGetDcNameA, DsGetDcNameW): Export.
2008-06-17 18:53:21 +00:00
Christopher Faylor 7ba4aab9b6 * spawn.cc (spawn_guts): Reinstate call to fhandler_console::need_invisible
since it is required to prevent console flashing.
2008-06-17 15:38:17 +00:00
Corinna Vinschen 95c9157df0 * include/resolv.h (_getshort): Drop declaration.
(_getlong): Ditto.
2008-06-17 10:05:28 +00:00
Danny Smith e161debaba Committed as obvious.
[mingw-Bugs-1801641]
	* include/wchar.h (_wfdopen): Const-ify second arg.
	* include/stdio.h (_wfdopen): Likewise.
	Thanks to <tdragon at users dot sourceforge net>
2008-06-14 09:13:38 +00:00
Corinna Vinschen 0730461203 * mount.cc (mount_info::get_cygdrive_info): Fix usage of user and
system arguments.  Strip trailing slash from path for backward
	compatibility.
2008-06-13 15:22:59 +00:00
Corinna Vinschen 9cdaf8733f * fhandler.h (set_console_state_for_spawn): Drop declaration.
* fhandler_console.cc (set_console_state_for_spawn): Remove.
	(fhandler_console::open): Set console state last.  Don't set
	ENABLE_PROCESSED_INPUT flag.
	* spawn.cc (spawn_guts): Drop call to set_console_state_for_spawn.
2008-06-12 15:57:23 +00:00
Christopher Faylor a7e0bc7bbe remove obsolete comment 2008-06-12 14:55:08 +00:00
Corinna Vinschen 24790b9cdb * path.cc (get_nt_native_path): Drop considerations for DOS devices.
Keep relative paths relative.
	(cygwin_conv_path): Don't try to skip native NT prefixes on relative
	paths.
2008-06-11 14:06:05 +00:00