aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
6 hoursCygwin: dsp: Fix incorrect openflags when opening multiple /dev/dspgithub/cygwin-3_5-branchcygwin-3_5-branchTakashi Yano2-13/+20
Previously, the following steps failed with error: 1) Open /dev/dsp with O_RDONLY 2) Open /dev/dsp with O_WRONLY 3) Issue SNDCTL_DSP_GETOSPACE ioctl() for 2) This is because IS_WRITE() returns false for 2) due to incorrect openflags handling in archetype instance. This patch fixes the issue by adding open_setup() to fhandler_dev_dsp to set openflags correctly for each instance. Fixes: 92ddb7429065 ("* fhandler_dsp.cc (fhandler_dev_dsp::open): Remove archetype handling.") Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
12 daysCygwin: suppress a warning generated with w32api >= 12.0.0Jon Turney1-0/+3
w32api 12.0.0 adds the returns_twice attribute to RtlCaptureContext(). There's some data-flow interaction with using it inside a while loop which causes a maybe-uninitialized warning. ../../../../winsup/cygwin/exceptions.cc: In member function 'int _cygtls::call_signal_handler()': ../../../../winsup/cygwin/exceptions.cc:1720:33: error: '<anonymous>' may be used uninitialized in this function [-Werror=maybe-uninitialized] (cherry picked from commit 7e3c833592b282355a57dd34459b152e4e078d19)
2024-06-03Cygwin: disable high-entropy VA for ldhJeremy Drake via Cygwin-patches2-0/+4
If ldd is run against a DLL which links to the Cygwin DLL, ldh will end up loading the Cygwin DLL dynamically, much like cygcheck or strace. Addresses: https://cygwin.com/pipermail/cygwin/2024-May/255991.html Fixes: 60675f1a7eb2 ("Cygwin: decouple shared mem regions from Cygwin DLL") Reviewed-by: Ken Brown <kbrown@cornell.edu>, Takashi Yano <takashi.yano@nifty.ne.jp> Signed-off-by: Jeremy Drake <cygwin@jdrake.com>
2024-06-02Cygwin: pthread: Fix a race issue introduced by the commit 2c5433e5da82Takashi Yano3-17/+25
To avoid race issues, pthread::once() uses pthread_mutex. This caused the handle leak which was fixed by the commit 2c5433e5da82. However, this fix introduced another race issue, i.e., the mutex may be used after it is destroyed. This patch fixes the issue. Special thanks to Bruno Haible for discussing how to fix this. Addresses: https://cygwin.com/pipermail/cygwin/2024-May/255987.html Reported-by: Bruno Haible <bruno@clisp.org> Fixes: 2c5433e5da82 ("Cygwin: pthread: Fix handle leak in pthread_once.") Reviewed-by: Ken Brown <kbrown@cornell.edu> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2024-06-01Cygwin: mixer: Fix volume control for no WAVECAPS_LRVOLUME deviceTakashi Yano2-1/+15
Currently, if the device does not have capability WAVECAPS_LRVOLUME, the volume control does not work properly. This patch fixes that. Fixes: 2a4af3661470 ("Cygwin: Implement sound mixer device.") Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2024-04-09Cygwin: globify: read full 32 bit characterCorinna Vinschen2-1/+6
While commit 0321fb573654 ("Cygwin: glob: convert wchar_t to wint_t") switched the entire glob mechanism from wchar_t to wint_t, the globify function calling glob on a DOS command line did not catch up and only checked for the next character constituting a 16 bit wchar_t. This broke reading surrogate pairs from incoming DOS command lines if the string had to go through glob(3). Check for an entire 32 bit unicode char instead. Fixes: 0321fb573654 ("Cygwin: glob: convert wchar_t to wint_t") Reported-by: David Allsopp <david@tarides.com> Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-04-04Cygwin: FILE_OPEN_NO_RECALL is incompatible with FILE_DIRECTORY_FILECorinna Vinschen3-3/+6
If FILE_DIRECTORY_FILE is given, FILE_OPEN_NO_RECALL is not allowed, otherwise NtCreateFile returns STATUS_INVALID_PARAMETER. Drop FILE_OPEN_NO_RECALL where FILE_DIRECTORY_FILE is specified. Fixes: f6b56abec186 ("Cygwin: try to avoid recalling offline files") Reported-by: Bruce Jerrick <bmj001@gmail.com> Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-04-03Cygwin: add a fake 3.5.3 release fileCorinna Vinschen1-0/+2
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-04-03bump DLL version to 3.5.4Corinna Vinschen1-1/+1
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-04-03Cygwin: utils: refresh tzmap.hcygwin-3.5.3Corinna Vinschen1-3/+4
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-04-03Cygwin: tzmap-from-unicode.org: drop "E. Europe Standard Time" defaultCorinna Vinschen1-3/+3
E. Europe Standard Time is available in the unicode.org windowsZones.xml file, so we can drop the default handling. Fix a few comments. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-04-03Cygwin: tzset(1): use GetDynamicTimeZoneInformationCorinna Vinschen1-62/+5
Use official GetDynamicTimeZoneInformation() function instead of scanning the registry for the timezone keyname. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-04-03Cygwin: fix tzmap-from-unicode.orgCorinna Vinschen1-0/+1
The previous change introduced a missing end of comment Fixes: 60ea9c1c4b66 ("Cygwin: tzmap-from-unicode.org: drop support for Vista/2008") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-04-03bump DLL version to 3.5.3Corinna Vinschen1-1/+1
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-03-21Cygwin: utils: refresh tzmap.hcygwin-3.5.2Corinna Vinschen1-17/+13
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-03-21Cygwin: tzmap-from-unicode.org: drop support for Vista/2008Corinna Vinschen1-8/+0
Commit b794f2c6038f ("Cygwin: drop support for systems not supporting RFC 4646 locales") erroneously changed tzmap.h manually. Change the script accordingly. Fixes: b794f2c6038f ("Cygwin: drop support for systems not supporting RFC 4646 locales") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-03-18Revert "Cygwin: glob: perform ignore_case_with_glob on input"Corinna Vinschen2-19/+7
This reverts commit a51147467e6cf58618433286f93d17043e00b0fc. Dumb thinko on my part. What was supposed to be an optimization actually broke caseinsensitive globbing in that the entire input of globbed expressions were downcased. Drop the unused CCHAR() macro nevertheless. Fixes: a51147467e6cf ("Cygwin: glob: perform ignore_case_with_glob on input") Reported-by: Michael Goldshteyn <mgold10000@gmail.com> Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-03-12Cygwin: pipe: Make sure to set read pipe non-blocking for cygwin apps.Takashi Yano3-32/+68
If pipe reader is a non-cygwin app first, and cygwin process reads the same pipe after that, the pipe has been set to bclocking mode for the cygwin app. However, the commit 9e4d308cd592 assumes the pipe for cygwin process always is non-blocking mode. With this patch, the pipe mode is reset to non-blocking when cygwin app is started. Addresses: https://cygwin.com/pipermail/cygwin/2024-March/255644.html Fixes: 9e4d308cd592 ("Cygwin: pipe: Adopt FILE_SYNCHRONOUS_IO_NONALERT flag for read pipe.") Reported-by: wh <wh9692@protonmail.com> Reviewed-by: Corinna Vinschen <corinna@vinschen.de> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2024-03-11Cygwin: add 3.5.2 release entries for latest commitsCorinna Vinschen1-0/+7
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-03-11Cygwin: getgrent: don't skip SAM-only builtin-accountsCorinna Vinschen2-3/+12
Since commit 15e82eef3a40b ("Cygwin: getgrent: fix local SAM enumeration on domain member machines") we skip enumerating local BUILTIN accounts if we also enumerate AD. However, there are two local accounts which are only available in local SAM, not in AD. Don't skip enumerating those. Fixes: 15e82eef3a40b ("Cygwin: getgrent: fix local SAM enumeration on domain member machines") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-03-11Cygwin: get/set security descriptors using FILE_OPEN_NO_RECALLCorinna Vinschen1-3/+6
Add FILE_OPEN_NO_RECALL to NtOpenFile calls trying to fetch or write file security descriptors so as not to recall them from offline storage inadvertently. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-03-11Cygwin: try to avoid recalling offline filesCorinna Vinschen7-11/+61
Chances are high that Cygwin recalls offline files from remote storage, even if the file is only accessed during stat(2) or readdir(3). To avoid this - make sure Cygwin is placeholder-aware, - open files in path_conv handling, as well as in stat(2)/readdir(3) scenarios with FILE_OPEN_NO_RECALL, and - during symlink checking or testing for executablility, don't even try to open the file if one of the OFFLINE attributes is set. Reported-by: Marcin Wisnicki <mwisnicki@gmail.com> Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-03-06Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.Takashi Yano2-44/+17
Non-cygwin app may call ReadFile() for empty pipe, which makes NtQueryObject() for ObjectNameInformation block in fhandler_pipe:: get_query_hdl_per_process. Therefore, do not to try to get query_hdl for non-cygwin apps. Addresses: https://github.com/msys2/msys2-runtime/issues/202 Fixes: b531d6b06eeb ("Cygwin: pipe: Introduce temporary query_hdl.") Reported-by: Alisa Sireneva, Johannes Schindelin <Johannes.Schindelin@gmx.de> Reviewed-by: Corinna Vinschen <corinna@vinschen.de> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2024-03-04Cygwin: console: Fix a race issue between close() and open().Takashi Yano2-24/+38
The open() call for console sometimes fails if the console owner process is closing the console by close() at the same time. This is due to mismatch state of con.owner variable and attaching state to the console. With this patch, checking con.owner and attaching to con.owner sequence in open(), and resetting con.owner and freeing console sequence in close() are guarded by output_mutex to avoid such a race issue. Addresses: https://cygwin.com/pipermail/cygwin/2024-March/255575.html Fixes: 3721a756b0d8 ("Cygwin: console: Make the console accessible from other terminals.") Reported-by: Kate Deplaix <kit-ty-kate@outlook.com> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2024-03-01Cygwin: console: Do not unmap shared console memory belonging to ctty.Takashi Yano2-3/+12
In the condition that console setup for CTTY and close run at the sametime, accessing shared console memory which is already unmapped may occur. With this patch, to avoid this race issue, shared console memory which belongs to contorolling terminal (CTTY) is kept mapped as before. Addresses: https://cygwin.com/pipermail/cygwin/2024-February/255561.html Fixes: 3721a756b0d8 ("Cygwin: console: Make the console accessible from other terminals.") Reported-by: Kate Deplaix <kit-ty-kate@outlook.com> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2024-02-27 bump DLL version to 3.5.2Corinna Vinschen1-1/+1
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-02-26Cygwin: add release text for getgrent local SAM enumeration patchcygwin-3.5.1Corinna Vinschen1-0/+2
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-02-26Cygwin: getgrent/getpwent: avoid local enumeration on DCsCorinna Vinschen1-0/+5
...if we're supposed to enumerate the AD accounts anyway. This avoids some useless duplication. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-02-26Cygwin: getgrent: fix local SAM enumeration on domain member machinesCorinna Vinschen2-5/+9
Don't skip output of local SAM groups on domain member machines. They can have valid, user-defined groups in their SAM. Just skip builtin groups if we're enumerating AD as well. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-02-26Cygwin: passwd/group: drop Capability SIDsCorinna Vinschen1-18/+29
Capability SIDs (S-1-15-3-...) have been introduced with Windows 10 1909. They don't resolve with LookupAccountSid. We don't need them and they don't map gracefully into out POSIX account namespace. Also, add code to make sure to filter them out *iff* they become resolvable at one point. While at it, slightly reorder code for non-resolving SIDs by authority values. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-02-24Cygwin: Map ERROR_NO_SUCH_DEVICE and ERROR_MEDIA_CHANGED to ENODEVChristian Franke1-2/+2
If a removable (USB) device is disconnected after opening its raw device, R/W attempts fail with ERROR_NO_SUCH_DEVICE(433). If the raw device of a partition is used, ERROR_MEDIA_CHANGED(1110) is returned instead. Both are mapped to ENODEV(19) because <errno.h> does not offer a value which better matches ERROR_MEDIA_CHANGED. Signed-off-by: Christian Franke <christian.franke@t-online.de>
2024-02-24Cygwin: add newgrp release notesCorinna Vinschen1-0/+3
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-02-24Cygwin: newgrp: only allow group from supplementary group listCorinna Vinschen2-5/+27
Windows only allows to set the primary group to a group already present in the TOKEN_GROUP list. Cygwin OTOH fakes success at setgid() time, to allow a subsequent call to setuid() to do the actual account switching. To have a sane behaviour in the command line tool, check group membership and disallow to switch to groups other than those already present in the user token. Fixes: 8bd56ec873453 ("Cygwin: newgrp: first full version") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-02-24Cygwin: newgrp: fix invalid usage of argvCorinna Vinschen1-1/+2
Fix an error message accessing argv[1] even after it has been potentially moved. Print group name from group DB instead. Fixes: 8bd56ec873453 ("Cygwin: newgrp: first full version") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-02-21Cygwin: strptime: add release noteCorinna Vinschen1-0/+3
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-02-21Cygwin: strptime: fix am/pm handlingCorinna Vinschen1-3/+9
The %p format specifier is handled immediately. It requires that tm_hour is already set. This falls flat in case the am/pm marker preceeds the time specification. Locales with am/pm marker preceeding time spec by default exist (e. g. ko_KR). Also, the code expects that tm_hour might be set to an invalid value because the %p specifier is used in conjunction with %H. But this usage is invalid in itself and now catched as error condition after commit 343a2a558153 ("Cygwin: strptime: make sure to fail on invalid input digits"). Change the %H/%I/%p handling according to GLibC, i. e. - fix tm_hour for pm only if the time value has been specified as 12 hour time %I, and - perform the fixup only after the entire input has been scanned. This decouples the fixup from the %p position relativ to %I. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-02-21Cygwin: strptime: make sure to fail on invalid input digitsCorinna Vinschen1-3/+12
conv_num returns NULL if the input is invalid, e. g., the numbers are out of range. However, the code fails to test this in a lot of places. Rather than adding checks all over the place, rename conv_num to __conv_num and create a wrapper macro conv_num to perform the task of error checking. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-02-20Cygwin: gettimeofday: allow tv NULL pointerCorinna Vinschen2-3/+9
Add a missing check for the struct timeval pointer being NULL. Reported-by: 109224573 <109224573@qq.com> Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-02-16Cygwin: pty: Re-fix the last bug regarding nat-pipe.Takashi Yano1-4/+1
Fixes: f907b5f405a3 ("Cygwin: pty: Fix failure to revert from nat-pipe in disable_pcon.") Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2024-02-16Cygwin: pty: Fix failure to revert from nat-pipe in disable_pcon.Takashi Yano1-2/+0
Fixes: a9038789488e ("Cygwin: pty: Additional fix for transferring input at exit."); Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2024-02-16Cygwin: console: Fix a bug that 64th console cannot be handled.Takashi Yano4-9/+8
Fixes: 930e553da8e9 ("Cygwin: console: Unify EnumWindows() callback functions."); Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2024-02-16Cygwin: console: Fix a bug that cannot handle consoles more than 32.Takashi Yano3-2/+4
Fixes: 3721a756b0d8 ("Cygwin: console: Make the console accessible from other terminals.") Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2024-02-15include/ansidecl.h: import from binutils-gdbCorinna Vinschen1-52/+77
Import include/ansidecl.h version from 2024-01-04, binutils-gdb commit fd67aa1129fd. Signed-off-by: Corinna Vinschen <corinna@vinschen.de> (cherry picked from commit 10c8c1cf4f94ed42c59015d7e972269724c451bf)
2024-02-15Cygwin: dumper: use void* in place of PTRCorinna Vinschen1-1/+1
The definition of PTR has been dropped from newer versions of ansidecl.h. Convert definition of print_section_name to use void * instead, as required by bfd_map_over_sections. Signed-off-by: Corinna Vinschen <corinna@vinschen.de> (cherry picked from commit dace0bfa6c8c0ee8e3acc190212e1dd9e5a19677)
2024-02-14Cygwin: console: Unify EnumWindows() callback functions.Takashi Yano4-110/+39
Previously, three similar callback fuctions were used in console code. This patch unifies these functions to ease maintenance cost. Fixes: 8aad3a7edeb2 ("Cygwin: console: Fix a problem that minor ID is incorrect in ConEmu.") Suggested-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2024-02-14Cygwin: pty: Make GNU screen and tmux work in ConEmu cygwin-connector.Takashi Yano1-1/+3
Fixes: 3721a756b0d8 ("Cygwin: console: Make the console accessible from other terminals.") Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2024-02-13Cygwin: console: Fix a problem that minor ID is incorrect in ConEmu.Takashi Yano4-0/+30
Previously, minor device number of console was not assigned correctly in ConEmu environment. This is because console window of ConEmu is not enumerated by EnumWindows(). This patch fixes the issue. Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2024-02-13Cygwin: console: Make VMIN and VTIME work.Takashi Yano2-8/+20
Previously, VMIN and VTIME did not work at all. This patch fixes that. Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2024-02-13Cygwin: pty: Fix potential handle leak regarding CallNamedPipe().Takashi Yano1-2/+18
In pty master_thread, 6 handles are duplicated when CallNamedPipe() requests that. Though some of them are not used so should be closed, they were not. This causes handle leak potentially. Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2024-02-13Cygwin: pty: Fix handle leak in master process.Takashi Yano2-0/+5
If non-cygwin process is started in pty, closing from_master_nat pipe handle was missing in fhandler_pty_slave::input_transfer(). This occured because the handle was duplicated but not closed. https://github.com/msys2/msys2-runtime/issues/198 Fixes: 29431fcb5b14 ("Cygwin: pty: Inherit typeahead data between two input pipes.") Reported-by: Hakkin Lain Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>