mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2026-04-25 13:26:00 +03:00
[GH-ISSUE #188] Attempts to access non-existent files may result in bogus EPERM instead of ENOENT #104
Labels
No labels
bug
bug
dataloss
duplicate
enhancement
feature request
help wanted
invalid
need info
performance
pull-request
question
question
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/s3fs-fuse#104
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @UnitedMarsupials-zz on GitHub (May 12, 2015).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/188
If the attempted name contains asterisk, the error-code will be
EPERM, which is incorrect. Otherwise, the failure isENOENT. Here, for example, we have an S3-bucket mounted under/data/ftp. Trying to list three non-existent names, one gets different results:Note, how using ?-template still works properly, but asterisk must have some special meaning, which causes erroneous behavior.
@UnitedMarsupials-zz commented on GitHub (May 12, 2015):
This is, probably, due to the fact, that
*is copied verbatim instead of being escaped inurlEncode().BTW, this function seems to have another problem -- it relies on
isalnum(), which can have a different result depending on locale. It should instead check for the characters being one of the three ranges instead:'a'-'z','A'-'Z','0'-'9'.Oh, and the special case for space is gratuitous for it is indistinguishable for the general case implemented after it.
@UnitedMarsupials-zz commented on GitHub (May 12, 2015):
This fixes the problem for me -- and picks the above-mentioned nits from
urlEncode():Actually, the last line in the above code should use single quotes to append a character
'%'instead of a one-character string"%". Works either way, just less work for the string-class to do.@gaul commented on GitHub (May 12, 2015):
I have not looked into this yet, but we should add tests for special characters to
integration-test-main.sh.@gaul commented on GitHub (May 26, 2015):
Some percent-encoding references:
http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html
http://en.wikipedia.org/wiki/Percent-encoding