group ownership

group ownership

Post by AJS » Fri, 13 Dec 2002 02:09:06



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

 
 
 

group ownership

Post by Sylvain Robitaill » Fri, 13 Dec 2002 04:03:13



> 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.

Quote:> 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...

--
----------------------------------------------------------------------

Systems analyst                                   Concordia University
Instructional & Information Technology        Montreal, Quebec, Canada
----------------------------------------------------------------------

 
 
 

group ownership

Post by Ann Majesk » Sun, 15 Dec 2002 03:05:02


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.

 
 
 

1. user ownership and group ownership

What is the difference between user ownership and group ownership.
For example: I have a user Admin ang group staff ( Admin is not a
menmber of staff ).
chown Adm myfile
chgrp staff myfile
Which privilegies will be available for Adm, and which for user after
those two commands?

Sent via Deja.com
http://www.deja.com/

2. iBCS and SCO 3.2.2 Binaries

3. group ownerships

4. Kernel Panic! After defrag!

5. group ownership

6. Lightweight web-server for router managment

7. Cannot change group ownership of /dosd

8. gprof-debugger extensions

9. change user and group ownership of a child process...

10. ttyp* group ownership and permissions changing

11. Changing group ownership (for Apache)

12. What the logic to group ownership?

13. ls - not displaying group ownerships