Commit graph

7016 commits

Author SHA1 Message Date
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