Two setuid programs,
/usr/bin/baz, share a single configuration file
foo. The configuration file's mode is
0640, for it holds sensitive information. The one program runs as
bar:bar (that is, as user bar, group bar); the other as
baz:baz. Changing users is not an option, and even changing groups would not be preferable.
I wish to hard link the single configuration file as
/etc/baz/foo. However, this fails because the file must, as far as I know, belong either to
root:bar or to
Potential solution: Create a new group
barbaz whose members are
foo belong to
That looks like a pretty heavy-handed solution to me. Is there no neater, simpler way to share the configuration file
foo between the two programs?
For now, I am maintaining two, identical copies of the file. This works, but is obviously wrong. What would be right?
For information: I have little experience with Unix groups and none with setgid(2).