[GH-ISSUE #1260] Directories always created as root. #677

Open
opened 2026-03-04 01:47:48 +03:00 by kerem · 0 comments
Owner

Originally created by @chrisbecke on GitHub (Apr 3, 2020).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/1260

Additional Information

The following information is very important in order to help us to help you. Omission of the following details may delay your support request or receive no attention at all.
Keep in mind that the commands we provide to retrieve information are oriented to GNU/Linux Distributions, so you could need to use others if you use s3fs on macOS or BSD

Version of s3fs being used (s3fs --version)

Amazon Simple Storage Service File System V1.86 (commit:unknown) with OpenSSL
Copyright (C) 2010 Randy Rizun <rrizun@gmail.com>
License GPL2: GNU GPL version 2 <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Version of fuse being used (pkg-config --modversion fuse, rpm -qi fuse, dpkg -s fuse)

fuse-2.9.8-r2 x86_64 {fuse} (GPL-2.0-only LGPL-2.1-only) [installed]
s3fs-fuse-1.86-r0 x86_64 {s3fs-fuse} (GPL-2.0-only) [installed]
fuse-common-3.9.0-r0 x86_64 {fuse3} (GPL-2.0-only LGPL-2.1-only) [installed]

Kernel information (uname -r)

4.19.76-linuxkit

GNU/Linux Distribution, if applicable (cat /etc/os-release)

NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.11.5
PRETTY_NAME="Alpine Linux v3.11"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"

s3fs command line used, if applicable

s3fs test-volume /data -o allow_other -o use_path_request_style -o nonempty -o host=http://localhost:9000

s3fs syslog messages (grep s3fs /var/log/syslog, journalctl | grep s3fs, or s3fs outputs)

if you execute s3fs with dbglevel, curldbg option, you can get detail debug messages

Details about issue

This is about using s3fs-fuse from a docker container, which may or may not be relevant. My problem is, when I mount a s3fs bucket, and then use it as a non root user, all the files that are created are created as the current user, but all the directories that are created are created as 'root:root'.

This is what a test directory looks like after I mounted it as root, and then accessed it using a test user I created (fuser).

/ # ls -l /data
total 4
drwxr-x---    1 root     root             0 Apr  3 11:43 acme
drwxr-x---    1 root     root             0 Apr  3 11:46 acme1
drwxr-x---    1 root     root             0 Apr  3 11:47 acme2
-rw-r--r--    1 fuser    fuser            0 Apr  3 12:31 afile
drwxr-x---    1 root     root             0 Apr  3 12:31 afolder
-rw-r--r--    1 fuser    fuser            0 Apr  3 11:35 foo
-rw-r--r--    1 fuser    fuser            0 Apr  3 11:48 foobar

Now, "/data" itself gets promoted to 0777 when s3fs mounts something which allows fuser to create files (its drwxr-xr-x when nothing is mounted). drwxr-x--- 1 root root on the directories created by fuser is obviously causing errors.

Originally created by @chrisbecke on GitHub (Apr 3, 2020). Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/1260 ### Additional Information _The following information is very important in order to help us to help you. Omission of the following details may delay your support request or receive no attention at all._ _Keep in mind that the commands we provide to retrieve information are oriented to GNU/Linux Distributions, so you could need to use others if you use s3fs on macOS or BSD_ #### Version of s3fs being used (s3fs --version) ``` Amazon Simple Storage Service File System V1.86 (commit:unknown) with OpenSSL Copyright (C) 2010 Randy Rizun <rrizun@gmail.com> License GPL2: GNU GPL version 2 <https://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. ``` #### Version of fuse being used (pkg-config --modversion fuse, rpm -qi fuse, dpkg -s fuse) ``` fuse-2.9.8-r2 x86_64 {fuse} (GPL-2.0-only LGPL-2.1-only) [installed] s3fs-fuse-1.86-r0 x86_64 {s3fs-fuse} (GPL-2.0-only) [installed] fuse-common-3.9.0-r0 x86_64 {fuse3} (GPL-2.0-only LGPL-2.1-only) [installed] ``` #### Kernel information (uname -r) _4.19.76-linuxkit_ #### GNU/Linux Distribution, if applicable (cat /etc/os-release) ``` NAME="Alpine Linux" ID=alpine VERSION_ID=3.11.5 PRETTY_NAME="Alpine Linux v3.11" HOME_URL="https://alpinelinux.org/" BUG_REPORT_URL="https://bugs.alpinelinux.org/" ``` #### s3fs command line used, if applicable ``` s3fs test-volume /data -o allow_other -o use_path_request_style -o nonempty -o host=http://localhost:9000 ``` #### s3fs syslog messages (grep s3fs /var/log/syslog, journalctl | grep s3fs, or s3fs outputs) _if you execute s3fs with dbglevel, curldbg option, you can get detail debug messages_ ``` ``` ### Details about issue This is about using s3fs-fuse from a docker container, which may or may not be relevant. My problem is, when I mount a s3fs bucket, and then use it as a non root user, all the files that are created are created as the current user, but all the directories that are created are created as 'root:root'. This is what a test directory looks like after I mounted it as root, and then accessed it using a test user I created (fuser). ```bash / # ls -l /data total 4 drwxr-x--- 1 root root 0 Apr 3 11:43 acme drwxr-x--- 1 root root 0 Apr 3 11:46 acme1 drwxr-x--- 1 root root 0 Apr 3 11:47 acme2 -rw-r--r-- 1 fuser fuser 0 Apr 3 12:31 afile drwxr-x--- 1 root root 0 Apr 3 12:31 afolder -rw-r--r-- 1 fuser fuser 0 Apr 3 11:35 foo -rw-r--r-- 1 fuser fuser 0 Apr 3 11:48 foobar ``` Now, "/data" itself gets promoted to 0777 when s3fs mounts something which allows fuser to create files (its drwxr-xr-x when nothing is mounted). `drwxr-x--- 1 root root` on the directories created by fuser is obviously causing errors.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#677
No description provided.