s3_upload: improve url validation and error message

Ensure s3_upload correctly validates the S3 folder url by requiring it
to end with /. This prevents wrong uploads to invalid paths, such as
file urls. Also improve the error message.

Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34255>
This commit is contained in:
Vignesh Raman
2025-03-28 13:44:30 +05:30
committed by Marge Bot
parent 248edb43c3
commit 7959250d1e
4 changed files with 8 additions and 5 deletions

View File

@@ -127,7 +127,7 @@ replay_s3_upload_images() {
__DESTINATION_FILE_PATH="$__S3_TRACES_PREFIX/${line##*-}"
fi
s3_upload "$RESULTS_DIR/$__PREFIX/$line" "https://${__S3_PATH}/${__DESTINATION_FILE_PATH%/*}"
s3_upload "$RESULTS_DIR/$__PREFIX/$line" "https://${__S3_PATH}/${__DESTINATION_FILE_PATH%/*}/"
done
}