From: Dan McGee <[EMAIL PROTECTED]> Use the new chmod_group() function to do so.
Signed-off-by: Dan McGee <[EMAIL PROTECTED]> --- NOTE: *completely* untested. I'll let you experienced AUR guys tell me this patch is completely crap. -Dan web/html/pkgsubmit.php | 34 +++++++++++++++++++++------------- 1 files changed, 21 insertions(+), 13 deletions(-) diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index abd6614..f79860d 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -48,16 +48,20 @@ if ($_COOKIE["AURSID"]): $error = __("Could not change directory to %s.", array($tempdir)); } else { - if ($_FILES['pfile']['name'] == "PKGBUILD") { - move_uploaded_file($_FILES['pfile']['tmp_name'], $tempdir . "/PKGBUILD"); - } else { - $tar = new Archive_Tar($_FILES['pfile']['tmp_name']); - $extract = $tar->extract(); - - if (!$extract) { - $error = __("Unknown file format for uploaded file."); - } - } + if ($_FILES['pfile']['name'] == "PKGBUILD") { + move_uploaded_file($_FILES['pfile']['tmp_name'], $tempdir . "/PKGBUILD"); + } else { + $tar = new Archive_Tar($_FILES['pfile']['tmp_name']); + $extract = $tar->extract(); + + if (!$extract) { + $error = __("Unknown file format for uploaded file."); + } + if (!chmod_group($tempdir)) { + $error = __("Could not chmod directory %s.", + array($tempdir)); + } + } } } } @@ -227,11 +231,15 @@ if ($_COOKIE["AURSID"]): if ([EMAIL PROTECTED](INCOMING_DIR . $pkg_name)) { $error = __( "Could not create directory %s." - , INCOMING_DIR . $pkg_name - ); + , INCOMING_DIR . $pkg_name); + } else { + if ([EMAIL PROTECTED](INCOMING_DIR . $pkg_name, 0775)) { + $error = __( "Could not chmod directory %s." + , INCOMING_DIR . $pkg_name); + } } - rename($pkg_dir, INCOMING_DIR . $pkg_name . "/" . $pkg_name); + rename($pkg_dir, INCOMING_DIR . $pkg_name . "/" . $pkg_name); } else { $error = __( "You are not allowed to overwrite the %h%s%h package." , "<b>" -- 1.6.0.3