mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2025-04-10 18:41:53 +00:00
return -EPERM on 403 (access forbidden) instead of -EIO
git-svn-id: http://s3fs.googlecode.com/svn/trunk@373 df820570-a93a-0410-bd06-b72b767a4274
This commit is contained in:
parent
ac54fad06e
commit
4ba385d1be
@ -148,13 +148,10 @@ int my_curl_easy_perform(CURL* curl, BodyStruct* body, FILE* f) {
|
|||||||
|
|
||||||
case 403:
|
case 403:
|
||||||
if(debug) syslog(LOG_ERR, "HTTP response code 403 was returned");
|
if(debug) syslog(LOG_ERR, "HTTP response code 403 was returned");
|
||||||
if(body) {
|
if(body)
|
||||||
if(body->size && debug) {
|
if(body->size && debug)
|
||||||
syslog(LOG_ERR, "Body Text: %s", body->text);
|
syslog(LOG_ERR, "Body Text: %s", body->text);
|
||||||
}
|
return -EPERM;
|
||||||
}
|
|
||||||
if(debug) syslog(LOG_DEBUG, "Now returning EIO");
|
|
||||||
return -EIO;
|
|
||||||
|
|
||||||
case 404:
|
case 404:
|
||||||
if(debug) syslog(LOG_DEBUG, "HTTP response code 404 was returned");
|
if(debug) syslog(LOG_DEBUG, "HTTP response code 404 was returned");
|
||||||
|
@ -2728,8 +2728,9 @@ static int s3fs_readdir(
|
|||||||
cout << "readdir[path=" << path << "]" << endl;
|
cout << "readdir[path=" << path << "]" << endl;
|
||||||
|
|
||||||
// get a list of all the objects
|
// get a list of all the objects
|
||||||
if((list_bucket(path, &head)) != 0)
|
int result;
|
||||||
return -EIO;
|
if((result = list_bucket(path, &head)) != 0)
|
||||||
|
return result;
|
||||||
|
|
||||||
if(head == NULL)
|
if(head == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
@ -3555,6 +3556,7 @@ static void s3fs_check_service(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// make sure the bucket exists and we have access to it
|
// make sure the bucket exists and we have access to it
|
||||||
|
/*
|
||||||
string match = "<Bucket><Name>" + bucket + "</Name>";
|
string match = "<Bucket><Name>" + bucket + "</Name>";
|
||||||
if(strstr(body.text, match.c_str()) == NULL) {
|
if(strstr(body.text, match.c_str()) == NULL) {
|
||||||
fprintf (stderr, "%s: bucket \"%s\" is not part of the service specified by the credentials\n",
|
fprintf (stderr, "%s: bucket \"%s\" is not part of the service specified by the credentials\n",
|
||||||
@ -3562,6 +3564,7 @@ static void s3fs_check_service(void) {
|
|||||||
destroy_curl_handle(curl);
|
destroy_curl_handle(curl);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// once we arrive here, that means that our preliminary connection
|
// once we arrive here, that means that our preliminary connection
|
||||||
// worked and the bucket matches the credentials provided
|
// worked and the bucket matches the credentials provided
|
||||||
|
Loading…
x
Reference in New Issue
Block a user