Commit Graph

7048 Commits

Author SHA1 Message Date
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
Corinna Vinschen abe2834a49 * include/cygwin/version.h (CYGWIN_VERSION_MOUNT_REGISTRY): Bump.
(CYGWIN_INFO_CYGWIN_MOUNT_REGISTRY_NAME): Remove.
	(CYGWIN_INFO_CYGDRIVE_FLAGS): Remove.
	(CYGWIN_INFO_CYGDRIVE_PREFIX): Remove.
	(CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX): Add comment to differ from the
	registry related defines.
2008-06-11 09:43:59 +00:00
Corinna Vinschen 373a7e22e2 * fhandler_procnet.cc (dad_to_flags): Fix comment. 2008-06-11 08:38:39 +00:00
Corinna Vinschen c9227bf8a7 * fhandler_procnet.cc (get_scope): New static function to evaluate
scope.
	(dad_to_flags): New static array to convert Windows DAD state to
	Linux values.
	(format_procnet_ifinet6): Drop asking for IfIndex, just use Ipv6IfIndex.
	Use get_scope and dad_to_flags to generate more accurate linux-like
	output.
2008-06-10 19:58:58 +00:00
Corinna Vinschen bbfcc68ad2 * net.cc (if_nametoindex): Fix typo in call to get_adapters_addresses.
(if_indextoname): Prefer IPv6 loopback device name over IPv4 loopback
	device name on pre-Vista systems.
	(if_nameindex): Ditto.
2008-06-10 18:15:57 +00:00
Corinna Vinschen 7a2c0a0d6b * fhandler_procnet.cc (format_procnet_ifinet6): Use sprintf rather than
__small_sprintf.
	* net.cc (if_nametoindex): Prefer IPv6IfIndex over IfIndex for
	consistency with /proc/net/if_inet6.
	(if_indextoname): Ditto.
	(if_nameindex): Ditto.
2008-06-10 17:24:00 +00:00
Corinna Vinschen 58014a9b46 * mount.cc (mount_info::from_fstab): Read sizeof (buf) - 2 bytes.
Add code to handle overly long lines.
2008-06-10 17:17:44 +00:00
Corinna Vinschen 93e9098f7c * sec_auth.cc (lsaauth): Make returned token inheritable. 2008-06-10 15:16:01 +00:00
Corinna Vinschen be5937cd97 * devices.cc: Regenerate. 2008-06-10 14:48:24 +00:00
Christopher Faylor 0498e171a5 * devices.in: Remove "Global" from tty device. 2008-06-09 14:01:40 +00:00
Christopher Faylor c230ba2a1c * signal.cc (abort): Only flush streams after signal handler. 2008-06-09 13:45:59 +00:00
Keith Marshall 47140f3cdb Avoid precision errors in round(), lround() and llround() functions. 2008-06-03 18:42:21 +00:00
Christopher Faylor 585cd03044 * cygwin.sc: Remove unrequired and erroneous definition. 2008-06-03 02:22:36 +00:00
Christopher Faylor 11a36faaa6 * select.cc (peek_pipe): Semi-reinstate pipe NT-special write detection. 2008-05-30 17:56:37 +00:00
Christopher Faylor 4f3af63913 add missing entry 2008-05-29 17:09:10 +00:00
Christopher Faylor 2bae7a19e4 * devices.in: Change mapping for /dev/ttyS* and /dev/com*. 2008-05-29 17:08:45 +00:00
Chris Sutcliffe 3589c421a9 2008-05-28 Chris Sutcliffe <ir0nh34d@users.sf.net>
* include/commctrl.h (NMLVODSTATECHANGE): Define.

        Thanks to Tim Kosse <botg at users dot sf dot net>.
2008-05-29 01:39:52 +00:00
Chris Sutcliffe 35d597a593 2008-05-28 Chris Sutcliffe <ir0nh34d@users.sf.net>
* include/winnt.h (SUBLANG_TIBETAN_BHUTAN): Fix definition.

        Thanks to Nicola Di Nisio <nicoladinisio at users dot sf dot net>.
2008-05-29 01:26:45 +00:00
Christopher Faylor 12cf19762d * mount.cc (mount_info::from_fstab): Use proper buffer size. 2008-05-25 23:51:32 +00:00
Christopher Faylor f524521aab * mount.cc (mount_info::init): Revert previous change.
(mount_info::from_fstab): Change system_printf to debug_printf.  Just use a
local NT_MAX_PATH sized temporary buffer.
2008-05-24 15:59:01 +00:00
Corinna Vinschen 0fd62c686d * mount.cc (mount_info::init): Recreate path when trying to read the
user fstab file.
2008-05-24 10:07:49 +00:00
Corinna Vinschen 362ce9fa99 * path.cc (symlink_info::check): Reorder test for nfs symlinks. 2008-05-24 09:54:32 +00:00
Corinna Vinschen 6afd630106 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Don't try to
use FileIdBothDirectoryInformation on NFS shares.  Fix comment to
	explain why.
	* path.cc (symlink_info::check): Reinstantiate no_ea.  Use in
	erroneously changed condition.
2008-05-23 17:22:18 +00:00
Christopher Faylor e765b3c0ad * mount.cc (find_root_from_cygwin_dll): New function factored from from_fstab.
Avoid use of tls since it isn't necessarily initialized when cygwin1.dll is
dynamically loaded.
(mount_info::create_root_entry): Ditto.
(mount_info::init): Calculate cygwin root once.  Use create_root_entry to
record it.  Pass fstab location to from_fstab.
(mount_info::from_fstab): Move root calculation stuff elsewhere, as per above.
* shared_info.h (mount_info::from_fstab_line): Make private.
(mount_info::fstab): Ditto.  Accommodate new arguments.
2008-05-23 16:38:51 +00:00
Christopher Faylor 7cd4542873 * mount.cc (mount_info::from_fstab): Use cygwin_hmodule rather than trying to
find handle based on cygwin1.dll.
* path.cc (symlink_info::check): Remove unused variable.
2008-05-23 15:33:03 +00:00
Corinna Vinschen 7075440208 * shared.cc (open_shared): Fix comments. Fix a condition which has
been overlooked to revert to its old state in change from 2008-04-18.
2008-05-23 11:59:37 +00:00
Corinna Vinschen 1870c68806 * path.cc (symlink_info::check): Define eabuf and easize outside of
loop.  Set to NULL on first STATUS_EAS_NOT_SUPPORTED.  Align comments.
	Fix formatting.
2008-05-23 11:00:35 +00:00
Corinna Vinschen b4ea313a85 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Eliminate
compiler warning.
2008-05-23 10:01:34 +00:00
Christopher Faylor 81adfe2862 * path.cc (symlink_info::check): Don't pass EaBuffer to NtCreateFile if it has
indicated that it isn't appropriate.
* ntdll.h (STATUS_EAS_NOT_SUPPORTED): Define.
* winsup.h: Remove __builtin* defines.
2008-05-23 07:13:47 +00:00
Corinna Vinschen 8a179967e6 * grp.cc (internal_getgroups): Fix thinko. Only add enabled groups to
the group list.
2008-05-22 21:14:30 +00:00
Corinna Vinschen 2122048bd6 * grp.cc (internal_getgroups): Don't add deny-only groups to the group
list.
2008-05-22 21:03:54 +00:00
Corinna Vinschen c15121a287 * cygtls.h (struct san): Add two int values to store the current
tls_pathbuf counters.
	(return_from_fault): Restore tls_pathbuf counters.
	(setup_fault): Save tls_pathbuf counters.
	* tlsoffset.h: Regenerate.
2008-05-22 20:32:15 +00:00
Corinna Vinschen 3ad8ec8546 * setfacl.c (setfacl): Change from void to int. Return 2 in case of
error.
	(main): Return with error code from setfacl.
2008-05-22 18:56:26 +00:00
Corinna Vinschen c1410a8d1e * sec_acl.cc (setacl): Set errno to EINVAL if user or group don't exist. 2008-05-22 12:43:18 +00:00
Corinna Vinschen b72918135c * path.cc (cygwin_conv_path): Define tp before setting up faul handler.
* syscalls.cc: Ditto, throughout.
	(gen_full_path_at): Add bool parameter to allow NULL pathname.
	(futimesat): Allow NULL pathname as GLIBC.
2008-05-22 11:18:46 +00:00
Danny Smith 0b99028af4 Committed as obvious.
2008-05-22  Danny Smith  <dannysmith@users.sourceforge.net>

	[ mingw-Bugs-1961893 ]
	* mingwex/gdtoa/mingw_snprint.c (x_sprintf): Always set __ldtoa mode to 2
	for E format.
2008-05-22 02:09:06 +00:00
Christopher Faylor 9ea50a60e1 * string.h (strchr): Eliminate.
* syscalls.cc (rename): Work around inexplicable C++ warning.
2008-05-22 01:25:37 +00:00
Corinna Vinschen 380b8bac12 * fhandler_disk_file.cc (get_ino_by_handle): Rename pfai to fai.
(fhandler_base::fstat_by_handle): Drop fai_size and pfai in favor of
	static struct fai_buf.  Restructure.
	(fhandler_base::fstat_by_name): Drop fvi_size and pfvi.  Drop fdi_size
	and pfdi in favor of static struct fdi_buf.  Drop redundant test for
	existance.  Use FileDirectoryInformation class instead of
	FileBothDirectoryInformation.  Drop call to NtQueryVolumeInformationFile
	in favor of using pc.fs_serial_number ().  Fix FileId information given
	to fstat_helper.
	(fhandler_disk_file::fstatvfs): Drop fvi_size, pfvi, fai_size and pfai.
	Drop getting FileFsVolumeInformation and FileFsAttributeInformation in
	favor of using the related path_conv info.
	(fhandler_disk_file::opendir): Fix comment.
	(fhandler_disk_file::readdir): Ditto.  Use FileDirectoryInformation
	class instead of FileBothDirectoryInformation.
	* path.cc (fs_info::update): Store MaximumComponentNameLength in new
	member name_len.
	* path.h (struct fs_info): Use ULONG rather than DWORD.  Add member
	name_len to store MaximumComponentNameLength.  Add accessor methods.
	(path_conv::fs_name_len): New method.
2008-05-21 10:23:19 +00:00
Corinna Vinschen 0d3f365881 * fhandler.h (dirent_states): Add dirent_nfs_d_ino state and add it to
dirent_info_mask.
	* fhandler_disk_file.cc (fhandler_disk_file::opendir): Set
	dirent_nfs_d_ino flag for NFS shares.  Explain why.
	(fhandler_disk_file::readdir): Use FileNamesInformation instead of
	FileBothDirectoryInformation info class on NFS clients not supporting
	the FileIdBothDirectoryInformation info class.  Use local pointers to
	accommodate different offsets.
	* path.cc (symlink_info::check): Don't test directories for symlinks
	on NFS shares.  Enhance comment.
2008-05-21 09:02:42 +00:00
Corinna Vinschen 2762ac6c19 * syscalls.cc (FILTERED_MODE): Define valid chmod mode mask.
(chmod): Call fh->fchmod with filtered mode.
	(fchmod): Ditto.
2008-05-21 08:05:53 +00:00
Corinna Vinschen 6e961ccc7e * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Fix test for
S_IFSOCK in mode bits.
2008-05-20 21:08:39 +00:00
Corinna Vinschen 28259ba2dd * path.cc (symlink_worker): Fix EA buffer size info given to
NtCreateFile.
	(symlink_info::check_nfs_symlink): Get 64K buffer for EA buffer.
	Change EA buffer size info given to NtQueryEaFile accordingly.
2008-05-20 18:26:45 +00:00
Corinna Vinschen c44e0ba1f5 * path.cc (symlink_info::check_shortcut): Minimize requested file
access flags.
	(symlink_info::check_sysfile): Ditto.  Add missing `else'.
	(symlink_info::check): Only retry to open file if first try failed
	with access denied.
2008-05-20 18:19:32 +00:00
Corinna Vinschen 4c5627e7e2 * path.cc (fs_info::update): Re-add opening the unsplitted path
for fillout_mntent's sake.
2008-05-20 17:18:08 +00:00
Corinna Vinschen ec0165f29c * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Create directories
on NFS shares with correct mode bits.
2008-05-20 16:24:06 +00:00
Corinna Vinschen 316d9cabfe * winsup.h (cygwin_inet_addr): Fix type of declaration. 2008-05-20 15:39:26 +00:00
Corinna Vinschen fe6934da14 * Makefile.in (DLL_OFILES): Add nfs.o.
* fhandler.cc (fhandler_base::open): Open files on NFS shares with
	correct access flags and EAs.
	* fhandler.h (fhandler_base::fstat_by_nfs_ea): Declare.
	* fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): New method.
	(fhandler_base::fstat_by_handle): Call fstat_by_nfs_ea for files on
	NFS shares.
	(fhandler_disk_file::fchmod): Use NFS specific method to set mode for
	files on NFS shares.  Don't overrule errno from call to
	set_file_attribute with errno from NtSetInformationFile call.
	(fhandler_disk_file::fchown): Add comment.
	* mount.cc (fillout_mntent): Accommodate change in second parameter
	to fs_info::update.
	* nfs.cc: New file.
	* nfs.h: New file.
	* path.cc (fs_info::update): Take handle instead of bool as second
	parameter.  Use that handle if it's not NULL.  Only close handle if
	it has been opened here.  Use static defined buffers instead of
	alloca'd buffers.
	(path_conv::check): Call symlink_info::check with reference to fs.
	Don't call fs.update here if file exists.
	(conv_path_list): Prefer tmp_pathbuf buffer over using alloca.
	(symlink_worker): Use NFS specific method to create symlinks on NFS
	shares.  Prefer tmp_pathbuf buffer over using alloca.
	(symlink_info::check_shortcut): Reopen file from incoming handle
	with necessary FILE_GENERIC_READ flag.  Prefer tmp_pathbuf buffer over
	using alloca.
	(symlink_info::check_sysfile): Ditto.
	(symlink_info::check_reparse_point): Use tmp_pathbuf buffer to
	allocate REPARSE_DATA_BUFFER.
	(symlink_info::check_nfs_symlink): New method.
	(enum symlink_t): Remove.
	(symlink_info::check): Don't use NtQueryAttributesFile.  Rather, open
	file with necessary access flags and call NtQueryInformationFile.  Fix
	error handling in case file can't be opened.  For existing files, call
	fs_info::update here.  Restructure symlink checking to accommodate the
	fact that the file is already open.  Add case for NFS symlinks.
	* path.h (fs_info::update): Take handle instead of bool as second
	parameter.
2008-05-20 15:11:23 +00:00
Corinna Vinschen 2f33b79950 * syscalls.cc (rename): Fix condition when to start a transaction. 2008-05-20 10:24:25 +00:00
Corinna Vinschen c211f8eb24 * path.cc (path_conv::check): Free wide_path and normalized_path if
necessary.
	* path.h (path_conv::path_conv): Set wide_path, normalized_path and
	normalized_path_size to 0 in all constructors.
2008-05-20 10:18:12 +00:00
Corinna Vinschen 78ee2ae11f * syscalls.cc (rename): Allocate temporary path buffers using
tmp_pathbuf.  Don't try to unset R/O attribute on dstpc if a
	removepc exists.  dstpc is a non-existant file in that case.
2008-05-19 20:22:29 +00:00
Christopher Faylor a4e3764e51 * include/stdint.h: Use int rather than long for {u,}int32_t. 2008-05-17 21:34:05 +00:00
Corinna Vinschen 888784b6fb * Makefile.in (install-license): Install COPYING file as well. 2008-05-16 10:37:27 +00:00
Corinna Vinschen bd89ab895b * CYGWIN_LICENSE: New text. 2008-05-16 08:40:39 +00:00
Corinna Vinschen 3ba70bba2f * CYGWIN_LICENSE: Remove duplicate file here. 2008-05-16 08:40:07 +00:00
Chris Sutcliffe 262059a0d8 2008-05-15 Ramiro Polla <ramiro@lisha.ufsc.br>
* include/stdlib.h: Fix strtod under C++.
2008-05-15 23:27:29 +00:00
Corinna Vinschen b61251603a * syscalls.cc (rename): ONly start transaction if FS supports them. 2008-05-15 17:23:29 +00:00
Corinna Vinschen 13b9bb6221 * include/winnt.h (FILE_SEQUENTIAL_WRITE_ONCE): Define.
(FILE_SUPPORTS_TRANSACTIONS): Define.
2008-05-15 17:14:35 +00:00
Corinna Vinschen 4c153b24d9 * autoload.cc (LoadDLLfuncNt): Re-invent.
(NtCreateTransaction): Define.
	(NtCommitTransaction): Define.
	(NtRollbackTransaction): Define.
	(RtlGetCurrentTransaction): Define.
	(RtlSetCurrentTransaction): Define.
	* ntdll.h (TRANSACTION_ALL_ACCESS): Define.
	(NtCreateTransaction): Declare.
	(NtCommitTransaction): Declare.
	(NtRollbackTransaction): Declare.
	(RtlGetCurrentTransaction): Declare.
	(RtlSetCurrentTransaction): Declare.
	* syscalls.cc (start_transaction): New static function to start TxF
	transaction.
	(stop_transaction): New static function to end TxF transaction.
	(rename): Call start_transaction and stop_transaction where appropriate
	on systems supporting transactions.
	* wincap.h (wincaps::has_transactions): New element.
	* wincap.cc: Implement above element throughout.
2008-05-15 16:34:01 +00:00
Corinna Vinschen 43334bd027 * Makefile.in (CYGWIN_BINS): Remove ipcrm and ipcs.
* ipcrm.c: Remove.
	* ipcs.c: Remove.
2008-05-15 11:01:31 +00:00
Corinna Vinschen 455acb11a4 * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Drop
explicit transformation of special DOS chars.
	* strfuncs.cc (sys_wcstombs): Always transform UNICODE private use area
	back to ASCII.
2008-05-14 10:21:22 +00:00
Corinna Vinschen 39ce0b45e9 * include/cygwin/stdlib.h (initstate): Declare.
(setstate): Declare.
2008-05-13 13:56:06 +00:00
Corinna Vinschen a9e9da89fa * path.cc (path_conv::set_normalized_path): Drop strip_tail argument.
Never strip trailing dots and spaces.
	* (path_conv::check): Accomodate above change.
	* path.h (path_conv::operator=): Ditto
	* dtable.cc (build_fh_dev): Ditto.
	* fhandler.h (fhandler_base::set_name): Ditto.

	* path.cc (transform_chars): Disable converting trailing dots and
	spaces.

	* path.cc (path_conv::check): Remove two disabled code snippets.
2008-05-13 13:44:04 +00:00
Corinna Vinschen a065930a3a * random.cc (initstate): Align to POSIX definition.
(setstate): Ditto.
2008-05-13 11:40:45 +00:00
Corinna Vinschen 1563f79fa8 * Makefile.in (DLL_OFILES): Remove _def_time.o.
* libc/_def_time.c: Remove.  Move definitions of _DefaultTimeLocale
	and _CurrentTimeLocale ...
	* libc/strptime.cc: ... here.
2008-05-10 18:57:10 +00:00
Corinna Vinschen 12b830981e * include/sys/localedef.h: Remove.
* libc/strptime.cc: Define _TimeLocale and declare _CurrentTimeLocale
	as well as _DefaultTimeLocale locally for Cygwin.
2008-05-08 14:58:11 +00:00
Corinna Vinschen 72d1a8a04a * Makefile.in (DLL_OFILES): Add _def_time.o. Remove timelocal.o.
* include/sys/localedef.h: New file from NetBSD.
	* libc/_def_time.c: Ditto.
	* libc/getopt.c: Update to latest OpenBSD version 1.23.
	* libc/strptime.cc: Replace FreeBSD version 1.35 with latest NetBSD
	version 1.28.
	* libc/timelocal.cc: Remove.
	* libc/timelocal.h: Remove.
2008-05-08 14:41:47 +00:00
Chris Sutcliffe a8e45d3968 2008-05-06 Ramiro Polla <ramiro@lisha.ufsc.br>
* mingwex/gdtoa/strtodnrp.c: Remove alias from strtod to __strtod.
        * include/stdlib.h: Define strtod to __strtod when __NO_ISOCEXT is not set.
2008-05-07 02:35:16 +00:00
Chris Sutcliffe edce6d8546 Fix typo and commit the write header 2008-05-06 01:25:05 +00:00