diff --git a/README.md b/README.md index 215cc6e..7460bb5 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ sudo cmake --install build ```bash # Linux (openEuler) -dnf install -y cmake clang fuse3-devel bpftool libbpf-devel +sudo dnf install -y cmake clang fuse3-devel bpftool libbpf-devel cmake -B build && cmake --build build -j sudo cmake --install build ./start.sh /path/to/project diff --git a/src/cas/platform/linux/fuse_adapter.cpp b/src/cas/platform/linux/fuse_adapter.cpp index a6321a4..6c132a9 100644 --- a/src/cas/platform/linux/fuse_adapter.cpp +++ b/src/cas/platform/linux/fuse_adapter.cpp @@ -51,6 +51,8 @@ static int cas_getattr(const char* path, struct stat* st, struct fuse_file_info* if (std::strcmp(path, "/") == 0) { st->st_mode = S_IFDIR | 0755; st->st_nlink = 2; + st->st_uid = fuse_get_context()->uid; + st->st_gid = fuse_get_context()->gid; return 0; } @@ -60,7 +62,7 @@ static int cas_getattr(const char* path, struct stat* st, struct fuse_file_info* switch (entry->kind) { case EntryKind::Blob: st->st_mode = S_IFREG | (entry->mode & 07777); break; - case EntryKind::Tree: st->st_mode = S_IFDIR | (entry->mode & 07777); st->st_nlink = 2; return 0; + case EntryKind::Tree: st->st_mode = S_IFDIR | (entry->mode & 07777); st->st_nlink = 2; st->st_uid = fuse_get_context()->uid; st->st_gid = fuse_get_context()->gid; return 0; case EntryKind::Symlink: st->st_mode = S_IFLNK | 0777; break; default: return -ENOENT; } diff --git a/src/cas/platform/macos/fuse_t_adapter.cpp b/src/cas/platform/macos/fuse_t_adapter.cpp index 80f5389..34f96eb 100644 --- a/src/cas/platform/macos/fuse_t_adapter.cpp +++ b/src/cas/platform/macos/fuse_t_adapter.cpp @@ -64,6 +64,8 @@ static int cas_getattr(const char* path, struct stat* st) { if (std::strcmp(path, "/") == 0) { st->st_mode = S_IFDIR | 0755; st->st_nlink = 2; + st->st_uid = fuse_get_context()->uid; + st->st_gid = fuse_get_context()->gid; return 0; } @@ -77,6 +79,8 @@ static int cas_getattr(const char* path, struct stat* st) { case EntryKind::Tree: st->st_mode = S_IFDIR | (entry->mode & 07777); st->st_nlink = 2; + st->st_uid = fuse_get_context()->uid; + st->st_gid = fuse_get_context()->gid; return 0; case EntryKind::Symlink: st->st_mode = S_IFLNK | 0777; break;