Re: [PATCH v1] Cygwin: disable high-entropy VA for ldh

2024-06-02 Thread Ken Brown
Hi Takashi, On 6/1/2024 6:03 PM, Takashi Yano wrote: Hi Ken, On Tue, 28 May 2024 10:19:22 -0700 (PDT) Jeremy Drake wrote: 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:

Re: [PATCH] Cygwin: select: don't report read ready on a FIFO never, opened for writing

2022-10-19 Thread Ken Brown
On 10/18/2022 11:45 AM, Corinna Vinschen wrote: On Sep 23 11:31, Ken Brown wrote: @@ -1043,6 +1043,8 @@ writer_shmem: set_pipe_non_blocking (get_handle (), flags & O_NONBLOCK); nwriters_lock (); inc_nwriters (); + if (!writer_opened () ) +set_writer_opened (); My pers

[PATCH] Cygwin: select: don't report read ready on a FIFO never, opened for writing

2022-09-23 Thread Ken Brown
mpfd) < 0) { perror ("close"); exit (1); } FD_ZERO (); FD_SET (fd, ); nsel = select (fd + 1, , NULL, NULL, _tm); printf (" now select returned %d\n", nsel); } From f4a92734eac17dbfc7ff3541eef9611c87184ed0 Mon Sep 17 00:00:00 2001 From: Ken Brow

Re: [PATCH] Cygwin: fix return value of symlink_info::check

2022-08-09 Thread Ken Brown
v2 attached with a more accurate commit message. Ken On 8/9/2022 3:52 PM, Ken Brown wrote: Patch attached.  Please check my changes to the commentary preceding symlink_info::check to make sure I got it right. I've written the patch against the master branch, but I think it should be applied

[PATCH] Cygwin: fix return value of symlink_info::check

2022-08-09 Thread Ken Brown
:00:00 2001 From: Ken Brown Date: Tue, 9 Aug 2022 15:14:07 -0400 Subject: [PATCH] Cygwin: fix return value of symlink_info::check Currently it is possible for symlink_info::check to return -1 in case we're searching for foo and find foo.lnk that is not a shortcut. This contradicts the new meaning

[PATCH] Cygwin: syscalls.cc: remove ".dll" from, blessed_executable_suffixes

2022-08-04 Thread Ken Brown
Patch attached. I'm not 100% sure of this since it does change behavior (but in a weird case). KenFrom 97a2fc0d07c8f9045b73716ac5a05f972d5bd75c Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Wed, 3 Aug 2022 16:45:23 -0400 Subject: [PATCH] Cygwin: syscalls.cc: remove ".dll&

Re: [PATCH] Cygwin: redefine some macros for Linux compatibility

2022-07-06 Thread Ken Brown
On 7/6/2022 4:25 PM, Ken Brown wrote: Patch attached. I wasn't sure whether the API bump was warranted for such a trivial change.  But the fact is that some programs compiled prior to the patch will behave differently if they are recompiled after the patch.  For example, emacs limits

[PATCH] Cygwin: redefine some macros for Linux compatibility

2022-07-06 Thread Ken Brown
, so this number will change when emacs is recompiled for Cygwin 3.4.0. Is that a good enough reason to bump the API? KenFrom 6d6c1ed356e3e8f39aa9b6447982f3fccbdabfad Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Wed, 6 Jul 2022 14:43:16 -0400 Subject: [PATCH] Cygwin: redefine some macros

Re: [PATCH] Cygwin: spawn: Treat empty path as the current directory.

2022-07-04 Thread Ken Brown
On 7/4/2022 4:37 AM, Corinna Vinschen wrote: On Jul 1 21:32, Ken Brown wrote: I interpreted the existing comment as meaning that a decision was already made at some point to align with Linux. But it can't hurt to wait for Corinna to weigh in. Personally I don't like this old crufty feature

[PATCH] Cygwin: implement getfacl(1) for socket files

2022-07-03 Thread Ken Brown
Patch attached.From 28cd29d99fe6d1a54c8dad04854bda10743737d3 Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Sat, 2 Jul 2022 15:12:40 -0400 Subject: [PATCH] Cygwin: implement getfacl(1) for socket files Do this by defining the acl_get method for the fhandler_socket_local and fhandler_socket_unix

Re: [PATCH] Cygwin: spawn: Treat empty path as the current directory.

2022-07-01 Thread Ken Brown
On 7/1/2022 7:31 PM, Takashi Yano wrote: On Thu, 30 Jun 2022 21:16:35 -0400 Ken Brown wrote: On 6/30/2022 11:45 AM, Ken Brown wrote: On 6/27/2022 8:44 AM, Takashi Yano wrote: - With this patch, the empty path (empty element in PATH or PATH is    absent) is treated as the current directory

Re: [PATCH] Cygwin: spawn: Treat empty path as the current directory.

2022-06-30 Thread Ken Brown
On 6/30/2022 11:45 AM, Ken Brown wrote: On 6/27/2022 8:44 AM, Takashi Yano wrote: - With this patch, the empty path (empty element in PATH or PATH is    absent) is treated as the current directory as Linux does. Addresses: https://cygwin.com/pipermail/cygwin/2022-June/251730.html It might

Re: [PATCH] Cygwin: poll: Fix a bug on inquiring same fd with different events.

2022-06-30 Thread Ken Brown
On 6/26/2022 9:50 PM, Takashi Yano wrote: - poll() has a bug that it returns event which is not inquired if events are inquired in multiple pollfd entries on the same fd at the same time. This patch fixes the issue. Addresses: https://cygwin.com/pipermail/cygwin/2022-June/251732.html

Re: [PATCH] Cygwin: spawn: Treat empty path as the current directory.

2022-06-30 Thread Ken Brown
On 6/27/2022 8:44 AM, Takashi Yano wrote: - With this patch, the empty path (empty element in PATH or PATH is absent) is treated as the current directory as Linux does. Addresses: https://cygwin.com/pipermail/cygwin/2022-June/251730.html It might be a good idea to include a comment in the

Re: [PATCH 7/7] Cygwin: remove miscellaneous 32-bit code

2022-06-11 Thread Ken Brown
On 6/11/2022 8:29 AM, Takashi Yano wrote: On Thu, 9 Jun 2022 15:04:29 -0400 Ken Brown wrote: OK, I'll make that change. Isn't the _dll_crt0() code in dcrt0.cc also x86_64 specific? Thanks for catching that. Should be fixed now. Ken

Re: [PATCH 7/7] Cygwin: remove miscellaneous 32-bit code

2022-06-09 Thread Ken Brown
On 6/9/2022 12:00 PM, Yaakov Selkowitz wrote: On Thu, 2022-06-09 at 17:23 +0200, Corinna Vinschen wrote: On May 29 17:26, Ken Brown wrote: On 5/29/2022 9:39 AM, Jon Turney wrote: On 26/05/2022 20:17, Ken Brown wrote:   winsup/cygwin/autoload.cc    | 136

Re: [PATCH] Cygwin: remove most occurrences of __stdcall, WINAPI, and, __cdecl

2022-06-07 Thread Ken Brown
On 6/7/2022 12:49 PM, Takashi Yano wrote: _dll_crt0() is declared as extern void __stdcall _dll_crt0 () __declspec (dllimport) __attribute__ ((noreturn)); in winsup/cygwin/lib/cygwin_crt0.c, however, this patch removes __stdcall from winsup.h and dcrt0.cc as follows. [...] To be consistent

Re: [PATCH] Cygwin: remove most occurrences of __stdcall, WINAPI, and, __cdecl

2022-06-06 Thread Ken Brown
On 6/5/2022 4:24 PM, Jon Turney wrote: On 03/06/2022 15:00, Ken Brown wrote: remove most occurrences of __stdcall, WINAPI, and __cdecl These have no effect on x86_64.  Retain only a few occurrences of __cdecl in files imported from other sources. While you are correct that it has no effect

Re: [PATCH] Cygwin: remove most occurrences of __stdcall, WINAPI, and, __cdecl

2022-06-05 Thread Ken Brown
On 6/5/2022 4:24 PM, Jon Turney wrote: On 03/06/2022 15:00, Ken Brown wrote: remove most occurrences of __stdcall, WINAPI, and __cdecl These have no effect on x86_64.  Retain only a few occurrences of __cdecl in files imported from other sources. While you are correct that it has no effect

[PATCH] Cygwin: remove most occurrences of __stdcall, WINAPI, and, __cdecl

2022-06-03 Thread Ken Brown
Patch attached.From f3e156ec3b22e426fc79138270f6e15c8156eb7b Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Sun, 29 May 2022 18:59:55 -0400 Subject: [PATCH] Cygwin: remove most occurrences of __stdcall, WINAPI, and __cdecl These have no effect on x86_64. Retain only a few occurrences

Re: [PATCH] Cygwin: Set threadnames with SetThreadDescription()

2022-05-30 Thread Ken Brown
On 5/29/2022 10:03 AM, Jon Turney wrote: gdb master recently learnt how to use GetThreadDescription() [1], so set threadnames using SetThreadDescription() [available since Windows 101607] as well. This is superior to using a special exception to indicate the thread name to the debugger, because

Re: [PATCH 7/7] Cygwin: remove miscellaneous 32-bit code

2022-05-29 Thread Ken Brown
On 5/29/2022 9:39 AM, Jon Turney wrote: On 26/05/2022 20:17, Ken Brown wrote:   winsup/cygwin/autoload.cc    | 136 --- Looks good. I think that perhaps the stdcall decoration number n is unused on x86_64, so can be removed also in a followup? Thanks, I

Re: [PATCH] Cygwin: cygheap: Fix the issue of cygwin1.dll in the root directory.

2022-05-28 Thread Ken Brown
On 5/28/2022 10:20 AM, Takashi Yano wrote: - After the commit 6d898f43, cygwin fails to start if cygwin1.dll is placed in the root directory. This patch fixes the issue. Addresses: https://cygwin.com/pipermail/cygwin/2022-May/251548.html --- winsup/cygwin/cygheap.cc | 5 + 1 file

[PATCH 7/7] Cygwin: remove miscellaneous 32-bit code

2022-05-26 Thread Ken Brown
Patch attached.From d78b3f13a5eca554d50a7c40532f84cafdd1435a Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Tue, 24 May 2022 14:26:33 -0400 Subject: [PATCH 7/7] Cygwin: remove miscellaneous 32-bit code --- winsup/cygwin/autoload.cc| 136 --- winsup/cygwin

[PATCH 6/7] Cygwin: remove 32-bit only clipboard code

2022-05-26 Thread Ken Brown
Patch attached.From cfa148370cb51c6874d51ee97f79d04f6e547ca9 Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Tue, 24 May 2022 10:25:06 -0400 Subject: [PATCH 6/7] Cygwin: remove 32-bit only clipboard code --- winsup/cygwin/fhandler_clipboard.cc | 16 winsup/cygwin/include/sys

[PATCH 5/7] Cygwin: remove some 32-bit only environment code

2022-05-26 Thread Ken Brown

[PATCH 4/7] Cygwin: remove some 32-bit only path conversion functions

2022-05-26 Thread Ken Brown
Patch attached.From 1dd3291b22a72edc234b89e55b5bee9ebcc3f158 Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Tue, 24 May 2022 10:20:23 -0400 Subject: [PATCH 4/7] Cygwin: remove some 32-bit only path conversion functions --- winsup/cygwin/include/sys/cygwin.h | 23 - winsup/cygwin

[PATCH 2/7] Cygwin: simplify some function names

2022-05-26 Thread Ken Brown
Patch attached.From 2e8b069182e3ba639beac43794201e409723b5d9 Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Sun, 22 May 2022 15:18:48 -0400 Subject: [PATCH 2/7] Cygwin: simplify some function names Remove "32" or "64" from each of the following names: acl32, aclch

[PATCH 1/7] Cygwin: remove some 32-bit-only function definitions

2022-05-26 Thread Ken Brown
Patch attached.From 3458c48712e41cef108b7c9582fdc2f63ccac11c Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Sun, 22 May 2022 15:16:47 -0400 Subject: [PATCH 1/7] Cygwin: remove some 32-bit-only function definitions Remove the definitions of the following: acl, aclcheck, aclfrommode, aclfrompbits

[PATCH 0/7] Remove 32-bit code

2022-05-26 Thread Ken Brown
, and it also eliminates the need to define a prototype of stat64 for use in the build of Cygwin. Ken Brown (7): Cygwin: remove some 32-bit-only function definitions Cygwin: simplify some function names Cygwin: remove regparm.h Cygwin: remove some 32-bit only path conversion functions

Re: [PATCH] fhandler_proc.cc(format_proc_cpuinfo): add Linux 5.18 cpuinfo flags

2022-05-25 Thread Ken Brown
On 5/25/2022 8:30 AM, Brian Inglis wrote: 0x8008:0 EBX:31 brs AMD Branch Sampling available 0x8022:0 EAX:0 perfmon_v2 AMD ExtPerfMonAndDbg Performance Monitoring Version 2 0x0021:0 EBX|EDX|ECX=="IntelTDX" tdx_guest Intel Trust Domain Extensions- Guest Support ---

[PATCH] Cygwin: fix mknod (64-bit only)

2022-05-22 Thread Ken Brown
Patch attached. I'll push it in a few days if no one sees anything wrong with it. KenFrom 54cfc70ff3a548d861cb59ac6b2084cc6b791ec2 Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Sun, 22 May 2022 11:43:44 -0400 Subject: [PATCH] Cygwin: fix mknod (64-bit only) The current definition of mknod

Re: [PATCH] fhandler_pipe: add sanity limit to handle loops

2021-12-29 Thread Ken Brown
On 12/26/2021 6:12 PM, Ken Brown wrote: There are some fixes (though not pipe-related) pending for 3.3.4, so I'll push it to the 3.3 branch after I've heard from Takashi and/or Corinna. Takashi must be unavailable also, but it's a simple enough fix that I decided to go ahead and push

Re: [PATCH] fhandler_pipe: add sanity limit to handle loops

2021-12-26 Thread Ken Brown
On 12/26/2021 6:23 PM, Jeremy Drake wrote: On Sun, 26 Dec 2021, Ken Brown wrote: On 12/26/2021 5:43 PM, Jeremy Drake wrote: My loops are still going after an hour. I know that ARM64 would have hit the assert before now. Well, ARM64 hung up, but didn't hit the assert, so maybe there's some

Re: [PATCH] fhandler_pipe: add sanity limit to handle loops

2021-12-26 Thread Ken Brown
On 12/26/2021 5:43 PM, Jeremy Drake wrote: On Sun, 26 Dec 2021, Ken Brown wrote: + /* NtQueryInformationProcess can return STATUS_SUCCESS with +invalid handle data for certain processes. See + https://github.com/processhacker/processhacker/blob/master/phlib

Re: [PATCH] fhandler_pipe: add sanity limit to handle loops

2021-12-26 Thread Ken Brown
On 12/26/2021 4:35 PM, Jeremy Drake wrote: On Sun, 26 Dec 2021, Ken Brown wrote: On 12/26/2021 11:04 AM, Ken Brown wrote: On 12/26/2021 10:09 AM, Ken Brown wrote: 1. For some processes, NtQueryInformationProcess(ProcessHandleInformation) can return STATUS_SUCCESS with invalid handle

Re: [PATCH] fhandler_pipe: add sanity limit to handle loops

2021-12-26 Thread Ken Brown
On 12/26/2021 11:04 AM, Ken Brown wrote: On 12/26/2021 10:09 AM, Ken Brown wrote: 1. For some processes, NtQueryInformationProcess(ProcessHandleInformation) can return STATUS_SUCCESS with invalid handle information.  See the comment starting at line 5754, where it is shown how to detect

Re: [PATCH] fhandler_pipe: add sanity limit to handle loops

2021-12-26 Thread Ken Brown
On 12/26/2021 10:09 AM, Ken Brown wrote: 1. For some processes, NtQueryInformationProcess(ProcessHandleInformation) can return STATUS_SUCCESS with invalid handle information.  See the comment starting at line 5754, where it is shown how to detect this. If I'm right, the following patch should

Re: [PATCH] fhandler_pipe: add sanity limit to handle loops

2021-12-26 Thread Ken Brown
On 12/25/2021 11:56 PM, Jeremy Drake wrote: I set up a windows server 2022 VM last night and went nuts stressing pacman/GPGME. I was able to reproduce the issue there: status = 0x, phi->NumberOfHandles = 8261392, n_handle = 256 [#--] 14% assertion

Re: [PATCH] fhandler_pipe: add sanity limit to handle loops

2021-12-25 Thread Ken Brown
On 12/25/2021 6:00 PM, Jeremy Drake via Cygwin-patches wrote: On Sat, 25 Dec 2021, Jeremy Drake via Cygwin-patches wrote: On Sun, 26 Dec 2021, Takashi Yano wrote: Could you please check the result of the following test case in that ARM64 platform? OK, on Windows 11 ARM64 (same machine

Re: [PATCH] fhandler_pipe: add sanity limit to handle loops

2021-12-25 Thread Ken Brown
On 12/25/2021 2:20 PM, Jeremy Drake via Cygwin-patches wrote: On Sun, 26 Dec 2021, Takashi Yano wrote: Could you please check the result of the following test case in that ARM64 platform? I will probably not be able to get to this until tomorrow at the earliest. But keep in mind the issue

Re: [PATCH] fhandler_pipe: add sanity limit to handle loops

2021-12-24 Thread Ken Brown
On 12/24/2021 2:42 PM, Jeremy Drake wrote: On Fri, 24 Dec 2021, Ken Brown wrote: I agree that it's hard to see how the line you quoted could cause an exception. But you were using an optimized build, so I'm not sure how reliable the line-number information is. Is it feasible to run your test

Re: [PATCH] fhandler_pipe: add sanity limit to handle loops

2021-12-24 Thread Ken Brown
On 12/23/2021 7:29 PM, Jeremy Drake via Cygwin-patches wrote: On Thu, 23 Dec 2021, Ken Brown wrote: - for (ULONG j = 0; j < phi->NumberOfHandles; j++) + for (ULONG j = 0; j < min(phi->NumberOfHandles, n_handle); j++) Reading the preceding code, I don't see how n_

Re: [PATCH] fhandler_pipe: add sanity limit to handle loops

2021-12-23 Thread Ken Brown
On 12/23/2021 6:10 PM, Jeremy Drake via Cygwin-patches wrote: diff --git a/winsup/cygwin/fhandler_pipe.cc b/winsup/cygwin/fhandler_pipe.cc index ba6b70f55..48713a38d 100644 --- a/winsup/cygwin/fhandler_pipe.cc +++ b/winsup/cygwin/fhandler_pipe.cc @@ -1239,7 +1239,7 @@

[PATCH] Cygwin: fhandler_fifo::raw_read: handle STATUS_PENDING

2021-11-23 Thread Ken Brown
Patch attached. Takashi, since you wrote the analogous patch for pipes, could you take a look? Thanks. KenFrom 4f47e64b11ed8d47c62fa89e9b971f44b7e9ab75 Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Tue, 23 Nov 2021 11:40:56 -0500 Subject: [PATCH] Cygwin: fhandler_fifo::raw_read: handle

[PATCH] Cygwin: fhandler_pipe::raw_read: fix handle leak

2021-11-23 Thread Ken Brown
Patch attached.From 6d34b62cb8e192071e193516c23419854c3b4127 Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Tue, 23 Nov 2021 10:13:43 -0500 Subject: [PATCH] Cygwin: fhandler_pipe::raw_read: fix handle leak Slightly rearrange the code to avoid returning without closing the event handle

Re: [PATCH] Cygwin: pipe: Suppress unnecessary set_pipe_non_blocking() call.

2021-11-17 Thread Ken Brown
On 11/17/2021 3:08 AM, Takashi Yano wrote: - Call set_pipe_non_blocking(false) only if the pipe will be really inherited to non-cygwin process. LGTM, but Corinna should probably take a quick look too, since I'm not very familiar with this part of the code. Ken

Re: [PATCH v3] Cygwin: pipe: Handle STATUS_PENDING even for nonblocking mode.

2021-11-16 Thread Ken Brown
On 11/16/2021 9:33 AM, Takashi Yano wrote: - NtReadFile() and NtWriteFile() seems to return STATUS_PENDING occasionally even in nonblocking mode. This patch adds handling for STATUS_PENDING in nonblocking mode. I haven't tested (I assume you have), but LGTM except for two typos below.

Re: [PATCH 0/2] Fix a bad case of absolute path handling

2021-11-11 Thread Ken Brown
On 11/11/2021 4:47 AM, Corinna Vinschen wrote: On Nov 10 17:22, Ken Brown wrote: I can't immediately think of anything. But is it really impossible to phase out DOS path support over a period of time? We could start with a HEADS-UP, asking for comments, then a deprecation announcement

Re: [PATCH 0/2] Fix a bad case of absolute path handling

2021-11-10 Thread Ken Brown
On 11/10/2021 3:32 PM, corinna-cyg...@cygwin.com wrote: From: Corinna Vinschen As I told Takashi in PM, I will try to more often send patches to the cygwin-patches ML before pushing them, so there's a chance to chime in. LGTM. This patch series is supposed to address the `rm -rf' problem

Re: [PATCH] Cygwin: Make native clipboard layout same for 32- and 64-bit

2021-10-23 Thread Ken Brown
On 10/23/2021 1:35 AM, Mark Geisert wrote: Corinna Vinschen wrote: Just to close this up prior to the 3.3.0 release... Given we never actually strived for 32<->64 bit interoperability, it's hard to argue why this should be different for the clipboard stuff. Running 32 and 64 bit Cygwin

Re: [PATCH] Cygwin: Make native clipboard layout same for 32- and 64-bit

2021-10-11 Thread Ken Brown
On 10/11/2021 2:13 AM, Mark Geisert wrote: It's just that after submitting the patch I realized that, if we really are going to support both Cygwin archs (x86_64 and i686), there is still the issue of different cygcb_t layouts between Cygwin versions being ignored. Specifically, the

Re: [PATCH] Cygwin: pty: Fix handle leak regarding attach_mutex.

2021-10-10 Thread Ken Brown
On 10/9/2021 8:49 PM, Takashi Yano wrote: - If the process having master pty opened is forked, attach_mutex fails to be closed when master is closed. This patch fixes the issue. --- winsup/cygwin/fhandler_console.cc | 2 +- winsup/cygwin/fhandler_tty.cc | 6 +++--- 2 files changed,

Re: [PATCH] Cygwin: Make native clipboard layout same for 32- and 64-bit

2021-10-09 Thread Ken Brown
provides it. This struct should maybe be in sys/cygwin.h or similar, if it's expected to be used in user-space as well. Good idea. On 09/10/2021 15:19, Ken Brown wrote: On 10/8/2021 5:52 AM, Takashi Yano wrote: How about simply just: diff --git a/winsup/cygwin/fhandler_clipboard.cc b/wins

Re: [PATCH] Cygwin: Make native clipboard layout same for 32- and 64-bit

2021-10-09 Thread Ken Brown
On 10/8/2021 5:52 AM, Takashi Yano wrote: How about simply just: diff --git a/winsup/cygwin/fhandler_clipboard.cc b/winsup/cygwin/fhandler_clipboard.cc index ccdb295f3..d822f4fc4 100644 --- a/winsup/cygwin/fhandler_clipboard.cc +++ b/winsup/cygwin/fhandler_clipboard.cc @@ -28,9 +28,10 @@

Re: [PATCH] Cygwin: pty: Fix master closing error regarding attach_mutex.

2021-10-08 Thread Ken Brown
On 10/8/2021 12:28 PM, Takashi Yano wrote: - If two or more pty masters are opened in a process, closing master causes error when closing attach_mutex. This patch fixes the issue. Addresses: https://cygwin.com/pipermail/cygwin-developers/2021-October/012418.html ---

[PATCH 2/2] Cygwin: getifaddrs: don't return a zero IPv4 address

2021-07-26 Thread Ken Brown
Patch attached. >From f869ec6f96e16f09be7098740bc21c0c39544fd4 Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Mon, 26 Jul 2021 10:27:53 -0400 Subject: [PATCH 2/2] Cygwin: getifaddrs: don't return a zero IPv4 address If an interface is disconnected, net.cc:get_ifs tries to fetch IPv4 addres

[PATCH 1/2] Cygwin: getifaddrs: fix address family for IPv6 netmasks

2021-07-26 Thread Ken Brown
Patch attached. >From 49ff12b47d9d71960fd7b39846b302b8031affa4 Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Mon, 26 Jul 2021 08:59:09 -0400 Subject: [PATCH 1/2] Cygwin: getifaddrs: fix address family for IPv6 netmasks The code in net.cc:get_ifs that sets the netmask omitted sett

[PATCH 0/2] Fix getifaddrs problems

2021-07-26 Thread Ken Brown
The two patches in this series fix the two problems reported in https://cygwin.com/pipermail/cygwin/2021-July/248970.html As I indicated in that message, I'm not 100% sure of the second patch. Ken Ken Brown (2): Cygwin: getifaddrs: fix address family for IPv6 netmasks Cygwin: getifaddrs

[PATCH] Cygwin: cfsetspeed: allow speed to be a numerical baud rate

2021-07-12 Thread Ken Brown
The attached patch addresses https://cygwin.com/pipermail/cygwin/2021-July/248887.html I don't really understand the GPL issue, but I hope it's OK. Ken >From 0321ecd99050ad702a528797af48ea4d01531508 Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Sun, 11 Jul 2021 07:04:58 -0400 Subj

[PATCH] Cygwin: fhandler_mqueue::mq_open: fix typo

2021-05-26 Thread Ken Brown
Patch attached. Sorry for using an attachment, but my smtp server just started using 2-factor authorization, and I haven't figured out how to make it work with git-send-email. Ken >From dfe5988f961ff97d283a9c460e75499db168163a Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Wed, 26 May 2

Re: [PATCH] Use automake (v5)

2021-04-27 Thread Ken Brown
On 4/27/2021 12:52 PM, Ken Brown wrote: On 4/27/2021 11:50 AM, Jon Turney wrote: On 20/04/2021 21:13, Jon Turney wrote: For ease of reviewing, this patch doesn't contain changes to generated files which would be made by running ./autogen.sh.   I pushed this patch. If you have an existing

Re: [PATCH] Use automake (v5)

2021-04-27 Thread Ken Brown
On 4/27/2021 11:50 AM, Jon Turney wrote: On 20/04/2021 21:13, Jon Turney wrote: For ease of reviewing, this patch doesn't contain changes to generated files which would be made by running ./autogen.sh.  I pushed this patch. If you have an existing build directory, while you might get away

Re: [PATCH] Cygwin: connect: implement resetting a connected DGRAM socket

2021-04-27 Thread Ken Brown
On 4/27/2021 9:19 AM, Corinna Vinschen wrote: On Apr 26 15:37, Ken Brown wrote: Following POSIX and Linux, allow a connected DGRAM socket's connection to be reset (so that the socket becomes unconnected). This is done by calling connect and specifing an address whose family is AF_UNSPEC

[PATCH] Cygwin: connect: implement resetting a connected DGRAM socket

2021-04-26 Thread Ken Brown
Following POSIX and Linux, allow a connected DGRAM socket's connection to be reset (so that the socket becomes unconnected). This is done by calling connect and specifing an address whose family is AF_UNSPEC. --- winsup/cygwin/fhandler_socket_inet.cc | 21 --

[PATCH] Cygwin: connect: set connect state for DGRAM sockets

2021-04-23 Thread Ken Brown
When connect is called on a DGRAM socket, the call to Winsock's connect can immediately return successfully rather than failing with WSAEWOULDBLOCK. Set the connect state to "connected" in this case. Previously the connect state remained "connect_pending" after the successful connection. ---

Re: [PATCH 1/2] Treat Windows Store's "app execution aliases" as symbolic links

2021-03-24 Thread Ken Brown
On 3/24/2021 2:55 PM, Hans-Bernhard Bröker wrote: Am 23.03.2021 um 10:30 schrieb Corinna Vinschen via Cygwin-patches: > On Mar 22 22:54, Hans-Bernhard Bröker wrote: >> Am 22.03.2021 um 16:22 schrieb Johannes Schindelin: >>> One of those under-documented reparse point types is the WSL symbolic

Re: [PATCH 0/2] Return appropriate handle by _get_osfhandle() and GetStdHandle().

2021-03-22 Thread Ken Brown via Cygwin-patches
[Still CC Marco] On 3/22/2021 7:43 AM, Corinna Vinschen via Cygwin-patches wrote: [CC Marco] On Mar 22 08:07, Takashi Yano via Cygwin-patches wrote: On Sun, 21 Mar 2021 17:44:27 +0900 Takashi Yano wrote: On Sun, 21 Mar 2021 13:01:24 +0900 Takashi Yano wrote: Takashi Yano (2): Cygwin:

Re: [PATCH] winsup/doc/dll.xml: update MinGW/.org to MinGW-w64/.org

2021-03-08 Thread Ken Brown via Cygwin-patches
On 3/8/2021 2:09 PM, Achim Gratz wrote: Brian Inglis writes: It's normally a merge conflict which will not be satisfied by regular commands to restore the working files to upstream. So you're pulling on an unclean work tree? That's a no-no, either keep your changes on a separate branch (that

[PATCH 7/7] Cygwin: simplify linkat with AT_EMPTY_PATH

2021-02-25 Thread Ken Brown via Cygwin-patches
linkat(olddirfd, oldpath, oldname, newdirfd, newname, AT_EMPTY_PATH) is supposed to create a link to the file referenced by olddirfd if oldname is the empty string. Currently this is done via the /proc filesystem by converting the call to linkat(AT_FDCWD, "/proc/self/fd/", newdirfd, newname,

[PATCH 6/7] Cygwin: fix linkat(2) on sockets that are not socket files

2021-02-25 Thread Ken Brown via Cygwin-patches
If linkat(2) is called with AT_EMPTY_PATH on an AF_LOCAL or AF_UNIX socket that is not a socket file, the current code calls fhandler_disk_file::link in most cases. The latter expects to be operating on a disk file and uses the socket's io_handle, which is not a file handle. Fix this by calling

[PATCH 5/7] Cygwin: fix facl on sockets that are not socket files

2021-02-25 Thread Ken Brown via Cygwin-patches
If facl(2) is called on an AF_LOCAL or AF_UNIX socket that is not a socket file, the current code calls fhandler_disk_file::facl in most cases. The latter expects to be operating on a disk file and uses the socket's io_handle, which is not a file handle. Fix this by calling

[PATCH 4/7] Cygwin: fix fchown on sockets that are not socket files

2021-02-25 Thread Ken Brown via Cygwin-patches
If fchown(2) is called on an AF_LOCAL or AF_UNIX socket that is not a socket file, the current code calls fhandler_disk_file::fchown in most cases. The latter expects to be operating on a disk file and uses the socket's io_handle, which is not a file handle. Fix this by calling

[PATCH 1/7] Cygwin: fix fstat on sockets that are not socket files

2021-02-25 Thread Ken Brown via Cygwin-patches
If fstat(2) is called on an AF_LOCAL or AF_UNIX socket that is not a socket file, the current code calls fstat_fs. The latter expects to be operating on a disk file and uses the socket's io_handle, which is not a file handle. Fix this by calling fstat_fs only if the fhandler_socket object is a

[PATCH 2/7] Cygwin: fix fstatvfs on sockets that are not socket files

2021-02-25 Thread Ken Brown via Cygwin-patches
If fstatvfs(2) is called on an AF_LOCAL or AF_UNIX socket that is not a socket file, the current code calls fhandler_disk_file::fstatvfs in most cases. The latter expects to be operating on a disk file and uses the socket's io_handle, which is not a file handle. Fix this by calling

[PATCH 3/7] Cygwin: fix fchmod on sockets that are not socket files

2021-02-25 Thread Ken Brown via Cygwin-patches
If fchmod(2) is called on an AF_LOCAL or AF_UNIX socket that is not a socket file, the current code calls fhandler_disk_file::fchmod in most cases. The latter expects to be operating on a disk file and uses the socket's io_handle, which is not a file handle. Fix this by calling

[PATCH 0/7] Fix some system calls on sockets

2021-02-25 Thread Ken Brown via Cygwin-patches
is associated with a socket file. If not, we call an fhandler_socket_wsock or fhandler_socket method instead of an fhandler_disk_file method. The last patch is just a code simplification that arose while I was working on fhandler_socket_local::link. Ken Brown (7): Cygwin: fix fstat on sockets

[PATCH 0/1] Fix facl on files opened with O_PATH

2021-02-23 Thread Ken Brown via Cygwin-patches
own here. Ken Brown (1): Cygwin: facl: fail with EBADF on files opened with O_PATH winsup/cygwin/sec_acl.cc | 5 + 1 file changed, 5 insertions(+) -- 2.30.0

[PATCH 1/1] Cygwin: facl: fail with EBADF on files opened with O_PATH

2021-02-23 Thread Ken Brown via Cygwin-patches
This is in the spirit of the Linux requirement that file operations like fchmod(2), fchown(2), and fgetxattr(2) fail with EBADF on files opened with O_PATH. --- winsup/cygwin/sec_acl.cc | 5 + 1 file changed, 5 insertions(+) diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc

[PATCH] Cygwin: AF_UNIX: allow opening with the O_PATH flag

2021-02-23 Thread Ken Brown via Cygwin-patches
This was done for the fhandler_socket_local class in commits 3a2191653a, 141437d374, and 477121317d, but the fhandler_socket_unix class was overlooked. --- winsup/cygwin/fhandler.h | 1 + winsup/cygwin/fhandler_socket_unix.cc | 24 2 files changed, 25

[PATCH 3/3] Cygwin: FIFO: temporarily keep a conv_handle in syscalls.cc:open

2021-02-18 Thread Ken Brown via Cygwin-patches
When a FIFO is opened, syscalls.cc:open always calls fstat on the newly-created fhandler_fifo. This results from a call to device_access_denied. To speed-up this fstat call, and therefore the open(2) call, use PC_KEEP_HANDLE when the fhandler is created. The resulting conv_handle is retained

[PATCH 2/3] Cygwin: fstat_helper: always use handle in call to get_file_attribute

2021-02-18 Thread Ken Brown via Cygwin-patches
Previously, the call to get_file_attribute for FIFOs set the first argument to NULL instead of the handle h returned by get_stat_handle, thereby forcing the file to be opened for fetching the security descriptor in get_file_sd(). This was done because h might have been a pipe handle rather than a

[PATCH 0/3] Fix fstat on FIFOs, part 2

2021-02-18 Thread Ken Brown via Cygwin-patches
The first patch fixes a bug, in which fstat on FIFOs sometimes used pipe handles instead of file handles. The second and third patches should improve the efficiency of fstat and open on FIFOs. Ken Brown (3): Cygwin: define fhandler_fifo::fstat Cygwin: fstat_helper: always use handle in call

[PATCH 1/3] Cygwin: define fhandler_fifo::fstat

2021-02-18 Thread Ken Brown via Cygwin-patches
Previously fstat on a FIFO would call fhandler_base::fstat. The latter is not appropriate if fhandler_fifo::open has already been called (and O_PATH is not set), for the following reason. If a FIFO has been opened as a writer or duplexer, then it has an io_handle that is a pipe handle rather

[PATCH 1/1] Revert "Cygwin: fstat_helper: always use handle in call to get_file_attribute"

2021-02-09 Thread Ken Brown via Cygwin-patches
This reverts commit 76dca77f049271e2529c25de8a396e65dbce615d. That commit was based on the incorrect assumption that get_stat_handle, when called on a FIFO in fstat_helper, would always return a handle that is safe to use for getting the file information. That assumption is true in many cases

[PATCH 0/1] Fix fstat on FIFOs, part 1

2021-02-09 Thread Ken Brown via Cygwin-patches
--> fhaccess --> fstat, and this is one of the cases where greater efficiency is possible. Ken Brown (1): Revert "Cygwin: fstat_helper: always use handle in call to get_file_attribute" winsup/cygwin/fhandler_disk_file.cc | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) -- 2.30.0

Re: [PATCH 0/1] Recognizing native Windows AF_UNIX sockets

2021-01-30 Thread Ken Brown via Cygwin-patches
On 1/30/2021 11:34 AM, Ken Brown via Cygwin-patches wrote: This patch attempts to fix the problem reported here: https://cygwin.com/pipermail/cygwin/2020-September/246362.html See also the followup here: https://cygwin.com/pipermail/cygwin/2021-January/247666.html The problem, briefly

[PATCH 1/1] Cygwin: recognize native Windows AF_UNIX sockets as reparse points

2021-01-30 Thread Ken Brown via Cygwin-patches
Allow check_reparse_point_target to recognize reparse points with reparse tag IO_REPARSE_TAG_AF_UNIX. These are used in recent versions of Windows 10 to represent AF_UNIX sockets. check_reparse_point_target now returns PATH_REP on files of this type, so that they are treated as known reparse

[PATCH 0/1] Recognizing native Windows AF_UNIX sockets

2021-01-30 Thread Ken Brown via Cygwin-patches
\n", clen); printf("strlen = %zd\n", strlen(addr.sun_path)); printf("name = %s\n", addr.sun_path); } } Ken Brown (1): Cygwin: recognize native Windows AF_UNIX sockets as reparse points winsup/cygwin/path.cc | 4 1 file changed, 4 insertions(+) -- 2.30.0

[PATCH 4/4] Cygwin: include/cygwin/limits.h: new header

2021-01-29 Thread Ken Brown via Cygwin-patches
The new header defines some Cygwin-specific limits, using private names. It is included by include/limits.h. For example, we now have #define __OPEN_MAX 3200 in include/cygwin/limits.h and #define OPEN_MAX __OPEN_MAX in include/limits.h. The purpose is to hide implementation details

[PATCH 3/4] Cygwin: remove the OPEN_MAX_MAX macro

2021-01-29 Thread Ken Brown via Cygwin-patches
Replace all occurrences of OPEN_MAX_MAX by OPEN_MAX, and define the latter to be 3200, which was the value of the former. In view of the recent change to getdtablesize, there is no longer a need to distinguish between these two macros. --- winsup/cygwin/dtable.cc| 8

[PATCH 2/4] Cygwin: sysconf, getrlimit: don't call getdtablesize

2021-01-29 Thread Ken Brown via Cygwin-patches
Now that getdtablesize always returns OPEN_MAX_MAX, we can simplify sysconf(_SC_OPEN_MAX) and getrlimit(RLIMIT_NOFILE) to just use that same constant instead of calling getdtablesize. --- winsup/cygwin/resource.cc | 5 + winsup/cygwin/sysconf.cc | 11 +-- 2 files changed, 2

[PATCH 0/4] getdtablesize, OPEN_MAX, etc.

2021-01-29 Thread Ken Brown via Cygwin-patches
a first attempt to implement the suggestion of adding a new header. At this writing I'm not completely sure that I fully understand the purpose of that. My choice of which macros to define in it might need to be changed. Ken Brown (4): Cygwin: getdtablesize: always return OPEN_MAX_MAX Cygwin

[PATCH 1/4] Cygwin: getdtablesize: always return OPEN_MAX_MAX

2021-01-29 Thread Ken Brown via Cygwin-patches
According to the Linux man page for getdtablesize(3), the latter is supposed to return "the maximum number of files a process can have open, one more than the largest possible value for a file descriptor." The constant OPEN_MAX_MAX is the only limit enforced by Cygwin, so we now return that.

Re: [PATCH] Cygwin: getdtablesize: always return OPEN_MAX_MAX

2021-01-29 Thread Ken Brown via Cygwin-patches
On 1/28/2021 5:28 PM, Ken Brown via Cygwin-patches wrote: On 1/28/2021 11:13 AM, Corinna Vinschen via Cygwin-patches wrote: On Jan 28 17:07, Corinna Vinschen via Cygwin-patches wrote: On Jan 28 08:42, Ken Brown via Cygwin-patches wrote: On 1/28/2021 5:20 AM, Corinna Vinschen via Cygwin

Re: [PATCH] Cygwin: getdtablesize: always return OPEN_MAX_MAX

2021-01-28 Thread Ken Brown via Cygwin-patches
On 1/28/2021 11:13 AM, Corinna Vinschen via Cygwin-patches wrote: On Jan 28 17:07, Corinna Vinschen via Cygwin-patches wrote: On Jan 28 08:42, Ken Brown via Cygwin-patches wrote: On 1/28/2021 5:20 AM, Corinna Vinschen via Cygwin-patches wrote: On Jan 27 21:51, Ken Brown via Cygwin-patches

Re: [PATCH] Cygwin: getdtablesize: always return OPEN_MAX_MAX

2021-01-28 Thread Ken Brown via Cygwin-patches
On 1/28/2021 11:07 AM, Corinna Vinschen via Cygwin-patches wrote: On Jan 28 08:42, Ken Brown via Cygwin-patches wrote: On 1/28/2021 5:20 AM, Corinna Vinschen via Cygwin-patches wrote: On Jan 27 21:51, Ken Brown via Cygwin-patches wrote: According to the Linux man page for getdtablesize(3

Re: [PATCH] Cygwin: getdtablesize: always return OPEN_MAX_MAX

2021-01-28 Thread Ken Brown via Cygwin-patches
On 1/28/2021 5:20 AM, Corinna Vinschen via Cygwin-patches wrote: On Jan 27 21:51, Ken Brown via Cygwin-patches wrote: According to the Linux man page for getdtablesize(3), the latter is supposed to return "the maximum number of files a process can have open, one more than the largest pos

[PATCH] Cygwin: getdtablesize: always return OPEN_MAX_MAX

2021-01-27 Thread Ken Brown via Cygwin-patches
According to the Linux man page for getdtablesize(3), the latter is supposed to return "the maximum number of files a process can have open, one more than the largest possible value for a file descriptor." The constant OPEN_MAX_MAX is the only limit enforced by Cygwin, so we now return that.

[PATCH v2] Cygwin: fchmodat: add limited support for AT_SYMLINK_NOFOLLOW

2021-01-27 Thread Ken Brown via Cygwin-patches
Allow fchmodat with the AT_SYMLINK_NOFOLLOW flag to succeed on non-symlinks. Previously it always failed, as it does on Linux. But POSIX permits it to succeed on non-symlinks even if it fails on symlinks. The reason for following POSIX rather than Linux is to make gnulib report that fchmodat

  1   2   3   4   5   >