mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
pkgsubmit.php: Ensure the session is linked to a valid user.
Prevent race conditions that may occur when either the session or the user is deleted before we extract the actual user identifier. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
9ff30614b8
commit
ed9c95623f
1 changed files with 8 additions and 3 deletions
|
@ -13,7 +13,14 @@ check_sid(); # see if they're still logged in
|
|||
|
||||
$cwd = getcwd();
|
||||
|
||||
if ($_COOKIE["AURSID"]):
|
||||
if ($_COOKIE["AURSID"]) {
|
||||
$uid = uid_from_sid($_COOKIE['AURSID']);
|
||||
}
|
||||
else {
|
||||
$uid = NULL;
|
||||
}
|
||||
|
||||
if ($uid):
|
||||
|
||||
# Track upload errors
|
||||
$error = "";
|
||||
|
@ -51,8 +58,6 @@ if ($_COOKIE["AURSID"]):
|
|||
fclose($fh);
|
||||
}
|
||||
|
||||
$uid = uid_from_sid($_COOKIE['AURSID']);
|
||||
|
||||
if (!$error) {
|
||||
$tar = new Archive_Tar($_FILES['pfile']['tmp_name']);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue