Re: [hackers] [sbase][PATCH] ls: abort a directory if we cannot opendir it

From: Quentin Rameau <quinq_AT_fifth.space>
Date: Tue, 22 Aug 2017 11:21:34 +0200

> Sorry, I should have made the commit message clearer. It is
> not the entire operation that is being aborted, but only the
> current node, if it cannot be opened.

Ah, right!

> Before this patch, ls will segfault since it tries to perform
> operations on a (null) DIR*. After this patch, it prints the
> message, sets the return code and doesn't segfault.
>
> I found this bug while playing with the -R flag (though it is not
> isolated to this flag), and I have confirmed that behaviour is
> correct as you describe. It will do the regular recursive listing
> for all the heirarchy, and in amongst its output is the
>
> ls: opendir ./foodir: Permission denied
>
> output.
>
> Apologies again if my commit message was a bit ambiguous on what
> exactly was being aborted.

No problem, I should have put the patch code in context too.
Looks good to me, thanks!
Received on Tue Aug 22 2017 - 11:21:34 CEST

This archive was generated by hypermail 2.3.0 : Tue Aug 22 2017 - 11:24:22 CEST