summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Cygwin: strace: print windows and cygwin pid in event outputCorinna Vinschen2019-03-233-13/+42
| | | | | | | | | | | | | | strace only printed the Windows PID in event output so far. Especially now that Windows and Cygwin PID are decoupled, the strace user might like to see the Cygwin pid in event output as well. However, at process startup, the process might not have a Cygwin PID yet. To mitigate this, always print the Windows PID and only add the Cygwin pid if it exists. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: wcsxfrm_l: Only byte swap if dest size is > 0Corinna Vinschen2019-03-192-9/+15
| | | | | | | | | | | commit c0d7d3e1a2fa96db15613cbd68a68c96966bc402 removed the usage of the LCMAP_BYTEREV flag in the call to LCMapStringW to workaround a strange bug in LCMapStringW. This patch didn't take a userspace call of wcsxfrm{_l} with NULL buffer and 0 size to evaluate the required buffer size into account. This introduced a crash trying to byte swap the NULL buffer. This patch fixes that problem. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* AMD GCN: Implement circular buffering.Andrew Stubbs2019-03-181-17/+38
| | | | | | | | | | | | | | | | | | | The GCN port outputs stdout and stderr via a shared-memory interface. Previously the buffer was limited to 1000 write operations, which was enough for testing purposes, but easy to exhaust. This patch implements a new circular buffering system allowing a greater amount of output. The interface must allow hundreds of hardware threads to output simultaneously. The new limit is UINT32_MAX write operations. Unfortunately, there's no way to tell if the host side has also been updated. This code will misbehave unless the gcn-run from GCC is also updated (although it's fine the other way around), but that patch has already been committed. OK? Andrew Stubbs Mentor Graphics / CodeSourcery
* Cygwin: proc: fix /proc/version output after uname changeCorinna Vinschen2019-03-182-1/+16
| | | | | | | | 3.0.0 changed uname but missed to align /proc/version which then used the old uname function on the new uname struct. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: bump version to 3.0.5Corinna Vinschen2019-03-181-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add semihosting docs for nios2 and m68kcygwin-3_0_4-releaseJeff Johnston2019-03-142-0/+411
| | | | | | | | | | | Author: Sandra Loosemore <sandra@codesourcery.com> Date: Wed Mar 13 20:22:16 2019 -0700 Add semihosting documentation for nios2 and m68k. QEMU maintainers have asked for a specification of the nios2 semihosting interface. Since it's essentially a copy of the m68k implementation, this patch adds a document for that target as well.
* Cygwin: acls: allow converting empty acl to textCorinna Vinschen2019-03-132-2/+5
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: proc: add missing LF to /proc/<PID>/stat outputCorinna Vinschen2019-03-131-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: ps: simplify codeCorinna Vinschen2019-03-121-47/+18
| | | | | | | | | Always use NtQuerySystemInformation(SystemProcessIdInformation). This drops two code paths calling NtQueryInformationProcess or GetModuleFileNameExW and only requires to open the process to fetch system time info. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: ps: show *all* processes in ps -W outputCorinna Vinschen2019-03-121-32/+51
| | | | | | | | | | | | | | | There's a long-standing bug in ps -W. It only shows processes which ps can open with PROCESS_QUERY_LIMITED_INFORMATION permissions. However, that fails for a lot of system processes. Due to that, output is basically restricted to processes in the same session, as well as Cygwin processes... which isn't *quite* what ps -W was supposed to do. Basically we only need to open the process to fetch the image name. If that fails, utilize the undocumented SystemProcessIdInformation info class introduced with Windows Vista, which allows to fetch the image name by specifying the PID. Restructure the code a bit. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: ntdll.h: Add SystemProcessIdInformationCorinna Vinschen2019-03-121-9/+16
| | | | | | | Add SystemProcessIdInformation to SYSTEM_INFORMATION_CLASS and define struct _SYSTEM_PROCESS_ID_INFORMATION. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: loadavg: improve debugging of load_initCorinna Vinschen2019-03-122-17/+27
| | | | | | | | | | | | | | When logging in via ssh with an unprivileged account, PdhAddEnglishCounter returns with status 0x800007D0, PDH_CSTATUS_NO_MACHINE. We didn't find any workaround but the changes to improve debugging output may help in future. Using UNICODE instead of ANSI functions is a result of trying to fix this problem. Also drop the prototype workaround for PdhAddEnglishCounterA. It's not required anymore since Mingw-w64's pdh.h catched up. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: add /proc changes to release notesCorinna Vinschen2019-03-122-0/+9
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: fork/exec: Allow all users PROCESS_QUERY_LIMITED_INFORMATIONCorinna Vinschen2019-03-122-17/+30
| | | | | | | | | | | Create process with standard rights, plus PROCESS_QUERY_LIMITED_INFORMATION for authenticated users. This allows to fetch basic process information and thus /proc/<PID>/stat to succeed on foreign processes. While at it, fix formatting in CreateProcess calls. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: proc: let stat info always succeedCorinna Vinschen2019-03-121-32/+38
| | | | | | | | | There's no good reason to return blank if some of the info couldn't be collected. Drop useless call collecting SystemProcessorPerformanceInformation. Always return some valid start_time, even if we couldn't collect ProcessTimes. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: proc: don't request PROCESS_VM_READ perms for statCorinna Vinschen2019-03-121-1/+1
| | | | | | | The OpenProcess call to generate /proc/<PID>/stat info requests PROCESS_VM_READ, but that's not required. Drop it. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: proc: return more useful cmdlineCorinna Vinschen2019-03-121-6/+3
| | | | | | | | | | Creating /proc/<PID>/cmdline requires permissions to communicate with the target process via its signal pipe. If that fails, the output is "<defunct>" which doesn't make sense most of the time. Rather, call format_process_exename in this case to get more useful process name info, albeit not the full cmdline. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: fix permissions of winpid symlinksCorinna Vinschen2019-03-112-1/+15
| | | | | | | | The winpid symlinks got created with no query permissions, so only admins could see all Cygwin processes. Create symlinks so everyone has query permissions instead. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: bump version to 3.0.4Corinna Vinschen2019-03-091-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: posix timers: fix a deadlockcygwin-3_0_3-releaseCorinna Vinschen2019-03-082-0/+5
| | | | | | | | | | | | Canceling the timer thread runs under lock. The thread uses the same lock to guard its timer_tracker struct access. If the timing is bad, timer_settime or timer_delete grab the lock at the same time, the timer expires. In the end, cancel waits for the thread sync while the thread waits for ther lock to be released. Fix this by not waiting for the thread sync under lock. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: posix timers: fix resource leakCorinna Vinschen2019-03-062-1/+14
| | | | | | | | On setting the timer, the thread is accidentally only canceled when disarming the timer. This leaks one thread per timer_settimer call. Move the thread cancellation where it belongs. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: bump version to 3.0.3Corinna Vinschen2019-03-051-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: seteuid: do not verify lsaprivkeyauth tokencygwin-3_0_2-releaseCorinna Vinschen2019-03-041-12/+1
| | | | | | | | | | | We don't support setting groups via /etc/groups anymore. Also, the initgroups group list is created via S4U, so we have "Interactive" vs. "Network" token, an artificial and entirely irrelevant difference. So, "verifying" the lsaprivkeyauth token may lead to rejecting a prefectly valid token. Just remove the verify_token call. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Revert "Cygwin: load_user_profile: temporarily extend debug output"Corinna Vinschen2019-03-041-10/+5
| | | | This reverts commit 6aef5a46d7f22841e6a859103bb3f8acea060b84.
* Cygwin: Revert attempting to unload user profile after useCorinna Vinschen2019-03-047-38/+3
| | | | | | | | | | | | | | | | | | | | | | | Revert "Cywin: user profile: unload impersonation user profile on exit" Revert "Cygwin: seteuid: allow inheriting impersonation user profile handle" Revert "Cygwin: user profile: add debug output to unload_user_profile" Revert "Cygwin: user profile: Make an effort to unload unused user profiles" This reverts commit bcb33dc4f0552e749dcb6c44e1ef7815b5db75a1. This reverts commit dd3730ed9c1c78176f1aab1b429bb5a105d90a44. This reverts commit 8eee25241e86fc596acde25c7c53723b75afee30. This reverts commit 71b8777a7140b79942d6e5079818cad2c3f5f07f. This patchset actually results in the following problem: - After a couple of ssh logon/logoff attempts, an interactive session of the same user loging in, is broken. Apparently UnloadUserProfile manages to unload the user's profile even while a parallel interactive session still uses the user's profile. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: update 3.0.2 release fileCorinna Vinschen2019-03-041-0/+3
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: doc: update case-sensitive dirs descriptionCorinna Vinschen2019-03-041-6/+19
| | | | | | | Since we have to disable automatic case-sensitive mkdir again, change documentation accordingly. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: fork: fix child process permissions, take 3Corinna Vinschen2019-03-031-1/+28
| | | | | | | | | | | | | Per MSDN VirtualQueryEx requires PROCESS_QUERY_INFORMATION. Testing showed that PROCESS_QUERY_LIMITED_INFORMATION is sufficient since Windows 8.1. The assumption that Windows 8 is the same as Windows 8 was not correct, it requires PROCESS_QUERY_INFORMATION as well. Fix that by splitting the Windows 8 wincaps into one for Windows 8 and one for Windows 8.1. Set needs_query_information for Windows 8. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: load_user_profile: Don't give primary domain to ldapCorinna Vinschen2019-03-021-14/+7
| | | | | | | | If the user domain is the primary domain, LDAP is supposed to use the default naming context. This is accomplished by setting domain name to NULL in the call to cyg_ldap::fetch_ad_account. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: ldap: Fix overwriting domain when creating naming contextCorinna Vinschen2019-03-021-7/+7
| | | | | | | | | | | cyg_ldap::fetch_ad_account creates a naming context from the incoming domain, if it's not NULL. The algorithm overwrites dots with \0 in domain while creating the naming context, but neglects to restore the dots. Fix that by never overwriting the incoming domain name. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: fenv.h: Add feature test macros, fix valuesCorinna Vinschen2019-03-013-33/+52
| | | | | | | | | | | | | | | - feenableexcept,fedisableexcept, fegetexcept are GNU-only - fegetprec, fesetprec are Solaris, use __MISC_VISIBLE - _feinitialise is Cygwin-internal only - Replace self-named FP precision values to values from http://www.open-std.org/jtc1/sc22//WG14/www/docs/n752.htm as used by Solaris. - Change return value of fesetprec to adhere to the above document and Solaris. - Document fegetprec, fesetprec as Solaris functions, not as GNU functions Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: authentication: Always initialize domain infoCorinna Vinschen2019-03-011-0/+8
| | | | | | | | ...before calling any of its method. It's no safe bet that it's already initialized when calling s4uauth and adding it to load_user_profile certainly doesn't hurt. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: load_user_profile: use local pointer when appropriateCorinna Vinschen2019-03-011-4/+3
| | | | | | | dnsdomain does not have to be a copy of the domain, a pointer into cygheap is sufficient. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: load_user_profile: fix use-after-free issueCorinna Vinschen2019-03-011-1/+5
| | | | | | | | | In case of a local machine account login, pi.lpProfilePath points to the buffer returned by NetUserGetInfo, but NetApiBufferFree is called prior to calling LoadUserProfileW. Fix by copying over usri3_profile to the local userpath buffer, just as in the AD case. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: load_user_profile: temporarily extend debug outputCorinna Vinschen2019-03-011-5/+10
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: s4uauth: drop fallback to MsV1_0 if Kerberos failsCorinna Vinschen2019-03-011-90/+76
| | | | | | | This never really worked. While at it, restructure code to do common stuff only in one spot. Improve debug output. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: Disable creating case-sensitive folders by defaultCorinna Vinschen2019-03-013-5/+17
| | | | | | | | | | Inspecting the content of case-sensitive directories on remote machines results in lots of errors like disappearing diretories and files, file not found, etc. This is not feasible as default behaviour Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: load_user_profile: chack if we got a valid, known domainnameCorinna Vinschen2019-02-281-7/+12
| | | | | | ...otherwise we may suffer a SEGV because dnsdomain is NULL. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: wincap: fix copy/paste bugCorinna Vinschen2019-02-281-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: timerfd: add a sleep when being debuggedCorinna Vinschen2019-02-261-0/+9
| | | | | | | | | | | | A sleep is required on Windows 10 64 bit only before calling RegisterClassW in the timerfd thread, and only when running under strace. One of the child processes inheriting the timerfd descriptor will get a STATUS_FLOAT_INEXACT_RESULT exception inside of msvcrt.dll. It's apparently some timing problem. It occurs in 4 out of 5 runs under strace only. WOW64 and Windows 7 64 bit don't have this problem. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: timerfd: reduce size of shared mem region to a single pageCorinna Vinschen2019-02-261-5/+5
| | | | | | | | The share section was created using the PAGE_SIZE constant, but PAGE_SIZE is 64K. Fix that by using wincap.page_size() instead, which returns the desired actual page size of 4K. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: use NULL security descriptor in InitializeObjectAttributesCorinna Vinschen2019-02-253-8/+4
| | | | | | | Using sec_none{_nih} is just a roundabout way to specify a NULL SD. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: timerfd: rework implementationCorinna Vinschen2019-02-254-240/+216
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | timerfd_tracker and timerfd_shared classes: - Just because handles are shared, we don't have to store them in shared memory. Move share handles into timerfd_tracker class. - Drop shared instance counter since it's not required anymore. timerfd_shared only stores the actual timer data. - Drop timerfd_shared::create, just set clock id. - Drop timerfd_shared::dtor, it's not required anymore. - Drop timerfd_tracker::close, just call dtor where required. - Rename timerfd_tracker::increment_instances to timerfd_tracker::dup. It's the only reason it exists... - timerfd_tracker::dtor now checks the non-shared pointers for NULL before attempting to close them. - timerfd_tracker::dtor handles decrementing the local instance count by itself. - Add a method timerfd_tracker::init_fixup_after_fork_exec to set non-shared pointers to NULL. Together with the dtor patches it fixes a problem with close_on_exec timerfd descriptors. - Fix a bug in handling the thread synchronization event. It's actually nice to create it before using it... - Drop using sec_none{_nih} in InitializeObjectAttributes. It's an unnecessary roundabout route just to get a NULL pointer. - Slightly rework timechange window handling. - Add more comments to explain what happens. fhandler_timerfd: - Drop cnew macro, it just hides what happens. - fhandler_timerfd::fixup_after_exec now calls timerfd_tracker::init_fixup_after_fork_exec first, so a subsequent call to timerfd_tracker::dtor only works on valid handles. - fhandler_timerfd::close directly calls timerfd_tracker::dtor now. - Drop dtor call in fhandler_timerfd destructor. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: timerfd: fix shared memory allocation in fork/execCorinna Vinschen2019-02-242-6/+11
| | | | | | | | | | timerfd_tracker::fixup_after_fork_exec always tries to restore the shared timer region at the same address as in the parent. This is entirely unnecessary and wasn't intended, rather some kind of copy/paste thinko. Fix that. Print NtMapViewOfSection status code in api_fatal on failure for debugging. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: POSIX timers: Fix timer values returned for unarmed timerCorinna Vinschen2019-02-242-1/+4
| | | | | | | The "optimized" condition to recognize an unarmed timer was plain wrong. Replace it by checking the stored it_value against 0. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: Add 3.0.2 release fileCorinna Vinschen2019-02-231-0/+20
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: timerfd: fix select always returning immediatelyCorinna Vinschen2019-02-231-2/+23
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cywin: user profile: unload impersonation user profile on exitCorinna Vinschen2019-02-232-0/+6
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: seteuid: allow inheriting impersonation user profile handleCorinna Vinschen2019-02-231-1/+5
| | | | | | | The child process needs access to the handle to be able to unload it when switching user context. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: user profile: add debug output to unload_user_profileCorinna Vinschen2019-02-231-1/+4
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>