AUR web interface

Tasklist

FS#2280 - Too picky about lines in PKGBUILD

Attached to Project: AUR web interface
Opened by Simo Leone (neotuli) - Friday, 25 February 2005, 00:35 GMT
Last edited by Paul Mattal (paul) - Monday, 07 March 2005, 04:12 GMT
Task Type Bug Report
Category Backend
Status Closed
Assigned To No-one
Architecture All
Severity Medium
Priority Normal
Reported Version 1.0
Due in Version 2.0.0
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

The system rejects PKGBUILDs that have the md5sums variable AFTER build(), claiming it doesn't exist. This is problematic in some ways because many people like to do makepkg -g >>PKGBUILD , which plops it at the very end.
This task depends upon

Closed by  Eric Johnson (eric)
Sunday, 20 March 2005, 18:46 GMT
Reason for closing:  Fixed
Comment by Paul Mattal (paul) - Monday, 07 March 2005, 04:09 GMT
The problem here is that there's a delicate balance to be struck between safety and parsing in PKGBUILD files for arbitrary uploads from arbitrary unknown persons. Right now, the parser is overly strict.

Ideally, we could pass things off directly to bash to parse, but that would be horribly insecure. There may be some other options:

http://archlinux.spider007.net/PHPacman/

and

http://search.cpan.org/~saper/Shell-Parser-0.02/lib/Shell/Parser.pm

I'm going to set this for v2.0 because it's likely to be a lot of work to fix this properly. We might be able to special case the md5sums because of makepkg -g>>PKGBUILD.
Comment by Simo Leone (neotuli) - Thursday, 10 March 2005, 03:23 GMT
Ok I took a peek at the parser code, and found a workaround (actually, if you take a good look at the parser code, you'll realize that an arbitrary upload can be VERY easily disguised, whether or not the data payload of the upload is encoded in the PKGBUILD or as a seperate file).

For now, those that like to use makepkg -g >> PKGBUILD can continue to do so, so long as they add "md5sums=()" somewhere before their build() function. This works because the later md5sums overwrites the empty one, but the empty one is enough to fool the [fairly dumb] parser.

Actually, looking at the parser...it's uhm...rudimentary, I'm going to research possible better ways to do this, and I suggest we find a way to secure it, this is a hole, and a big one at that.
Comment by Eric Johnson (eric) - Sunday, 20 March 2005, 18:46 GMT
Fixed. Parsing doesn't halt after detecting the build() function. However, anyone can continue to research a better parser.

Loading...