Re: [hackers] [sbase] [PATCH 1/2] [libutil/recurse] only opendir if recursing

From: Michael Forney <mforney_AT_mforney.org>
Date: Sun, 1 Oct 2017 12:06:56 -0700

On 2017-10-01, David Phillips <david_AT_sighup.nz> wrote:
> Previous behaviour was to call opendir regardless of if we are actually
> going
> to be recursing into the directory. Additionally, some utilities that use
> DIRFIRST benefit from running the function pointed to by fn before the call
> to opendir. One such example is `chmod [-R] 777 dir` on a directory with
> mode
> 000, where it will be expected for chmod to first give itself rwx before
> optionally listing the directory to traverse it.

Thanks for the updated patch. Applied with a small tweak moving
closedir inside the if statement as well (otherwise we may try to
close an uninitialized `dp`).
Received on Sun Oct 01 2017 - 21:06:56 CEST

This archive was generated by hypermail 2.3.0 : Sun Oct 01 2017 - 21:12:36 CEST