Commit graph

133 commits

Author SHA1 Message Date
Lukas Fleischer
8b4b2d207e Remove File_Find PEAR module from code base.
We removed the code depending on this a long time ago - drop it and add
some note to "UPGRADING".

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-05 11:31:12 +02:00
Dan McGee
7c91c59245 Remove Dummy Package concept
Instead, we just store dependencies directly in the PackageDepends
table. Since we don't use this info anywhere besides the package details
page, there is little value in precalculating what is in the AUR vs.
what is not.

An upgrade path is provided via several SQL statements in the UPGRADING
document. There should be no user-visible change from this, but the DB
schema gets a bit more sane and we no longer have loads of junk packages
in our tables that are never shown to the end user. This should also
help the MySQL query planner in several cases as we no longer have to be
careful to exclude dummy packages on every query.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-03 22:59:32 +02:00
Dan McGee
1f252eba64 Always set ModifiedTS including new packages
Set it equal to the SubmittedTS field, which will be our indication the
package is new when we show the logo on the front page of the AUR.

This results in the ability to remove the use of the unindexable
GREATEST() function from the AUR code everywhere we had to use it before
to handle the 0 timestamp case.

Note that there is no race condition here in calling UNIX_TIMESTAMP()
twice- it always returns the time at the beginning of statment
execution:

    mysql> select unix_timestamp(), sleep(2), unix_timestamp();
    +------------------+----------+------------------+
    | unix_timestamp() | sleep(2) | unix_timestamp() |
    +------------------+----------+------------------+
    |       1300851746 |        0 |       1300851746 |
    +------------------+----------+------------------+
    1 row in set (2.00 sec)

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-03 22:59:31 +02:00
Dan McGee
1128489bd0 Submission process code refactor
We had a ton of duplicate code shared between the insert and update
cases. Do a refactor so we can pull this stuff out below the if/else
block and only need it there once, saving some headaches.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-03 22:59:31 +02:00
Lukas Fleischer
a427bd72a7 Be more restrictive with source tarball contents.
Reject tarballs containing more than one directory or files outside a
directory.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-30 20:49:21 +02:00
Lukas Fleischer
746c2b72b5 Fix PHP notice when submitting an empty file.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-30 16:16:27 +02:00
Lukas Fleischer
e4130fcca6 Fix strict standards warnings in "web/html/pkgsubmit.php".
end() expects a reference but we pass a function return value here.
Using list() is a bit hacky as well as it expects a 0-based array
whereas unpack() returns a 1-based array - thus we use "list(, $foo)".

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-30 12:28:17 +02:00
Lukas Fleischer
47faf88f14 Check if submitted files are in GZIP format.
This is quite hacky but this way we can ensure users get comprehensible
error messages when trying to upload ".tar.xz" or ".tar.bz2" files.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-30 11:55:32 +02:00
Lukas Fleischer
1e3fa38de5 Define "Packages.SubmitterUID" and "Packages.MaintainerUID" as "NULL".
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-27 19:46:19 +01:00
Lukas Fleischer
2e1ce869ec Reject blacklisted packages on initial submission only.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-25 11:18:02 +01:00
Lukas Fleischer
09d8128f99 Protect users against ZIP bombs (fixes FS#22991).
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-23 11:17:27 +01:00
Lukas Fleischer
4b2b8afb8a Reject packages with subdirectories (fixes FS#22995).
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-21 19:19:53 +01:00
Lukas Fleischer
31b0b68b47 Automatically adopt when updating an orphan package (fixes FS#22992).
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-21 17:56:19 +01:00
Lukas Fleischer
bc207d25cd Use move_uploaded_file() instead of rename() in "pkgsubmit.php".
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-21 17:07:51 +01:00
Lukas Fleischer
b69f548065 Add a package name blacklist.
Can be used to blacklist package names for normal users. TUs and
developers are not affected. This is especially useful if used together
with a cron job that updates the blacklist periodically, e.g. to reject
packages which are available in the binary repos (FS#12902).

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-11 14:43:22 +01:00
Lukas Fleischer
e3bde91f6d Minor variable parser bug fix (cf. commits 492c8c66, 7a58e99e).
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-02 17:18:27 +01:00
Lukas Fleischer
8e32767c70 Parse versioned deps correctly when using "<" or ">" (fixes FS#22679).
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-02 17:05:58 +01:00
Lukas Fleischer
366ea03118 Remove "FSPath" column from "Packages" table.
This field is not used anymore, so drop it from the table and remove all
references.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-01 15:01:56 +01:00
Lukas Fleischer
7a58e99eab Improve PKGBUILD variable parser correctness (cf. commit 492c8c66).
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-01 12:41:15 +01:00
Dan McGee
7f5af61c88 Drop PackageLocations table and references
We don't need this anymore since all packages managed here are
well...managed here. Rip out all of the places we were using this field,
many of which depended on the magic value '2' anyway.

On the display side of things, we had a column that was always showing
'unsupported' that is now gone, and you can no longer sort by this column.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-01 12:41:08 +01:00
Lukas Fleischer
492c8c668f Avoid infinite loop in PKGBUILD variable parser (fixes FS#19482).
Improves variable substitution in the PKGBUILD parser a bit to avoid
infinite replacement loops when a PKGBUILD contains assigments of the
form "foo=${foo[@]}bar".

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-01-28 17:40:02 +01:00
Lukas Fleischer
389d3a552e Replaced rm_rf() by rm_tree().
Implemented recursive directory deletion in PHP properly without the use
of exec(). This improves security, performance and portability and makes
the code compatible with PHP's Safe Mode as well as with PHP setups that
disable exec() using the "disable_functions" directive.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-01-25 10:45:52 +01:00
Lukas Fleischer
556de318ae Build URLs from package names (fixes FS#15308, FS#19327).
Drop the "URLPath" field from the "Packages" table, build URLs from
package names instead.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-01-24 18:08:29 +01:00
Lukas Fleischer
ec0dfc27de Removed code for tarball extraction.
Automatic tarball extraction was vulnerable in different ways. Users
should also only use source tarballs to build packages, so this has been
removed completely. From now on, only the PKGBUILD is extracted in a
secure manner.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-01-19 23:18:09 +01:00
Lukas Fleischer
eda713032c Add timestamp when a package is flagged out-of-date (FS#20848).
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
- resolve conflict and omit i18n changes.
2010-11-10 14:50:35 -05:00
Andrea Scarpino
f08fbbe80e pkgsubmit: Remove build function check
Closes: http://bugs.archlinux.org/task/19914

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2010-06-23 19:17:23 -04:00
mickael9
3f47ee740d pkgsubmit: store the previous path with getcwd()
This solves the problem of include files not being found after an error.
$_SERVER['DOCUMENT_ROOT'] is not reliable because the AUR might be
installed in a subdirectory.

This closes http://bugs.archlinux.org/task/16887

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2010-06-05 00:56:33 -04:00
Loui Chang
143ed617c2 pkgsubmit.php: Remove redundant error message.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-11-24 00:55:03 -05:00
Loui Chang
1bc4836e19 Restyle the layout.
Make HTML markup more logical.
Remove some unused style sheets rules.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-11-23 23:24:56 -05:00
Loui Chang
6ee8b88c58 pkgsubmit: Instruct users how to make source packages.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-11-09 18:53:34 -05:00
Loui Chang
de7c9ab787 Remove the plain PKGBUILD upload feature.
makepkg --source should be used to upload packages.
It provides a bit of error checking and it's good to support only a
single format here.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-09-28 19:24:19 -04:00
Dan McGee
46f2798524 Use include_once where applicable
All of these are sourcing function libraries so we don't need to include
them more than once. Things that insert actual HTML into the output were
left calling include().

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-08-11 13:58:12 -04:00
Loui Chang
610733eafd Remove excess whitespace.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-06-25 00:05:44 -04:00
Callan Barrett
d25c177229 Turn on package notification by default for new packages
Version using package functions

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-06-18 02:05:02 -04:00
Gergely Imreh
0427eebaa4 fix FS#13122 (again): removing comment removal as early as possible
comments need to be removed before concatenating lines, otherwise
not matched brackets can cause problems on submit

Signed-off-by: Gergely Imreh <imrehg@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-06-18 01:54:44 -04:00
Loui Chang
74a75661d9 Tweak the bash parsing for package submission.
Better detection of the build function.
Better detection of variables.
Support for variables with underscores.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-04-01 11:55:59 -04:00
Gergely Imreh
f3a29356c5 Correct comment removal in pkgsubmit.php
This only neutralises bash parameter substitution, but doesn't perform
the proper replacement.

Closes FS#13122.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-02-16 11:56:23 -05:00
Gergely Imreh
efc1713787 Fix: FS#13189, infinite variable replacement cycle
Lines such as foo=$foo in the PKGBUILD would end up in a
infinite replacement cycle when uploaded, thus the upload
times out. In these kind of lines, $foo is replaced not by
"$foo" again, but deleted (missing value for foo).

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-02-15 15:12:28 -05:00
Gergely Imreh
2568851eac FS#2649, FS#12645: subsititution of all variables and "eval"
All custom variables are handled during subsitution, as well as
bash "eval" statements.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-01-28 03:26:23 -05:00
Loui Chang
2ee3276348 Use new conglomerated translation files.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-01-19 16:29:45 -05:00
Gergely Imreh
5b01327f57 Fix: FS#12698 - AUR does not ignore comment lines in PKGBUILD source field.
The web interface was handling comments in the PKGBUILD variable fields
(such as 'source','depends',etc...) differently from makepkg, because
makepkg ignores the rest of the current line if there is a # character,
while the web interface parsed that as well, and listed the words of the
comment as source files.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-01-14 21:52:37 -05:00
Loui Chang
92643bb827 Don't require source or md5sum arrays in PKGBUILDs.
Also fix a translation string.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-01-08 11:47:49 -05:00
Dan McGee
207b565f1c Minimize calls to uid_from_sid()
Just like the previous patch for account_from_sid() over-usage.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-01-04 14:28:24 -05:00
Loui Chang
35cff75156 Correct undefined constant error in pkgsubmit.
Clean up a couple of notices.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-29 17:44:57 -05:00
Loui Chang
ae1c424c95 Really make all web paths relative.
I forgot about the forms.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-12-22 13:19:56 +09:00
Loui Chang
78c2b5c67f Introduce function include_lang for translations.
This includes only the requested language for each page and
makes top level language include files obsolete.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-21 18:03:27 +09:00
Evangelos Foutras
fb1c41c6c6 Fix PKGBUILD source array parsing.
Fix for FS#11132 - AUR fails to parse multiline source array

Signed-off-by: Evangelos Foutras <foutrelis@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-20 13:25:44 -05:00
Callan Barrett
07a27f2f1d Add error checking to chmod on package submission
Try submitting an empty form to the aur

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-20 13:02:24 -05:00
Loui Chang
f12b11abc7 Give group writable permissions to uploaded files.
Add a new function chown_group to recursively change permissions.
Tweak some of the coding style.
Replace some of the redundant string concatenation with a variable.

Thanks to Dan McGee for chmod_group.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-11-13 15:19:26 -05:00
Loui Chang
a6147ab5ab Merge branch 'testing'
Conflicts:
	web/html/pkgsubmit.php

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-11-03 21:52:07 -05:00