public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fts.3: note fts_open() behaviour with empty strings
@ 2023-04-11  2:21 наб
  2023-04-11 14:22 ` Alejandro Colomar
  0 siblings, 1 reply; 4+ messages in thread
From: наб @ 2023-04-11  2:21 UTC (permalink / raw)
  To: Alejandro Colomar (man-pages); +Cc: linux-man

[-- Attachment #1: Type: text/plain, Size: 809 bytes --]

This is undocumented in BSD, too, and present in the original SCCS
check-in (5.1 (Berkeley) 12/30/89).

This is very surprising, since in most other cases FTS is rather quite
sane about error reporting, but /any/ empty string in the input vector
blows out the creation entirely.

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
---
 man3/fts.3 | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/man3/fts.3 b/man3/fts.3
index 66b2fcab3..392f8acfe 100644
--- a/man3/fts.3
+++ b/man3/fts.3
@@ -722,6 +722,14 @@ for any of the errors specified for
 and
 .BR malloc (3).
 .PP
+It will also fail and set
+.I errno
+to
+.B ENOENT
+if any element of
+.I path_argv
+is an empty string.
+.PP
 The function
 .BR fts_close ()
 may fail and set
-- 
2.30.2

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] fts.3: note fts_open() behaviour with empty strings
  2023-04-11  2:21 [PATCH] fts.3: note fts_open() behaviour with empty strings наб
@ 2023-04-11 14:22 ` Alejandro Colomar
  2023-04-11 14:36   ` наб
  0 siblings, 1 reply; 4+ messages in thread
From: Alejandro Colomar @ 2023-04-11 14:22 UTC (permalink / raw)
  To: наб; +Cc: linux-man


[-- Attachment #1.1: Type: text/plain, Size: 1500 bytes --]

Hi!

On 4/11/23 04:21, наб wrote:
> This is undocumented in BSD, too, and present in the original SCCS
> check-in (5.1 (Berkeley) 12/30/89).
> 
> This is very surprising, since in most other cases FTS is rather quite
> sane about error reporting, but /any/ empty string in the input vector
> blows out the creation entirely.
> 
> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>

Applied, with some editorialization:


@@ -722,6 +722,17 @@ .SH ERRORS
 and
 .BR malloc (3).
 .PP
+In addition,
+.BR fts_open ()
+may fail and set
+.I errno
+as follows:
+.TP
+.B ENOENT
+Any element of
+.I path_argv
+was an empty string.
+.PP
 The function
 .BR fts_close ()
 may fail and set


Btw, while you're at it, could you confirm if the nullability (_Nullable)
of the documented funtion prototypes is correct?  I never used those
functions.

Cheers,
Alex

> ---
>  man3/fts.3 | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/man3/fts.3 b/man3/fts.3
> index 66b2fcab3..392f8acfe 100644
> --- a/man3/fts.3
> +++ b/man3/fts.3
> @@ -722,6 +722,14 @@ for any of the errors specified for
>  and
>  .BR malloc (3).
>  .PP
> +It will also fail and set
> +.I errno
> +to
> +.B ENOENT
> +if any element of
> +.I path_argv
> +is an empty string.
> +.PP
>  The function
>  .BR fts_close ()
>  may fail and set

-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fts.3: note fts_open() behaviour with empty strings
  2023-04-11 14:22 ` Alejandro Colomar
@ 2023-04-11 14:36   ` наб
  2023-04-11 14:56     ` Alejandro Colomar
  0 siblings, 1 reply; 4+ messages in thread
From: наб @ 2023-04-11 14:36 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: linux-man

[-- Attachment #1: Type: text/plain, Size: 407 bytes --]

Hi!

On Tue, Apr 11, 2023 at 04:22:09PM +0200, Alejandro Colomar wrote:
> Btw, while you're at it, could you confirm if the nullability (_Nullable)
> of the documented funtion prototypes is correct?  I never used those
> functions.
The only valid null pointer is compar in fts_open(),
which appears to already be documented in running text;
all others must point to valid objects.

Best,
наб

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fts.3: note fts_open() behaviour with empty strings
  2023-04-11 14:36   ` наб
@ 2023-04-11 14:56     ` Alejandro Colomar
  0 siblings, 0 replies; 4+ messages in thread
From: Alejandro Colomar @ 2023-04-11 14:56 UTC (permalink / raw)
  To: наб; +Cc: linux-man


[-- Attachment #1.1: Type: text/plain, Size: 604 bytes --]

On 4/11/23 16:36, наб wrote:
> Hi!
> 
> On Tue, Apr 11, 2023 at 04:22:09PM +0200, Alejandro Colomar wrote:
>> Btw, while you're at it, could you confirm if the nullability (_Nullable)
>> of the documented funtion prototypes is correct?  I never used those
>> functions.
> The only valid null pointer is compar in fts_open(),
> which appears to already be documented in running text;
> all others must point to valid objects.

Thanks; fixed.

Cheers,
Alex

> 
> Best,
> наб

-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-04-11 14:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-11  2:21 [PATCH] fts.3: note fts_open() behaviour with empty strings наб
2023-04-11 14:22 ` Alejandro Colomar
2023-04-11 14:36   ` наб
2023-04-11 14:56     ` Alejandro Colomar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox