Skip to content

fix: set uid/gid for directory entries in cas_getattr and add sudo to README#5

Merged
Zhihaoi merged 2 commits into
thustorage:mainfrom
haoren3696:main
May 24, 2026
Merged

fix: set uid/gid for directory entries in cas_getattr and add sudo to README#5
Zhihaoi merged 2 commits into
thustorage:mainfrom
haoren3696:main

Conversation

@haoren3696
Copy link
Copy Markdown
Contributor

Summary

  • Fix ownership of root and Tree (directory) entries in cas_getattr — previously missing st_uid/st_gid assignment caused mount points and all subdirectories to appear owned by root:root instead of the calling user.
  • Add missing sudo to the dnf install command in the openEuler build section of README.

Error related to ownership issue:

[user1@localhost ContextFS]$ ./start.sh .
mount=/tmp/agentvfs-1001/ContextFS/mount
next: cd /tmp/agentvfs-1001/ContextFS/mount && claude   # or: codex
[user1@localhost ContextFS]$ cd /tmp/agentvfs-1001/ContextFS/mount
[user1@localhost mount]$ git status
fatal: detected dubious ownership in repository at '/tmp/agentvfs-1001/ContextFS/mount'
To add an exception for this directory, call:

        git config --global --add safe.directory /tmp/agentvfs-1001/ContextFS/mount
[user1@localhost mount]$ ls -al /tmp/agentvfs-1001/ContextFS/mount
total 0
drwxr-xr-x. 2 root  root      0 Jan  1  1970 .
drwx------. 5 user1 user1   180 May 24 18:04 ..
drwxr-xr-x. 2 root  root      0 Jan  1  1970 benchmarks
drwxr-xr-x. 2 root  root      0 Jan  1  1970 build
drwxr-xr-x. 2 root  root      0 Jan  1  1970 cmake
-rw-r--r--. 1 user1 user1 28004 Jan  1  1970 CMakeLists.txt
drwxr-xr-x. 2 root  root      0 Jan  1  1970 demo
drwxr-xr-x. 2 root  root      0 Jan  1  1970 docs
drwxr-xr-x. 2 root  root      0 Jan  1  1970 .git
drwxr-xr-x. 2 root  root      0 Jan  1  1970 .github
-rw-r--r--. 1 user1 user1   506 Jan  1  1970 .gitignore
drwxr-xr-x. 2 root  root      0 Jan  1  1970 include
-rw-r--r--. 1 user1 user1  3411 Jan  1  1970 install.ps1
-rwxr-xr-x. 1 user1 user1  5018 Jan  1  1970 install.sh
drwxr-xr-x. 2 root  root      0 Jan  1  1970 lib
-rw-r--r--. 1 user1 user1 11350 Jan  1  1970 LICENSE
-rw-r--r--. 1 user1 user1  4957 Jan  1  1970 README.md
drwxr-xr-x. 2 root  root      0 Jan  1  1970 scripts
drwxr-xr-x. 2 root  root      0 Jan  1  1970 src
-rwxr-xr-x. 1 user1 user1  5503 Jan  1  1970 start.sh
drwxr-xr-x. 2 root  root      0 Jan  1  1970 tests
[user1@localhost mount]$ ls -al /home/user1/ContextFS
total 128
drwxr-xr-x. 14 user1 user1  4096 May 24 18:02 .
drwx------.  5 user1 user1  4096 May 24 18:04 ..
drwxr-xr-x.  3 user1 user1  4096 May 24 18:02 benchmarks
drwxr-xr-x.  3 user1 user1  4096 May 24 18:03 build
drwxr-xr-x.  2 user1 user1  4096 May 24 18:02 cmake
-rw-r--r--.  1 user1 user1 28004 May 24 18:02 CMakeLists.txt
drwxr-xr-x.  4 user1 user1  4096 May 24 18:02 demo
drwxr-xr-x.  4 user1 user1  4096 May 24 18:02 docs
drwxr-xr-x.  8 user1 user1  4096 May 24 18:02 .git
drwxr-xr-x.  3 user1 user1  4096 May 24 18:02 .github
-rw-r--r--.  1 user1 user1   506 May 24 18:02 .gitignore
drwxr-xr-x.  3 user1 user1  4096 May 24 18:02 include
-rw-r--r--.  1 user1 user1  3411 May 24 18:02 install.ps1
-rwxr-xr-x.  1 user1 user1  5018 May 24 18:02 install.sh
drwxr-xr-x.  2 user1 user1  4096 May 24 18:02 lib
-rw-r--r--.  1 user1 user1 11350 May 24 18:02 LICENSE
-rw-r--r--.  1 user1 user1  4957 May 24 18:02 README.md
drwxr-xr-x.  2 user1 user1  4096 May 24 18:02 scripts
drwxr-xr-x.  4 user1 user1  4096 May 24 18:02 src
-rwxr-xr-x.  1 user1 user1  5503 May 24 18:02 start.sh
drwxr-xr-x.  3 user1 user1  4096 May 24 18:02 tests

Steps to reproduce the ownership problem

useradd -m -G wheel user1
passwd user1
su user1
cd ~/
git clone https://github.com/thustorage/ContextFS.git
cd ContextFS/
cmake -B build && cmake --build build -j
sudo cmake --install build
./start.sh .
cd /tmp/agentvfs-1001/ContextFS/mount
git status
ls -al /tmp/agentvfs-1001/ContextFS/mount
ls -al /home/user1/ContextFS

Root directory and Tree (directory) entries were missing uid/gid
assignment, causing mount point and all subdirectories to appear
owned by root:root instead of the calling user.
@Zhihaoi
Copy link
Copy Markdown
Collaborator

Zhihaoi commented May 24, 2026

LGTM

@Zhihaoi Zhihaoi merged commit 1744bab into thustorage:main May 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants