Making inheritance of group ID configurable
New items created on an ufs normally inherit their group ID from the parent directory. I have the need for making this configurable. Since the set-group-ID bit is not used for directories on BSD, I would like to use it to decide on this: If it is set, the group ID of the newly created item corresponds to the one of the creating process. (Yeah, this is exactly the wrong way around compared to what the Others do but I don't want to change the BSD default). I am currently using this patch. It seems to work great but I would like to know if I have forgotten something ;-) --- sys/ufs/ufs/ufs_vnops.c.ORI Fri Jan 3 08:41:47 2003 +++ sys/ufs/ufs/ufs_vnops.c Mon Feb 9 16:32:46 2004 @@ -1276,6 +1276,11 @@ if (error) goto out; ip = VTOI(tvp); +#ifdef ANDRE + if( (dp-i_mode ISGID) ) + ip-i_gid = cnp-cn_cred-cr_gid; + else +#endif ip-i_gid = dp-i_gid; #ifdef SUIDDIR { @@ -2070,6 +2075,11 @@ if (error) return (error); ip = VTOI(tvp); +#ifdef ANDRE + if( (pdir-i_mode ISGID) ) + ip-i_gid = cnp-cn_cred-cr_gid; + else +#endif ip-i_gid = pdir-i_gid; #ifdef SUIDDIR { Any hints are welcome. Thanks, -Andre ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Making inheritance of group ID configurable
On Mon, Feb 09, 2004 at 05:10:59PM +0100, Andre Albsmeier wrote: New items created on an ufs normally inherit their group ID from the parent directory. I have the need for making this configurable. Since the set-group-ID bit is not used for directories on BSD, I would like to use it to decide on this: If it is set, the group ID of the newly created item corresponds to the one of the creating process. (Yeah, this is exactly the wrong way around compared to what the Others do but I don't want to change the BSD default). Would making this a filesystem option be a good idea? You could have the default behaviour be as always and an option that makes the filesystem behave as you've described. David. ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Making inheritance of group ID configurable
On Mon, 09-Feb-2004 at 16:45:11 +, David Malone wrote: On Mon, Feb 09, 2004 at 05:10:59PM +0100, Andre Albsmeier wrote: New items created on an ufs normally inherit their group ID from the parent directory. I have the need for making this configurable. Since the set-group-ID bit is not used for directories on BSD, I would like to use it to decide on this: If it is set, the group ID of the newly created item corresponds to the one of the creating process. (Yeah, this is exactly the wrong way around compared to what the Others do but I don't want to change the BSD default). Would making this a filesystem option be a good idea? You could have the default behaviour be as always and an option that makes the filesystem behave as you've described. Possibly. I intentionally didn't suggest this since I wanted to attract people to the technical aspects (and the correctness) of the patch and not to the political opinions :-). -Andre David. -- In a world without walls and fences, who needs windows and gates? ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]