* group ownership
@ 2002-12-11 17:09 AJS
2002-12-11 19:03 ` Sylvain Robitaille
2002-12-13 18:05 ` Ann Majeske
0 siblings, 2 replies; 3+ messages in thread
From: AJS @ 2002-12-11 17:09 UTC (permalink / raw)
Hi all
I'm getting strange (to me at least) group ownership on files created within
a directory.
If the pwd is in group users, any file I create is also in group users, not
in my default group.
This happens on all our Alpha boxes running a mixture of 4.0f upto 5.1a
When I do the same on some linux boxes, I get the behaviour I expect ie the
new
file has group ownership of my default group.
I've done a google search and found some articles that discuss this
behaviour but
have not found anything that will get it to work the way I want
Any ideas
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: group ownership
2002-12-11 17:09 group ownership AJS
@ 2002-12-11 19:03 ` Sylvain Robitaille
2002-12-13 18:05 ` Ann Majeske
1 sibling, 0 replies; 3+ messages in thread
From: Sylvain Robitaille @ 2002-12-11 19:03 UTC (permalink / raw)
AJS wrote:
> If the pwd is in group users, any file I create is also in group
> users, not in my default group.
> This happens on all our Alpha boxes running a mixture of 4.0f upto
> 5.1a
That's right. I once had a user who reported (and demonstrated) that
under certain circumstances (which I never quite got a good handle on
what those were), he was able to create setgid files belonging to the
group that owns the directory, even if he wasn't a member of that group.
I confirmed this behaviour, at the time, on 4.0e, but was not able to
narrow down what the circumstances leading to it were. I'm fairly
certain it involved creating a tar containing setgid files on a Linux
machine, then copying it to and untarring it on the DEC machine, but I
wasn't able to duplicate it myself, and my user couldn't always make it
happen the same way. I've not tested on more recent versions of the OS.
Ever since, on all our systems, /tmp (see also /var/tmp, among others),
which used to be owned by group "system" is now owned by group "nobody".
I recommend others do the same.
> When I do the same on some linux boxes, I get the behaviour I expect
> ie the new file has group ownership of my default group.
Not every OS deals with group ownership of new files in the same way.
I'm fairly certain (but you want to check me on this) that if you set
the setgid bit on the directory in Linux, it will exhibit to the same
behaviour as on your DEC system.
I realize this doesn't help explain the behaviour, but I hope it at
least helps you work with it...
--
----------------------------------------------------------------------
Sylvain Robitaille syl@alcor.concordia.ca
Systems analyst Concordia University
Instructional & Information Technology Montreal, Quebec, Canada
----------------------------------------------------------------------
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: group ownership
2002-12-11 17:09 group ownership AJS
2002-12-11 19:03 ` Sylvain Robitaille
@ 2002-12-13 18:05 ` Ann Majeske
1 sibling, 0 replies; 3+ messages in thread
From: Ann Majeske @ 2002-12-13 18:05 UTC (permalink / raw)
From the open/creat(2) man page:
File Status Flags
The file status flags, which specify file open processing, are as follows:
O_CREAT
If the file exists, this flag has no effect, except as described under
the O_EXCL flag. If the file does not exist, a regular file is created
with the following characteristics:
+ The owner ID of the file is set to the effective user ID of the
process.
+ The group ID of the file is set to the group ID of its parent
directory.
However, when the vfs subsystem attribute sys_v_mode is set to 1,
the group ID of the file is set either to the group ID of the pro-
cess or, if the S_ISGID bit of the parent directory is set, to the
group ID of the parent directory.
If the group ID of the new file does not match the process's
effective group ID or one of its supplementary group IDs, the
S_ISGID bit of the new file is cleared.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-12-13 18:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-11 17:09 group ownership AJS
2002-12-11 19:03 ` Sylvain Robitaille
2002-12-13 18:05 ` Ann Majeske
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox