aboutsummaryrefslogtreecommitdiff
path: root/winsup
AgeCommit message (Collapse)AuthorFilesLines
2015-11-02Define MAX_IPOPTLENCorinna Vinschen2-0/+6
* include/netinet/ip.h (MAX_IPOPTLEN): Define. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-02Fix incorrect implementation to clear per-thread pending signalsCorinna Vinschen2-5/+17
* sigproc.cc (class pending_signals): Drop sigproc_init friendship. (pending_signals::clear): Fix implementation to avoid subsequent endless loop in wait_sig. Improve comment. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-02Add support for Parallels Desktop FS (prlfs)Corinna Vinschen10-5/+41
* mount.h (enum fs_info_type): Add prlfs (Parallels Desktop FS). (class fs_info): Add has_broken_fnoi flag. Implement prlfs FS flag. * mount.cc (fs_info::update): Handle PrlFS. Fill new has_broken_fnoi flag with life. (fs_names): Add prlfs. * globals.cc (ro_u_prlfs): Define. * path.h (path_conv::has_broken_fnoi): New method. * path.cc (symlink_info::check): Call file_get_fnoi utilizing new has_broken_fnoi filesystem flag. * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Ditto. * new-features.xml (ov-new2.3): Document Parallels Desktop FS support. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-10-30Workaround bug in LocaleNameToLCID on Windows 10Corinna Vinschen3-6/+22
* nlsfuncs.cc (__get_lcid_from_locale): Handle LocaleNameToLCID returning LOCALE_CUSTOM_UNSPECIFIED instead of failing in case of an unsupported locale on Windows 10. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-10-30Avoid double unlock of TLS mutexCorinna Vinschen2-4/+6
* exceptions.cc (sigpacket::process): Avoid potentially double unlocking the TLS mutex. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-10-30Fix sigwait and pthread_kill return values in case of errorCorinna Vinschen4-3/+23
* signal.cc (sigwait): Fix return value to reflect errno in case of error according to POSIX. Never return EINTR. * thread.cc (pthread_kill): Return errno if sig_send failed. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-10-29Check for correct funtion entry address in munge_threadfuncQian Hong4-3/+18
* init.cc (munge_threadfunc): Check that we're actually replacing the correct original function address on the stack. * ntdll.h (enum _THREADINFOCLASS): Add ThreadQuerySetWin32StartAddress. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-10-27Remove spurious execute permissions from some Cygwin source and text filesJon Turney11-0/+15
2015-08-21 Jon Turney <jon.turney@dronecode.org.uk> * cygwin-cxx.h: Remove execute permissions. * fenv.cc: Ditto. * how-startup-shutdown-works.txt: Ditto. * include/arpa/nameser.h: Ditto. * include/arpa/nameser_compat.h: Ditto. * include/fenv.h: Ditto. * include/resolv.h: Ditto. * libstdcxx_wrapper.cc: Ditto. 2015-10-27 Jon Turney <jon.turney@dronecode.org.uk> * winsup.api/signal-into-win32-api.c: Remove execute permissions. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2015-10-27strftime: Add support for %s (seconds since epoch)Brian Inglis3-0/+10
* libc/time/strftime.c (__strftime): add support for %s (seconds from Unix epoch). Fix whitespaces. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-10-23Clear pending signals targeting exiting threadnewlib-snapshot-20151023Corinna Vinschen4-1/+30
* cygtls.cc (_cygtls::remove): Call remove_pending_sigs. * cygtls.h (_cygtls::remove_pending_sigs): Declare. * sigproc.cc (pending_signals::clear): Define new method taking a _cygtls pointer argument. Drop pending signals for that thread. (_cygtls::remove_pending_sigs): Call pending_signals::clear for this thread. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-10-22winsup/utils: add CPU cache variables to getconf(1)Yaakov Selkowitz2-0/+19
* getconf.c (conf_table): Add LEVEL*_CACHE_* variables. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2015-10-22Export aligned_alloc, at_quick_exit, quick_exit.Corinna Vinschen7-2/+35
* common.din (aligned_alloc): Export. (at_quick_exit): Export. (quick_exit): Export. * posix.xml (std-iso): New section. (std-deprec): Rearrange title text. * new-features.xml (ov-new2.3): Document aligned_alloc, at_quick_exit, Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-10-22Avoid SEGV when handling SIDs with 0 subauthoritiesCorinna Vinschen3-1/+12
* sec_helper.cc (cygsid::get_sid): Don't reject SIDs with missing subauthorities. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-10-22Add release message for previous Cygwin patchCorinna Vinschen1-0/+2
2015-10-22Fix length returned from sys_cp_wcstombs in case nwc > # of wcharsCorinna Vinschen9-14/+23
* strfuncs.cc (sys_cp_wcstombs): Always return number of multibytes without trailing NUL as the documentation implies. Throughout Cygwin, fix usage to align to this pattern. * fhandler_process.cc (format_process_winexename): Drop trailing NUL and LF from output. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-10-21Fix memory leak in pthread_getattr_npCorinna Vinschen3-5/+10
* thread.cc (pthread_getattr_np): Fix memory leak, remove usage of malloc for small local buffer. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-10-21Fix EIO error accessing certain (OS X SMB?) drivesCorinna Vinschen3-1/+15
* path.cc (symlink_info::check_reparse_point): Don't generate an EIO error if NtFsControlFile returns STATUS_NOT_A_REPARSE_POINT. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-10-21* winsup/doc/faq-using.xml (faq.using.same-with-permissions): New entry.Ken Brown2-0/+46
2015-10-20Fix compiler errors/warnings when compiling with -O3Corinna Vinschen3-3/+10
* fhandler_socket.cc (fhandler_socket::wait_for_events): Fix compiler warning in -O3 case. (fhandler_socket::connect): Ditto. * regex/regcomp.c (singleton): Ditto. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-09-08Cygwin 2.3.0: Add missing release messageCorinna Vinschen1-0/+4
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-09-08flock.cc: Fix stack allocation from callee used in callerCorinna Vinschen2-6/+18
* flock.cc (lockf_t::create_lock_obj_attr): Add buffer parameter. Call _everyone_sd with buffer argument from caller rather than everyone_sd with locally allocated stack buffer. (lockf_t::create_lock_obj): Call create_lock_obj_attr only once outside the loop and with additional buffer argument. (lockf_t::open_lock_obj): Call create_lock_obj_attr with additional buffer argument.
2015-09-08faq-using.xml: Replace makewhatis with mandbCorinna Vinschen2-2/+6
* faq-using.xml (faq.using.man): Replace makewhatis with mandb. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-30cygcheck.cc: Fix missing commas in products arrayCorinna Vinschen2-5/+9
* cygcheck.cc (dump_sysinfo): Fix missing commas in products array. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-30cygcheck.cc: Fix debugger problemCorinna Vinschen2-4/+13
* cygcheck.cc (load_cygwin): Only unload cygwin DLL if not running under a debugger. Explain why. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-30cygcheck.cc: Handle W10/2016 sysinfoCorinna Vinschen2-27/+68
* cygcheck.cc (dump_sysinfo): Correctly handle Windows 10/Server 2016. Add missing product types. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-30cygcheck.cc: Fix downlevel DLL handlingCorinna Vinschen2-2/+12
* cygcheck.cc (track_down): Skip error output for "api-ms-win-" downlevel DLLs. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-29sysconf.cc: Fix compiler warning.Corinna Vinschen1-0/+2
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-29Allow sysconf to return CPU cache informationCorinna Vinschen7-63/+539
* include/sys/unistd.h (_SC_LEVEL*): Add cache-related variables as on Linux. * fhandler_proc.cc (format_proc_cpuinfo): Fetch cache information from new cache functions in sysconf.cc, get_cpu_cache_intel and get_cpu_cache_amd. * sysconf.cc (__nt_query_system): New local helper. (get_nproc_values): Utilize __nt_query_system on pre-Windows 7 systems. Use GetLogicalProcessorInformationEx otherwise to handle more than 64 CPUs. Only handle _SC_NPROCESSORS_CONF and _SC_NPROCESSORS_ONLN. (get_phys_pages): New helper to handle _SC_PHYS_PAGES. (cpuid2_cache_descriptor): New array to map Intel CPUID 2 descriptor values to cache type, cache size, associativity and linesize. (cpuid2_cache_desc_compar): Comparision function for bsearch over cpuid2_cache_descriptor. (get_cpu_cache_intel_cpuid2): New function to fetch cache info from Intel CPUID 2. (get_cpu_cache_intel_cpuid4): Ditto from Intel CPUID 4. (get_cpu_cache_intel): New function as CPU-specific entry point. (assoc): New array to map associativity values from AMD CPUID 0x80000006. (get_cpu_cache_amd): New function to fetch cache info from AMD CPUIDs 0x80000005 and 0x80000006. (get_cpu_cache): New function to fetch cache info. (sca): Call get_phys_pages if _SC_PHYS_PAGES is requested. Call get_cpu_cache for new _SC_* cache requests. (SC_MAX): Set to _SC_LEVEL4_CACHE_LINESIZE. (get_phys_pages(void)): Call get_phys_pages(int). * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. * new-features.xml (ov-new2.3): Document sysconf cache addition. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-27Implement POSIX_MADV_WILLNEED/POSIX_MADV_DONTNEED for newer OSesCorinna Vinschen9-19/+147
* autoload.cc (DiscardVirtualMemory): Import. (PrefetchVirtualMemory): Import. * mmap.cc (posix_madvise): Actually implement POSIX_MADV_WILLNEED utilizing PrefetchVirtualMemory and POSIX_MADV_DONTNEED utilizing DiscardVirtualMemory on systems supporting them. * wincap.h (wincaps::has_broken_prefetchvm): New element. * wincap.cc: Implement above element throughout. (wincapc::init): Make sure has_broken_prefetchvm is only true on W10 under WOW64. * include/cygwin/version.h (CYGWIN_VERSION_DLL_MAJOR): Bump to 2003. (CYGWIN_VERSION_API_MINOR): Reset to 0. * new-features.xml (ov-new2.3): New section, document posix_madvise POSIX_MADV_WILLNEED/POSIX_MADV_DONTNEED change. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-26fhandler_proc.cc: Only request group relation informationCorinna Vinschen2-1/+6
* fhandler_proc.cc (format_proc_cpuinfo): Only fetch group relations, we don't need anything else. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-25winsup.h: Claim Windows 10 supportCorinna Vinschen3-4/+11
* winsup.h (_WIN32_WINNT): Set to 0x0a00 for Windows 10. (WINVER): Ditto. Remove outdated comment. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-25autoload.cc: Drop using full paths for system DLLsCorinna Vinschen2-11/+7
System DLLs are always first in the DLL search order so http://www.microsoft.com/technet/security/advisory/2269637.mspx doesn't apply for them. * autoload.cc (std_dll_init): Revert using full paths to system DLLs. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-25autload.cc: Avoid clobbering return address in noload on i686Corinna Vinschen2-2/+9
This fixes a long-standing problem when GetProcAddress fails to load a function. The noload code calls SetLastError on i686 without saving the edx register. Starting with Windows 7, SetLastError apparently uses $edx and the register is set to 0x00000000 on return. So the subsequent `jmp *$edx' in noload supposed to return to the caller, actually jumps to address NULL, which results in a SEGV. * autoload.cc (noload): i686 only: Save and restore $edx when calling SetLastError to avoid clobbering return address stating with Windows 7. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-25mmap.cc: Fix some commentsCorinna Vinschen2-9/+10
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-24Sigproc.cc: Fix copyright.newlib-snapshot-20150824Corinna Vinschen1-1/+1
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-24Fix hang stracing forking processes but not following childCorinna Vinschen4-2/+37
* ntdll.h (PROCESSINFOCLASS): Define ProcessDebugFlags. * sigproc.cc (child_info::child_info): Only propagate _CI_STRACED to child if strace is actually tracing child processes. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-24Bump Cygwin DLL minor number.Corinna Vinschen2-1/+5
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-21Add Lavasoft Web Companion to BLODA list.Jon TURNEY2-0/+6
2015-08-18 Jon Turney <jon.turney@dronecode.org.uk> * faq-using.xml (faq.using.bloda): Add Lavasoft Web Companion to BLODA list. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-08-18Cygwin: Return port number from getservent in network byte orderCorinna Vinschen3-2/+11
* netdb.cc (parse_services_line): Convert port number to network byte order. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-18exceptions.cc: Drop including ucontext.h.Corinna Vinschen3-1/+7
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-17Don't call LsaLookupSids if we're not utilizing Windows account DBsCorinna Vinschen3-19/+42
* grp.cc (internal_getgrfull): Drop asking caches. Explain why. (internal_getgroups): In case we're not utilizing the Windows account DBs, don't call LsaLookupSids but iterate over the group SIDs in the token and call internal_getgrsid for each of them. Explain why. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-17Try harder to avoid LDAP access for RFC2307 mappingCorinna Vinschen4-37/+55
* fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): Rearrange to fall back to myself uid/gid in case we don't utilize Windows account DBs, just as prior to 1.7.34. * sec_helper.cc (cygpsid::get_id): Disable Samba user/group mapping per RFC2307 if we're not utilizing Windows account DBs. * security.cc (convert_samba_sd): Revert previous patch. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-17Fix /proc/cpuinfo topology info on newer AMD CPUsCorinna Vinschen2-7/+29
* fhandler_proc.cc (format_proc_cpuinfo): Handle AMDs providing extended topology info in CPUID leaf 0x8000001e. Fix handling of AMD CPUs providing extended legacy core info in CPUID leaf 0x80000008. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-17mkglobals_h: Handle CRLF earlier.Orgad Shaneh2-1/+5
When globals.cc has CRLF line endings, winsup.h is not removed, and compilation fails for duplicate definitions. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-17Support cpb and eff_freq_ro power mgmt flags in /proc/cpuinfoCorinna Vinschen2-0/+9
* fhandler_proc.cc (format_proc_cpuinfo): Print cpb and eff_freq_ro power management flags. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-15Cygwin: Improve 2.2.1 release notesCorinna Vinschen1-9/+4
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-15Cygwin: Try to fix potential data corruption in pipe writeCorinna Vinschen4-1/+66
* fhandler.cc (fhandler_base_overlapped::raw_write): When performing nonblocking I/O, copy user space data into own buffer. Add longish comment to explain why. * fhandler.h (fhandler_base_overlapped::atomic_write_buf): New member. (fhandler_base_overlapped::fhandler_base_overlapped): Initialize atomic_write_buf. (fhandler_base_overlapped::fhandler_base_overlapped): New destructor, free'ing atomic_write_buf. (fhandler_base_overlapped::copyto): Set atomic_write_buf to NULL in copied fhandler. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-14Fix copy/paste error in previous patchCorinna Vinschen2-2/+7
* security.cc (convert_samba_sd): Fix copy/paste error in previous patch. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-14Don't perform RFC2307 account mapping without account DBCorinna Vinschen4-8/+21
* fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): Only try to map user and group info per RFC2307 if account info is fetched from Windows account DB. (convert_samba_sd): Ditto. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-14Evaluate all group perms in ACL to emulate POSIX user permsCorinna Vinschen2-0/+24
* security,cc (get_attribute_from_acl): Merge all group perms into user perms if user is member of group. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>