On Sun, 12 Dec 1999, Andreas Gruenbacher wrote:

> Dear all,
> 
> I would like to bring to your attention the current Linux ACL development
> efforts. AFAIK, there are two competing implementations:
> 
> ACLs for ext2
>   <http://aerobee.informatik.uni-bremen.de/acl_eng.html>
> 
> Posix ACLs for Linux
>   <http://acl.bestbits.at/>
> 
> 
> We have started some discussions about general ACL support for Linux on
> <[EMAIL PROTECTED]> (subscription is via <[EMAIL PROTECTED]>).
> Developers from both projects are now on that list.
> 
> 
> We have also prepared a patch that prepares the kernel for ACL support
> (attached). This patch is against 2.2.13, but umask handling hasn't changed
> until 2.3.31 at least. Please comment.

First of all, why do you need the full permissions? Anyway, _if_ you
really need it - that's not a way to go. Really. Minimal solution would go
along the lines
static inline void init_cred(struct inode *inode, struct task *task,
                             struct inode *parent, int policy, mode_t mode)
{
        inode->i_mode = mode & ~task->fs->umask;
        inode->i_uid = task->fsuid;
        switch(policy) {
                case GID_BSD:
                        inode->i_gid = parent->i_gid;
                        break;
                case GID_MISSEDEMV:
                        if (parent->i_mode & S_ISGID)
                                inode->i_gid = parent->i_gid;
                        else
                                inode->i_gid = task->fsgid;
        }
        if (S_ISDIR(mode) && parent->i_mode & S_ISGID)
                inode->i_mode |= S_ISGID;
}

and foo_new_inode() should call it. 

Reply via email to