Comments (6)
Greyhole simply replicates the ownership & permissions of the files & folders created by Samba, so your permission problem is more Samba & Linux-related than Greyhole-related.
You probably want to configure Linux so that when user1
creates a folder, it is owned by user1:users
, instead of user1:user1
. I know you could do that by changing the main group of user1
; not sure if there are other ways.
Not sure if you can configure Samba to do that without changing it in Linux. Samba has options for create mask
and create mode
, in shares config, but I don't think you can ask Samba to control which GID will be used for new files & folders.
On my server, my user is configured like this:
$ id gb
uid=1000(gb) gid=100(users)
And my Samba shares:
[meh]
path = /mnt/hdd8/samba-shares/meh
writeable = yes
browseable = yes
create mask = 0775
force create mode = 0664
directory mask = 0775
force directory mode = 0775
dfree command = /usr/bin/greyhole-dfree
vfs objects = greyhole
So when I create a folder in Linux, it's owned by gb:users
, but has permission drwxr-xr-x
(aka 755
).
Since I want my shares to be writable my other users too, I configured Samba to use 755
(and 644
for files) instead.
from greyhole.
Thanks for your fast reply!
Ok, I see what you're saying about replicating samba's ownership/permissions. I know nothing about the implementation details of Greyhole so forgive me if my follow-up question seems naive.
In the shares folder (eg /mnt/disk2/shares) the (sub-)folders for each of the shares (eg /mnt/disk2/shares/ShareA) are owned by root with permissions 777. That seems reasonable to me. The subfolders of /*/gh (eg /mnt/disk1/gh/ShareA) effectively mirror the shares folder but from what I've seen they are owned by a random user (whoever first saves something in the share). Conceptually I find that a bit odd, why should a random user own them? Wouldn't it make sense to treat these folders differently -- eg by also having them owned by root with permissions 777 -- and to replicate samba's ownership/permissions for the subfolders that are actually created by users (such as /mnt/disk1/gh/ShareA/Subfolder1)? In this specific case folder /mnt/disk1/gh/ShareA is only created for user1 as a side-effect because it didn't exist and because it's necessary so that /mnt/disk1/gh/ShareA/Subfolder1 can be created. Since this folder doesn't really have anything to do with user1 why should they own it?
I'm assuming that having /mnt/disk1/gh/ShareA owned by root with permissions 777 would allow for more flexible set-ups. Eg what I'm trying to do would probably work out of the box (and I guess everything that currently works would still work).
What do you think? (I hope I've explained myself clear enough, let me know if not)
from greyhole.
This definitely shouldn't happen. The ownership & permission of all folders inside the storage pool drives (gh
folders) should replicate the ownership & permission of the corresponding folders from the landing zone (Samba shares folders).
There might be a bug where this is not done for the share's root folders. I'll try to replicate, and fix it if it is indeed a bug.
As a workaround, you could simply create all your shares manually inside each storage pool drives, and give those folders the proper ownership + permissions.
from greyhole.
Ok great, thanks for your work on this! Eventually I did manage to get the setup I was looking for by setting directory mask = 0771
when creating the share.
from greyhole.
A fix for this will be included in the next release. Thank you for your time.
from greyhole.
Version 0.5.21 includes this fix.
from greyhole.
Related Issues (20)
- Error: failed to initialize Greyhole database HOT 2
- Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)). HOT 5
- Greyhole slow when transferring things via Radarr/Sonarr etc. HOT 3
- greyhole timezone=-13:00 vs ubuntu 18 (mysql 5.7) HOT 2
- MySQL server has gone away HOT 2
- No access to files from shares. HOT 11
- Change fsck cron timing HOT 1
- Debian 12, samba 4.17 and VFS not building HOT 2
- VFS errors HOT 9
- logrotate is already installed HOT 6
- daemon: Greyhole VFS module warning HOT 2
- Greyhole won't start after update - SQL error Can't DROP 'uniqness'; HOT 4
- Makefile error Samba 4.18.6 HOT 5
- DEBUG read_smb_spool: Directory created: / WARN read_smb_spool: Failed to create directory HOT 1
- Can't add drive to drive selection group! HOT 16
- Accidentally Copied Lots of Small Files - Recovering from a Blown Out log and Spool. HOT 5
- fsck parallelism HOT 1
- Failed file copy (using rename) HOT 3
- No Files shown after reinstall Greyhole HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from greyhole.