mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
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>
This commit is contained in:
parent
ac09e669c7
commit
ba30743398
1 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue