[GH-ISSUE #2786] Overriding Ownership Of Directories #1298

Open
opened 2026-03-04 01:52:55 +03:00 by kerem · 1 comment
Owner

Originally created by @michael-nusol on GitHub (Jan 14, 2026).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/2786

Additional Information

Version of s3fs being used (s3fs --version)

v1.93 via MacPorts

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

2.9.9

Provider (AWS, OVH, Hetzner, iDrive E2, ...)

AWS

Kernel information (uname -r)

24.6.0

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

macOS 15.7.3 Apple Silicon

How to run s3fs, if applicable

[X] command line
[] /etc/fstab

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

Details about issue

I recently joined an org using s3fs to store files generated by a homegrown utility. The folks using it are all on Linux, where the first user created (them) has UID 1000 and GID 1000. I'm running MacOS where my UID is 501 and GID 20.
Initially, I was mounting this bucket with UID=501,GID=20 options (so I could modify), but when I create or modify files via s3fs, the ownership gets overwritten with 501:20 and this has messed up permissions for everyone else.
I found the ahbe_conf parameter, and I am pointing it to a file with these lines:

reg:(.*) X-AMZ-META-UID 1000
reg:(.*) X-AMZ-META-GID 1000

This is working for files; they're all obtaining correct ownership (1000:1000) but it's not working for directories

michael$ mkdir test_dir michael$ touch test_fyle michael$ ls -lan total 0 drwxr-xr-x 1 501 20 0 Jan 14 13:12 . drwxrwxrwx@ 1 1000 1000 0 Dec 16 04:49 .. drwxr-xr-x 1 501 20 0 Jan 14 13:13 test_dir -rw-r--r-- 1 1000 1000 0 Jan 14 13:13 test_fyle

How do I get it to set ownership 1000:1000 on directories? I would have thought the regex for "everything" in the ahbe_conf file would have grabbed them too...

Originally created by @michael-nusol on GitHub (Jan 14, 2026). Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/2786 <!-- -------------------------------------------------------------------------- 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. --------------------------------------------------------------------------- --> ### Additional Information #### Version of s3fs being used (`s3fs --version`) <!-- example: V1.91 (commit:b19262a) --> v1.93 via MacPorts #### Version of fuse being used (`pkg-config --modversion fuse`, `rpm -qi fuse` or `dpkg -s fuse`) <!-- example: 2.9.2 --> 2.9.9 #### Provider (`AWS`, `OVH`, `Hetzner`, `iDrive E2`, ...) <!-- example: AWS --> AWS #### Kernel information (`uname -r`) <!-- example: 5.10.96-90.460.amzn2.x86_64 --> 24.6.0 #### GNU/Linux Distribution, if applicable (`cat /etc/os-release`) <!-- command result --> macOS 15.7.3 Apple Silicon #### How to run s3fs, if applicable <!-- Describe the s3fs "command line" or "/etc/fstab" entry used. --> [X] command line [] /etc/fstab <!-- Executed command line or /etc/fastab entry --> ``` ``` #### 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 I recently joined an org using s3fs to store files generated by a homegrown utility. The folks using it are all on Linux, where the first user created (them) has UID 1000 and GID 1000. I'm running MacOS where my UID is 501 and GID 20. Initially, I was mounting this bucket with UID=501,GID=20 options (so I could modify), but when I create or modify files via s3fs, the ownership gets overwritten with 501:20 and this has messed up permissions for everyone else. I found the ahbe_conf parameter, and I am pointing it to a file with these lines: ``` reg:(.*) X-AMZ-META-UID 1000 reg:(.*) X-AMZ-META-GID 1000 ``` This is working for files; they're all obtaining correct ownership (1000:1000) but it's not working for directories `michael$ mkdir test_dir michael$ touch test_fyle michael$ ls -lan total 0 drwxr-xr-x 1 501 20 0 Jan 14 13:12 . drwxrwxrwx@ 1 1000 1000 0 Dec 16 04:49 .. drwxr-xr-x 1 501 20 0 Jan 14 13:13 test_dir -rw-r--r-- 1 1000 1000 0 Jan 14 13:13 test_fyle ` How do I get it to set ownership 1000:1000 on directories? I would have thought the regex for "everything" in the ahbe_conf file would have grabbed them too...
Author
Owner

@michael-nusol commented on GitHub (Jan 14, 2026):

I can't seem to edit that directory listing in my initial post to make it proper multiple lines, but it seems to work here in the comment:

michael$ mkdir test_dir
michael$ touch test_fyle
michael$ ls -lan
total 0
drwxr-xr-x  1 501   20    0 Jan 14 13:12 .
drwxrwxrwx@ 1 1000  1000  0 Dec 16 04:49 ..
drwxr-xr-x  1 501   20    0 Jan 14 13:13 test_dir
-rw-r--r--  1 1000  1000  0 Jan 14 13:13 test_fyle

<!-- gh-comment-id:3750994663 --> @michael-nusol commented on GitHub (Jan 14, 2026): I can't seem to edit that directory listing in my initial post to make it proper multiple lines, but it seems to work here in the comment: ``` michael$ mkdir test_dir michael$ touch test_fyle michael$ ls -lan total 0 drwxr-xr-x 1 501 20 0 Jan 14 13:12 . drwxrwxrwx@ 1 1000 1000 0 Dec 16 04:49 .. drwxr-xr-x 1 501 20 0 Jan 14 13:13 test_dir -rw-r--r-- 1 1000 1000 0 Jan 14 13:13 test_fyle ```
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#1298
No description provided.