Skip to content

Commit 8b75a05

Browse files
authored
fix(binder): fix external location table list check end with delimiter '/' (#17890)
* fix(binder): fix external location table list check end with delimiter '/' * only add the end delimiter for the list
1 parent d84f3c6 commit 8b75a05

File tree

1 file changed

+4
-1
lines changed
  • src/query/sql/src/planner/binder/ddl

1 file changed

+4
-1
lines changed

src/query/sql/src/planner/binder/ddl/table.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1882,7 +1882,10 @@ async fn verify_external_location_privileges(dal: Operator) -> Result<()> {
18821882
}
18831883

18841884
// verify privilege to list
1885-
if let Err(e) = dal.list(VERIFICATION_KEY).await {
1885+
// Append "/" to the verification key to ensure we are listing the contents of the directory/prefix
1886+
// rather than attempting to list a single object.
1887+
// Like aws s3 express one, the list requires a end delimiter.
1888+
if let Err(e) = dal.list(&format!("{}{}", VERIFICATION_KEY, "/")).await {
18861889
errors.push(format!("Permission check for [List] failed: {}", e));
18871890
}
18881891

0 commit comments

Comments
 (0)