Commit Graph

7822 Commits

Author SHA1 Message Date
Corinna Vinschen 339682e6de * sysconf.cc (get_nprocs): New function.
(get_nprocs_conf): Ditto.
	(get_avphys_pages): Ditto.
	(get_phys_pages): Ditto.
	* cygwin.din: Export them.
	* include/sys/sysinfo.h: New header, decalre above new functions.
	* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
	* posix.sgml: Mention them as GNU extensions.
2009-11-12 14:40:48 +00:00
Corinna Vinschen c08f09ab78 * fhandler.h (class fhandler_mailslot): Declare new private method
get_object_attr.
	* fhandler_mailslot.cc (fhandler_mailslot::get_object_attr): Implement.
	(fhandler_mailslot::open): Replace calls to path_conv::get_object_attr
	with calls to fhandler_mailslot::get_object_attr.
2009-11-11 18:16:57 +00:00
Corinna Vinschen afb7f5666d * getfacl.c (print_version): Fix copyright.
(main): Don't reuse local variables confusingly.  Don't print any file
	information if acl() fails.  Improve error message.  Always print a
	trailing empty line.  Set return code to 2 if accessing some file fails.
2009-11-11 10:12:35 +00:00
Corinna Vinschen 03c48ee2e0 * fhandler_console.cc (fhandler_console::read): Revert change from
2009-11-09.
2009-11-10 20:02:20 +00:00
Corinna Vinschen 3aec0f00b1 * fhandler_disk_file.cc (is_volume_mountpoint): Align check with
symlink_info::check_reparse_point().
	* path.cc (symlink_info::check_reparse_point): Rearrange slightly.
	Add code path for unrecognized repare point types.  Add comment.
2009-11-10 08:54:24 +00:00
Corinna Vinschen 16a72f7e4b * path.cc (symlink_info::check_reparse_point): Always check
SubstituteName for volume string to recognize volume mount points.
	Reuse subst when calling sys_wcstombs.
	* syscalls.cc (rename): Set errno to EBUSY when trying to rename
	volume mount points.  Explain why.
2009-11-09 19:46:36 +00:00
Corinna Vinschen ed66791aba * fhandler_console.cc (fhandler_console::read): Restrict generating
META key sequences to singlebyte input chars.
2009-11-09 15:38:36 +00:00
Corinna Vinschen aa9681ec35 * fhandler_disk_file.cc (fhandler_base::fstat_helper): Drop all "other"
permissions from st_mode, if the reading the file's security descriptor
	failed.  Explain why.
2009-11-08 10:22:28 +00:00
Corinna Vinschen b36d8c46e5 * globals.cc (ro_u_scr): New R/O unicode string.
(ro_u_sys): Ditto.
	* syscalls.cc (nt_path_has_suffix): Replace with ...
	(nt_path_has_executable_suffix): New function checking for explicit
	executable suffixes.
	(rename): Call nt_path_has_executable_suffix instead of
	nt_path_has_suffix.  Check oldpath for nt_path_has_executable_suffix
	as well to set old_explicit_suffix.
2009-11-06 20:51:03 +00:00
Corinna Vinschen 1636ce3b32 * transport_pipes.cc (transport_layer_pipes::transport_layer_pipes):
Check cygwin_internal for returning 0 rather than for != 0.
	(transport_layer_pipes::accept): Add debug output.
	(transport_layer_pipes::connect): Ditto.
2009-11-06 13:11:52 +00:00
Corinna Vinschen 74ad9cc012 * shared.cc (inst_root_inited): New static bool variable.
(init_installation_root): Set inst_root_inited to true.
	(memory_init): Print installation root debug output only if
	inst_root_inited is true.
2009-11-06 13:06:36 +00:00
Corinna Vinschen ac4ad8bffc * syscalls.cc (nt_path_has_suffix): New function.
(rename): Don't append .exe suffix if binary target name has any suffix
	at all.
2009-11-05 14:44:12 +00:00
Corinna Vinschen e807aacea9 * spawn.cc (dll_suffixes): Disable. Explain why.
(perhaps_suffix): Use stat_suffixes instead of dll_suffixes.
2009-11-05 09:59:18 +00:00
Corinna Vinschen 13e8e14ab5 * path.cc (read_mounts): Skip unnecessary test if path has been
fetched from loaded cygwin1.dll.
2009-11-04 17:09:32 +00:00
Corinna Vinschen b5f48aa961 * cygcheck.cc (cygwin_dll_path): New global variable.
(load_cygwin): Fetch cygwin DLL path and store in cygwin_dll_path.
	* strace.cc: Full ditto.
	* path.cc (read_mounts): First use the path stored in cygwin_dll_path,
	if available.  Then fall back to fetching own path.  Add comment.
	Drop printing warnings since they look funny in strace output.
2009-11-04 17:00:45 +00:00
Corinna Vinschen 44a019897f * path.cc (read_mounts): First get installation path from own path.
Check if cygwin1.dll exists in same directory.  Only if not, try to
	get installation path from setup registry key.  Add ample warnings.
2009-11-04 15:47:29 +00:00
Corinna Vinschen 73f2ecd19d * Makefile.in (cygpath.exe): Add -fno-threadsafe-statics to CXXFLAGS. 2009-11-04 14:14:52 +00:00
Corinna Vinschen 18f7c50401 * security.cc (alloc_sd): Re-introduce setting the SE_DACL_PROTECTED
flag.  Remove INHERITED_ACE flag from all inherited ACEs.  Add comment.
	Fix ace_off counter in unrelated ACE loop.
	* wincap.cc: Re-add has_dacl_protect throughout.
	* wincap.h: Ditto.
2009-11-03 09:31:45 +00:00
Corinna Vinschen 1bb3825949 * security.cc (alloc_sd): Re-enable generating default permission
entries for directories.
2009-11-02 20:50:15 +00:00
Corinna Vinschen df95867087 * dlfcn.cc (get_full_path_of_dll): Drop enforcing a .dll suffix.
(dlopen): If last path component has no dot, append one to override
	automatic .dll suffix in LoadLibrary.
2009-11-02 14:39:08 +00:00
Charles Wilson 599b80fc86 Final sync of pseudo-reloc.c with mingw64 and cygwin 2009-11-02 12:16:21 +00:00
Corinna Vinschen a657970571 * miscfuncs.h (transform_chars): Declare. Define inline variation here.
* mount.cc (mount_info::from_fstab): Remove extern declaration of
	transform_chars.
	* path.cc (tfx_chars): Move to strfuncs.cc.
	(transform_chars): Ditto.
	* strfunc.cc (tfx_chars): Moved here from path.cc.
	(transform_chars): Ditto.
	(sys_cp_wcstombs): Make UNICODE private use area conversion roundtrip
	save for all characters.
	(sys_cp_mbstowcs): Ditto, by removing special case for UTF-8 sequences
	representing U+f0XX UNICODE chars.  Fix typo in comment.
2009-11-02 11:42:04 +00:00
Corinna Vinschen 9725900d86 path.cc 2009-11-02 10:07:26 +00:00
Corinna Vinschen 0055caee0f * path.cc (tfx_chars): Constify. 2009-11-02 09:49:30 +00:00
Christopher Faylor 8a9358d0f7 * Makefile.in: Use utils mingw front-end to generate non-cygwin binary. 2009-11-01 17:22:44 +00:00
Corinna Vinschen 0de153c586 * new-features.sgml (ov-new1.7-misc): Add installation-specific
unique object names description.
2009-10-31 13:28:13 +00:00
Corinna Vinschen 34861325a5 * cygcheck.cc: Include cygprops.h.
(del_orphaned_reg): New option variable.
	(unique_object_name_opt): Ditto.
	(handle_reg_installation): New function.
	(print_reg_installations): Ditto.
	(del_orphaned_reg_installations): Ditto.
	(memmem): Ditto.
	(handle_unique_object_name): Ditto.
	(dump_sysinfo): Call print_reg_installations from here.
	(usage): Add usage for new options --delete-orphaned-installation-keys,
	--enable-unique-object-names, --disable-unique-object-names, and
	--show-unique-object-names.
	(longopts): Add new options --delete-orphaned-installation-keys,
	--enable-unique-object-names, --disable-unique-object-names, and
	--show-unique-object-names.
	(main): Handle new options.
	* utils.sgml (cygcheck): Change documentaion accordingly.
2009-10-31 13:26:37 +00:00
Corinna Vinschen b079a89e25 * transport_pipes.h (PIPE_NAME_PREFIX): New define.
(PIPE_NAME_SUFFIX): Ditto.
	(class transport_layer_pipes): Convert _pipe_name from char pointer
	to wchar_t array.
	* transport_pipes.cc (transport_layer_pipes::transport_layer_pipes):
	Accommodate the fact that _pipe_name is a wchar_t array, rather than
	a char pointer.
	(transport_layer_pipes::transport_layer_pipes): Initialize _pipe_name
	with variable pipe name based in installation key fetched from Cygwin
	DLL.
	(transport_layer_pipes::accept): Call CreateNamedPipeW explicitely.
	(transport_layer_pipes::connect): Call CreateFileW and WaitNamedPipeW
	explicitely.
2009-10-31 13:24:43 +00:00
Corinna Vinschen 526b0fbca3 * cygprops.h: New file.
* dtable.cc (handle_to_fn): Add check for correct installation_key
	string in object name for pipes and ttys.
	* external.cc (cygwin_internal): Add CW_GET_INSTKEY to allow fetching
	the installation_key from cygserver.
	* fhandler_fifo.cc (fhandler_fifo::fifo_name): Add installation_key
	to fifo name.
	* globals.cc: Include cygprops.h.
	(_RDATA): Move slightly and add comment.
	(cygwin_props): Define.
	* mount.cc (mount_info::init): Accommodate the fact that
	installation_root is now a global variable in DLL common shared memory,
	rather than a member of cygwin_shared.
	* pipe.cc (fhandler_pipe::create_selectable): Add installation_key to
	pipe name.
	* shared.cc (installation_root): Define here for storage in DLL
	common shared memory.
	(installation_key): Ditto.
	(installation_key_buf): Ditto.
	(init_installation_root): Convert from shared_info method to ordinary
	function.  Add initializing installation_key.  Invalidate
	installation_key depending of value of disable_key property.  Add
	comment to explain.
	(get_shared_parent_dir): Add installation_key to directory name.
	(get_session_parent_dir): Ditto.
	(shared_info::initialize): Move call to init_installation_root from
	here...
	(memory_init): ...to here.  Add debug output to print installation root
	and installation key.  Add comment to explain why.
	* shared_info.h (SHARED_INFO_CB): Recalculate.
	(CURR_SHARED_MAGIC): Ditto.
	(class shared_info): Remove definition of installation_root and
	declaration of init_installation_root.
	(init_installation_root): Declare.
	(installation_root): Declare.
	(installation_key): Declare.
	* uinfo.cc (pwdgrp::load): Accommodate the fact that installation_root
	is now a global variable in DLL common shared memory.
	* include/cygwin/version.h: Bump API minor number.
	(CYGWIN_INFO_INSTALLATIONS_NAME): Add.
	* include/sys/cygwin.h (cygwin_getinfo_types): Add CW_GET_INSTKEY.
2009-10-31 13:24:06 +00:00
Corinna Vinschen 7c16c02dbb * sec_helper.cc (security_descriptor::realloc): Call free first if
current security desriptor has been allocated by GetSecurityInfo.
2009-10-31 09:31:47 +00:00
Corinna Vinschen b42441d32b * sec_helper.cc (security_descriptor::free): If sd_size is 0, call
LocalFree instead of ::free.

	* sec_acl.cc: Throughout replace old ACE flag definitions with current
	definitions as used in MSDN man pages.
	* security.cc: Ditto.

	* fhandler.cc (fhandler_base::open): Make sure file has really been
	just created before fixing file permissions.  Add S_JUSTCREATED
	attribute to set_file_attribute call.
	* fhandler_disk_file.cc (fhandler_disk_file::mkdir): Always create dir
	with default security descriptor and fix descriptor afterwards.
	Add S_JUSTCREATED flag to set_file_attribute call.
	* fhandler_socket.cc (fhandler_socket::bind): Ditto for AF_LOCAL
	socket files.
	* path.cc (symlink_worker): Ditto for symlinks.
	* security.cc (get_file_sd): Call GetSecurityInfo rather than
	NtQuerySecurityObject.  Explain why.  Change error handling accordingly.
	(alloc_sd): Skip non-inherited, non-standard entries in ACL if
	S_JUSTCREATED attribute is set.  Explain why.  Minor format fixes.
	* security.h (S_JUSTCREATED): New define.
	(security_descriptor::operator=): New operator.
2009-10-30 19:58:53 +00:00
Corinna Vinschen 53be6f3df6 * fhandler_random.cc (fhandler_dev_random::lseek): Revert change from
2009-10-23.
2009-10-30 10:53:54 +00:00
Corinna Vinschen 460af5f9c0 * smallprint.cc (hex_str): New const string.
(__rn): Drop str and use hex_str instead.
	(__small_vsprintf): If 'l' modifier has been found, print subsequent
	multibyte or wide char string using the s, S, or W options in extended
	hex value layout.

	* fhandler_disk_file.cc (fhandler_disk_file::readdir): Print WCHAR
	and resulting multibyte filename in extended hex value layout in
	debug output.
2009-10-30 09:02:30 +00:00
Charles Wilson c16cd85665 Honor DESTDIR for winsup/mingw and winsup/w32api 2009-10-29 21:53:47 +00:00
Corinna Vinschen d952e44c44 * cygcheck.cc (pretty_id): Drop arguments. Don't change CYGWIN
environment variable.
	(dump_sysinfo): Don't tweak CYGWIN environment variable, just call
	pretty_id once.
2009-10-28 11:41:27 +00:00
Corinna Vinschen 757ee9af8b * pathnames.sgml: Add limitation of case sensitivity with CreateProcess. 2009-10-28 10:11:22 +00:00
Corinna Vinschen 641ba32982 * new-features.sgml (ov-new1.7-posix): Mention UTF-8 as "C" default
and the default locale "C.UTF-8".
	* setup2.sgml (setup-locale-ov): Ditto.
2009-10-28 10:09:54 +00:00
Charles Wilson 73ddc92062 Correct pseudo-reloc size bug wrt error messages 2009-10-26 14:50:09 +00:00
Charles Wilson 654d34dda5 Sync pseudo-reloc.c with mingw64 2009-10-26 13:47:13 +00:00
Christopher Faylor bfead37df4 * faq-setup.xml: Fix clean_setup.pl reference. 2009-10-26 11:57:33 +00:00
Christopher Faylor b8263d5874 * faq-setup.xml: Change clean_setup.pl reference. 2009-10-26 11:25:16 +00:00
Charles Wilson 15c59df67f Sync pseudo-reloc.c with mingw64 2009-10-25 23:37:48 +00:00
Corinna Vinschen e83fef9d35 * fhandler.cc (fhandler_base::open): Remove unused variables sa and sd. 2009-10-24 08:40:15 +00:00
Corinna Vinschen 1647bf67c1 * fhandler.cc (fhandler_base::open): Always create file with default
security descriptor and fix descriptor afterwards.  Change comment to
	explain why.
	* security.cc (alloc_sd): Drop setting the SE_DACL_PROTECTED flag.
	* wincap.cc: Remove has_dacl_protect throughout.
	* wincap.h: Ditto.
2009-10-24 08:26:01 +00:00
Charles Wilson 060a658fe1 Sync pseudo-reloc.c with cygwin/lib/ 2009-10-23 22:19:42 +00:00
Corinna Vinschen 959684bf05 * fhandler_random.cc (fhandler_dev_random::lseek): Allow negative
dummy file positions as on Linux.
2009-10-23 09:22:14 +00:00
Corinna Vinschen aa0937c308 * cygcheck.cc (dump_sysinfo): Update with latest NT 6.1 versions. 2009-10-20 15:26:33 +00:00
Corinna Vinschen a4f31f1b1b * registry.cc (reg_key::get_int): Add alternative implementation
taking WCHAR strings.
	(reg_key::set_int): Ditto.
	(reg_key::get_string): Ditto.
	(reg_key::set_string): Ditto.
	* registry.h (struct reg_key): Add prototypes for added methods.
2009-10-20 14:54:47 +00:00
Corinna Vinschen c94a1006c6 * smallprint.cc (__small_vsprintf): Simplify UNICODE string handling
and allow empty strings.
2009-10-20 14:52:43 +00:00
Corinna Vinschen cbea3f7d93 * fhandler_disk_file.cc (fhander_disk_file::readdir): Handle a status
code STATUS_NOT_SUPPORTED.  Add matching comment.
2009-10-20 10:12:05 +00:00