Skip to content

Config option to disable setting S_ISGID bit when creating installation directory#14479

Merged
becker33 merged 3 commits intospack:developfrom
iarspider:no_setgid
May 8, 2020
Merged

Config option to disable setting S_ISGID bit when creating installation directory#14479
becker33 merged 3 commits intospack:developfrom
iarspider:no_setgid

Conversation

@iarspider
Copy link
Copy Markdown
Contributor

Addresses #14425

@iarspider
Copy link
Copy Markdown
Contributor Author

I don't know if there is any other file you need to edit when adding a config option: some JSON schema maybe?

@adamjstewart
Copy link
Copy Markdown
Member

There is a JSON schema somewhere, I can probably dig it up if you can't find it. Look for previous PRs that added new config options.

But is there any way we can try-except this, or check if we're on AFS instead of relying on manual user intervention?

@iarspider
Copy link
Copy Markdown
Contributor Author

There doesn't seem to be an easy reliable way of detecting AFS (or, in general, telling what filesystem is for a given path). As for try-except: it's a valid idea, but will make the code less readable because of nested try-except:

try:
    chmod(perms_with_setgid)
except PermissionError:
    try:
        chmod(permis_without_setgid)
    except PermissionError as e:
        raise e

An alternative solution could be creating a "probe" directory at the start of spack install, trying to set S_ISGID flag, and remembering the result - but that is a very extensive change IMO.

@hartzell
Copy link
Copy Markdown
Contributor

Why is Spack setting the setgid bit? On some filesystems it's used to control "BSD" vs "ATT" group semantics:

When the bit is set for a directory, the set of files in that directory will have the same group as the group of the parent directory, and not that of the user who created those files. This is used for file sharing since they can be now modified by all the users who are part of the group of the parent directory.

from here on geeksforgeeks

but those permissions are inherited from the parent dir, so if someone wants those semantics then they should be able to get them by setting the SETGID bit on the parent directory.

Is there something else going on?

@iarspider
Copy link
Copy Markdown
Contributor Author

@hartzell @becker33 any progress?

@hartzell
Copy link
Copy Markdown
Contributor

@iarspider -- I'm not a doer on this, just was trying to clear up my confusion about how it was being used.

@iarspider
Copy link
Copy Markdown
Contributor Author

Ping @becker33 @scheibelp !

Copy link
Copy Markdown
Member

@becker33 becker33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor request, otherwise LGTM.

@becker33
Copy link
Copy Markdown
Member

becker33 commented May 7, 2020

Bouncing close/open to restart tests

@becker33 becker33 closed this May 7, 2020
@becker33 becker33 reopened this May 7, 2020
@becker33 becker33 merged commit e2d4267 into spack:develop May 8, 2020
@iarspider iarspider deleted the no_setgid branch May 8, 2020 06:13
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.

4 participants