Commit graph

8 commits

Author SHA1 Message Date
Johannes Löthberg
e5b43760c2 Move AUR_OVERWRITE privilege check from git/auth to git/update
git/auth is run as an AutherizedKeysCommand which does not get the
environment variables passed to it, so AUR_OVERWRITE always got
hard-set to '0' by it.  Instead we need to perform the actual privilege
check in git/update instead.

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2018-01-21 18:09:10 +01:00
Lukas Fleischer
7ef1427678 Fix use of test_must_fail with environment variables
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-08-25 07:04:15 +02:00
Lukas Fleischer
e0d3fbfdf1 t1300: Fix test cases for non-fast-forward pushes
Since commit c5302d3 (Require TUs to explicitly request to overwrite a
pkgbase, 2017-07-24), non-fast-forward pushes are denied even for
Trusted Users, unless the AUR_OVERWRITE environment variable is set.
Mark the test case performing a non-fast-forward push from a TU
account as test_must_fail and add another test case performing the
same operation with AUR_OVERWRITE=1.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-08-08 15:28:40 +02:00
Lukas Fleischer
f4e2d143ad Explicitly initialize PackageBases.FlaggerComment
Since commit 09cb61a (schema: Remove invalid default values for TEXT
columns, 2017-04-15), the PackageBases.FlaggerComment field no longer
has a default value. Initialize this field explicitly whenever a new row
is added to the PackageBases table.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-04-25 07:00:52 +02:00
Lukas Fleischer
90ab7c7b83 t1300: Factor out package dumping
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-04-25 07:00:23 +02:00
Lukas Fleischer
29a5f94dab git-update: Catch long source URLs
Bail out early if the source array contains an entry with more than 8000
characters.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-10-11 08:36:40 +02:00
Lukas Fleischer
1492444ecb Make URL columns 8000 characters wide
According to RFC 7230, URLs can be up too 8000 characters long. Resize
all URL fields accordingly.

Also, add a test to verify that URLs with more than 8000 characters are
rejected by the update hook.

Reported-by: Andreas Linz <klingt.net@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-10-11 08:36:40 +02:00
Lukas Fleischer
49c7e53572 Reorganize tests
Move and rename the existing git-interface tests such that tests for
other scripts can be added easily.

In particular, the following changes are made:

* Move the existing tests from git-interface/test/ to test/.
* Rename t0001-auth.sh to t1100-git-auth.sh.
* Rename t0002-serve.sh to t1200-git-serve.sh.
* Rename t0003-update.sh to t1300-git-update.sh.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:24 +02:00
Renamed from git-interface/test/t0003-update.sh (Browse further)