CentOS chmod overiding set-group-ID?

0

I'm used to setting up SGID on a directory

chmod -R g+s example and then
chmdo -R 750 example

And have the directory and all sub-directories preserve the set-group-ID. On CentOS SGID gets overridden by the second command.

The OS is CentOS release 5.6 (Final)

In theory, and like it says on this page, "if commands like chmod routinely cleared these bits on directories, the mechanisms would be less convenient..." and it's exactly whats happening. chmod -R 750 is effectivelly removing the SGID.

How can I make g+s permanent?

Frankie

Posted 2011-06-13T00:41:51.460

Reputation: 149

setgid and sticky are two different things. – Ignacio Vazquez-Abrams – 2011-06-13T00:46:36.273

@Ignacio, gonna look it deeper. Right now just corrected it so other's don't get confused. Thanks! – Frankie – 2011-06-13T00:51:37.127

Answers

2

Use 2750 with chmod instead.

Ignacio Vazquez-Abrams

Posted 2011-06-13T00:41:51.460

Reputation: 100 516

thks for your reply. Using 2750 would work but it doesn't make it permanent. As soon as I do something like chmod -R 640 it overrides the sticky bit. On Fedora I never had this problem... – Frankie – 2011-06-13T00:50:23.790

1Fedora has a newer version of coreutils. – Ignacio Vazquez-Abrams – 2011-06-13T00:56:27.593

that's it. CentOS is using quite an old version of coreutils. Thanks for catching this one! – Frankie – 2011-06-13T01:48:47.290