mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2025-01-23 13:58:24 +00:00
root_mode
git-svn-id: http://s3fs.googlecode.com/svn/trunk@64 df820570-a93a-0410-bd06-b72b767a4274
This commit is contained in:
parent
23a7d00a66
commit
24ba1bb356
@ -198,6 +198,7 @@ static string bucket;
|
|||||||
static string AWSAccessKeyId;
|
static string AWSAccessKeyId;
|
||||||
static string AWSSecretAccessKey;
|
static string AWSSecretAccessKey;
|
||||||
static const string host = "http://s3.amazonaws.com";
|
static const string host = "http://s3.amazonaws.com";
|
||||||
|
static mode_t root_mode = 0;
|
||||||
|
|
||||||
// key=path
|
// key=path
|
||||||
typedef map<string, struct stat> stat_cache_t;
|
typedef map<string, struct stat> stat_cache_t;
|
||||||
@ -508,7 +509,7 @@ s3fs_getattr(const char *path, struct stat *stbuf) {
|
|||||||
memset(stbuf, 0, sizeof(struct stat));
|
memset(stbuf, 0, sizeof(struct stat));
|
||||||
if (strcmp(path, "/") == 0) {
|
if (strcmp(path, "/") == 0) {
|
||||||
stbuf->st_nlink = 1; // see fuse faq
|
stbuf->st_nlink = 1; // see fuse faq
|
||||||
stbuf->st_mode = S_IFDIR | 0755;
|
stbuf->st_mode = root_mode | S_IFDIR;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -984,6 +985,12 @@ my_fuse_opt_proc(void *data, const char *arg, int key, struct fuse_args *outargs
|
|||||||
if (bucket.size() == 0) {
|
if (bucket.size() == 0) {
|
||||||
bucket = arg;
|
bucket = arg;
|
||||||
return 0;
|
return 0;
|
||||||
|
} else {
|
||||||
|
struct stat buf;
|
||||||
|
// its the mountpoint... what is its mode?
|
||||||
|
if (stat(arg, &buf) != -1) {
|
||||||
|
root_mode = buf.st_mode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (key == FUSE_OPT_KEY_OPT) {
|
if (key == FUSE_OPT_KEY_OPT) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user