summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2014-05-06 21:24:56 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2014-05-06 21:24:56 +0200
commitba307433981f6364cbcddb6b955d4ff80d576e2e (patch)
treeb451144b7f9eea28ee382ff4875d9d4071d8246c
parentac09e669c7d49723794ae05a471924e3892f6dce (diff)
downloadaur-ba307433981f6364cbcddb6b955d4ff80d576e2e.tar.gz
aur-ba307433981f6364cbcddb6b955d4ff80d576e2e.tar.xz
Check permissions when uploading source packages
All files contained in the source tarball must have permissions of 644 or 755. All directories must have permissions of 755. Implements FS#27754. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
-rw-r--r--web/html/pkgsubmit.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php
index 51d0203c..f07580b2 100644
--- a/web/html/pkgsubmit.php
+++ b/web/html/pkgsubmit.php
@@ -90,6 +90,9 @@ if ($uid):
if (strchr($tar_file['filename'], '/') === false) {
$error = __("Error - source tarball may not contain files outside a directory.");
break;
+ } elseif ($tar_file['mode'] != 0644 && $tar_file['mode'] != 0755) {
+ $error = __("Error - all files must have permissions of 644 or 755.");
+ break;
} elseif (substr($tar_file['filename'], -9) == '/PKGBUILD') {
$pkgbuild_raw = $tar->extractInString($tar_file['filename']);
} elseif (substr($tar_file['filename'], -9) == '/.AURINFO') {
@@ -102,6 +105,9 @@ if ($uid):
} elseif (++$dircount > 1) {
$error = __("Error - source tarball may not contain more than one directory.");
break;
+ } elseif ($tar_file['mode'] != 0755) {
+ $error = __("Error - all directories must have permissions of 755.");
+ break;
}
}
}