File create permissions, what am I missing?

João Carlos Mendes Luis jonny at jonny.eng.br
Fri Aug 12 21:34:22 GMT 2005


In a directory with -rwxrwxrwx, any user can create files, but who should be the 
owner/group of this file?

Long time ago in Unix history, the owner would be the user who created the file, 
and the group would be the users's primary group.

Later, IIRC, if the directory group was one of the user's secondary groups, the 
file would also be from this group.

A later modification defined that a setgid directory would effect in all files 
created belonging to the directory's user.

Am I correct?

But I have already tested 3 system, 2 with 5-stable and 1 with 4-stable, in 
which the created file inside a -rwxrwxrwx directory is created belonging to the 
directory's group, WITHOUT the setgid bit.  What did I miss?



More information about the freebsd-hackers mailing list