Git Product home page Git Product logo

Comments (6)

gboudreau avatar gboudreau commented on July 18, 2024

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.

michaepr avatar michaepr commented on July 18, 2024

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.

gboudreau avatar gboudreau commented on July 18, 2024

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.

michaepr avatar michaepr commented on July 18, 2024

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.

gboudreau avatar gboudreau commented on July 18, 2024

A fix for this will be included in the next release. Thank you for your time.

from greyhole.

gboudreau avatar gboudreau commented on July 18, 2024

Version 0.5.21 includes this fix.

from greyhole.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.