[arch-dev-public] [PATCH] makechrootpkg: Use the host's SRCDEST and PKGDEST if they are defined

Aaron Griffin aaronmgriffin at gmail.com
Thu Nov 5 12:10:59 EST 2009

On Thu, Nov 5, 2009 at 11:07 AM, Daenyth Blank <daenyth+arch at gmail.com> wrote:
> On Thu, Nov 5, 2009 at 13:03, Aaron Griffin <aaronmgriffin at gmail.com> wrote:
>> I was thinking more along the lines of:
>> Original: eval $(grep '^SRCDEST=' /etc/makepkg.conf)
>> SRCDEST=$(grep '^SRCDEST=' /etc/makepkg.conf | cut -d= -f2)
>> PKGDEST=$(grep '^PKGDEST=' /etc/makepkg.conf | cut -d= -f2)
> I believe that should work... Make sure to throw in a -d -w check
> after, to make sure it's right... I think a malicious line (".. && rm
> -rf /") would simply get stored as a string.. as long as we quote
> everything properly and unset it if it's not right, I'm pretty sure
> it's not dangerous. It could however, fail in cases where it's split
> over multiple lines. I don't think that's a reason not to do it
> though, I can't imagine a reason for such a thing.

Splitting over multiple lines in bash is going to result in a string
with embedded \n's in it, which makes an awfully shitty directory

$ mkdir "foo
> bar"
$ ls
$ rmdir 'foo^Jbar'/

More information about the arch-dev-public mailing list