tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Common chmod and chown routines



On Tue Apr 21 2009 at 13:49:27 +0300, Elad Efrat wrote:
> On Tue, Apr 21, 2009 at 10:29 AM, Andrew Doran <ad%netbsd.org@localhost> 
> wrote:
> 
> > - they belong in genfs.
> > - please call them something like genfs_can_chown, genfs_can_chmod.
> > - please put "vnode_t *vp" first and give to both functions.
> 
> Is genfs_vnops.c an okay location?
> 
> Here are the prototypes after the changes you suggest:
> 
> int
> genfs_can_chmon(vnode_t *vp, kauth_cred_t cred, uid_t cur_uid,
>     gid_t cur_gid, mode_t new_mode)
> 
> int
> genfs_can_chown(vnode_t *vp, kauth_cred_t cred, uid_t cur_uid,
>     gid_t cur_gid, uid_t new_uid, gid_t new_gid)
> 
> Anything else? (kauth_cred_t last, etc.?)

IMHO genfs is a file system layer, not a cesspool.  I'd put this stuff
somewhere completely different.  And definitely somewhere different from
where it was shoved.  And like someone mentioned, vaccess() should be
classified in the same place too.


Home | Main Index | Thread Index | Old Index