0

Can I control the permission with which SCons creates its hardlinks in the CacheDir?

I create the CacheDir using the correct permissions (a specific group) but the files which scons generates inside of it get incorrect (same as my username) group id gid.

I'm sitting on Linux x86_64 (CentOS 6).

I've tried calling both

os.setgid(grp.getgrnam("the_correct_groupname"))

and

os.setegid(grp.getgrnam("the_correct_groupname"))

but they both fail with

OSError: Operation not permitted

What to do?

Nordlöw
  • 11,838
  • 10
  • 52
  • 99

1 Answers1

1

Try creating your cache directory with the sticky bit.

However, as far as I'm aware, SCons copies files into and out of the cache directory, it doesn't create hard links, so as long as they are readable by the people who need to read them, that should be enough.

Tom Tanner
  • 9,244
  • 3
  • 33
  • 61
  • @Nordlöw Where does it say that? Section 24.1 (Specifying the Shared Cache Directory) explicitly says 'copied into the local build directory' – Tom Tanner Apr 07 '14 at 07:52
  • I know this is old, but you probably mean the setgid bit (g+s) not the sticky bit. The setgid bit propagates a directory's group id to other files/directories created in that directory. The sticky bit prevents deletion of files in a group or world writable directory by users other than the owner. – Mark E. Hamilton Apr 29 '20 at 01:12