Re: git-version-gen doc: writing to intermediate file

2025-01-12 Thread Bruno Haible via Gnulib discussion list
Basil L. Contovounesios wrote: > Should 'make dist' also fail when $(srcdir)/.git does not exist Definitely not. It would prevent "make dist" from succeeding when run from an unpacked tarball. Bruno

[PATCH] fix consistency issues in set_program_name()

2025-01-12 Thread Pádraig Brady
I noticed a discrepancy in the program name output by error(), which looks to be due to whether the gnulib or glibc version is used. If we use gnulib's error() it uses getprogname() which defaults to program_invocation_short_name. The glibc error() instead uses program_invocation_name. I don't kn

Re: git-version-gen doc: writing to intermediate file

2025-01-12 Thread Basil L. Contovounesios
Bruno Haible [2025-01-10 12:58 +0100] wrote: > Basil L. Contovounesios wrote: >> Does this imply that writing to a temporary file first is never needed >> under distdir? > > No. It's never needed under $(distdir) *if* the Makefile rule fails when the > command fails. [...] > What is desired, is th

[PATCH] opendir, readdir, rewinddir: Fix issues on native Windows

2025-01-12 Thread Lasse Collin
(1) With legacy code pages (not UTF-8), certain non-ASCII Unicode characters in file names are converted in a lossy way ("best-fit mapping"). For example, if active code page is Windows-1252 and there is a file name with U+2044 in it, it becomes ASCII '/'. Thus, malicious file names

Re: [PATCH] fix consistency issues in set_program_name()

2025-01-12 Thread Bruno Haible via Gnulib discussion list
Hi Pádraig, > I noticed a discrepancy in the program name output by error(), > which looks to be due to whether the gnulib or glibc version is used. > If we use gnulib's error() it uses getprogname() > which defaults to program_invocation_short_name. > The glibc error() instead uses program_invoca

Re: [PATCH] opendir, readdir, rewinddir: Fix issues on native Windows

2025-01-12 Thread Bruno Haible via Gnulib discussion list
Hi Lasse, Thanks for the explanations and patch. As I understand it, the patch modifies the conversion wchar_t[] (UTF-16) --> char[] used for file names, and it does so only for opendir+readdir. (And the pages that you refer to - "Filename smuggling" - explain why this is desirable because it

Re: [PATCH] fix consistency issues in set_program_name()

2025-01-12 Thread Pádraig Brady
On 12/01/2025 18:40, Bruno Haible wrote: Hi Pádraig, I noticed a discrepancy in the program name output by error(), which looks to be due to whether the gnulib or glibc version is used. If we use gnulib's error() it uses getprogname() which defaults to program_invocation_short_name. The glibc e

Re: [PATCH] opendir, readdir, rewinddir: Fix issues on native Windows

2025-01-12 Thread Lasse Collin
On 2025-01-12 Bruno Haible wrote: > As I understand it, the patch modifies the conversion > wchar_t[] (UTF-16) --> char[] > used for file names, and it does so only for opendir+readdir. The way I see it, the patch adds error detection to the conversion. Names that pass the check are returned j

Re: [PATCH] fix consistency issues in set_program_name()

2025-01-12 Thread Bruno Haible via Gnulib discussion list
Pádraig Brady wrote: > Updated version attached. This patch looks good. Bruno

Re: _gl_unregister_fd not declared in certain occasions

2025-01-12 Thread Daiki Ueno
Hello Bruno, Thank you for the response and sorry for the late reply. Bruno Haible writes: >> When trying to update Gnulib submodule in GnuTLS, I came across this error: >> >> close.c: In function 'rpl_close': >> close.c:71:5: error: implicit declaration of function '_gl_unregister_fd' >>

crc: Respect Automake's silent-rules.

2025-01-12 Thread Collin Funk
In Coreutils, which uses --enable-silent-rules by default, I see: $ make GEN .version GEN lib/alloca.h GEN lib/arpa/inet.h GEN lib/configmake.h if test -n 'gcc'; then \ /usr/bin/mkdir -p 'lib/crc-tmp' \ && abs_srcdir=`cd ./lib/. && pw

Re: [PATCH] opendir, readdir, rewinddir: Fix issues on native Windows

2025-01-12 Thread Paul Eggert
On 2025-01-12 12:26, Lasse Collin wrote: The patch makes readdir() detect that lossless conversion isn't possible and inform the application with EOVERFLOW Wouldn't EILSEQ be more appropriate? That's what "open" is supposed to do with names that the file system doesn't support. Also, the POS