[ resending with a Cc to the mailing list ]

On Tue, May 12, 2026 at 09:17:08AM -0700, Paul Eggert wrote:
> On 2026-05-12 08:19, Pavel Cahyna wrote:
> > Resending the previous message with attached patch and an explanation of
> > the approach.
> That old patch no longer applies due to intervening changes, so I did the
> minimal changes to make it apply, and to reindent and came up with the
> attached. I plan to look into this more carefully soon, with your comments
> in mind.

Thank you! I am afraid that the change to make_directories in extract.c:

> +static bool one_top_level_prepare = false;
> +
>  struct string_list
>    {
>      struct string_list *next;
> @@ -815,9 +817,10 @@ make_directories (char *file_name, bool *interdir_made)
>         /* Create a struct delayed_set_stat even if
>            mode == desired_mode, because
>            repair_delayed_set_stat may need to update the struct.  */
> -       delay_set_stat (file_name,
> -                       NULL, mode & ~ current_umask, MODE_RWX,
> -                       desired_mode, AT_SYMLINK_NOFOLLOW);
> +       if (! one_top_level_prepare)
> +         delay_set_stat (file_name,
> +                         NULL, mode & ~ current_umask, MODE_RWX,
> +                         desired_mode, AT_SYMLINK_NOFOLLOW);
>         if (interdir_made)

(that was the second patch when I sent the two patches separately) is
really ugly and was intended only as a proof of concept, to avoid
calling delay_set_stat for the intermediate directories that we create
as the result of --one-top-level. Otherwise, the extraction of a tarball
containing "." was causing errors. In general, as I mentioned in the
patch description, I was not sure whether to call
repair_delayed_set_stat and/or delay_set_stat on the newly created
directories like extract_dir() does (the whole delay_set code is still a
bit mysterious to me). Could you please have a closer look?

Other than that, if you think that this approach is viable, I suppose I
should work on the remaining issue, which is:
"The patch does not yet handle the --show-transformed case with
--one-top-level that you discussed in another subthread. As a result, two
tests now fail (onetop02.at and onetop04.at)."

Do you agree?

Best regards, Pavel


Reply via email to