unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Arun Isaac <arunisaac@systemreboot.net>
Cc: guix-devel@gnu.org
Subject: Re: zipbomb handling should not be done in url-fetch/zipbomb
Date: Sat, 17 Jun 2017 22:13:33 +0200	[thread overview]
Message-ID: <878tkqbceq.fsf@gnu.org> (raw)
In-Reply-To: <9f5ff0ec.AEAALfWcKw0AAAAAAAAAAAOtZhgAAAACwQwAAAAAAAW9WABZQ6jZ@mailjet.com> (Arun Isaac's message of "Fri, 16 Jun 2017 15:15:54 +0530")

Arun Isaac <arunisaac@systemreboot.net> skribis:

> * Proposal
>
> zip bomb (zip archives without a top level directory) handling should
> not be done in `url-fetch/zipbomb'. It should be implemented as a
> boolean argument to the `unpack' phase.

I guess the Boolean argument would determine whether to do (chdir
(first-subdirectory ".")), right?

Unfortunately that’s not enough for the cases where an origin has
patches or a snippet, because that code also assumes there’s only one
subdirectory (see ‘patch-and-repack’ in (guix packages)).

Perhaps the right fix would be to fix ‘patch-and-repack’ somehow.

> * Rationale
>
> I'm changing the download method of a few packages to url-fetch/zipbomb,
> and the source gets downloaded again. This should not happen. It is the
> same source archive after all. Why download another copy? In my
> particular case, these source archives happen to be quite big (around
> 500 MB) as well.

The only reason it triggers a redownload is because the name is
different (specifically, ‘url-fetch/zipbomb’ prepends “zipbomb-” to the
name.)

To avoid the redownload you could do “guix download file://…” with the
right file name.

> The download method in source/origin/method should only be involved in
> downloading. It should not handle how the downloaded source archive is
> unpacked. That is the job of the `unpack' phase. url-fetch/zipbomb
> unnecessarily duplicates the "unzip" command invocation.

I admit it was a bit of a hack :-), but fixing the ‘unpack’ phase won’t
be enough.

Thanks,
Ludo’.

  reply	other threads:[~2017-06-17 20:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-16  9:45 zipbomb handling should not be done in url-fetch/zipbomb Arun Isaac
2017-06-17 20:13 ` Ludovic Courtès [this message]
2017-06-18 22:21   ` Eric Bavier
2017-06-20 18:49   ` Arun Isaac
2017-06-21 10:45     ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878tkqbceq.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=arunisaac@systemreboot.net \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).