Re: 666 permissions broken (2.2.10ac12,2.2.11pre2)

David C. Troy (dave@toad.net)
Tue, 20 Jul 1999 19:19:38 -0400 (EDT)


Tested, works in my environment. Thanks for the quick patch. I shudder
to think about this bug getting out in 2.2.11. :)

Dave

=====================================================================
David C. Troy [dave@toad.net] 410-544-6193 Sales
ToadNet - Internet for people like you. 410-544-1329 FAX
570 Ritchie Highway, Severna Park, MD 21146-2925 www.toad.net

On Wed, 21 Jul 1999, Alan Cox wrote:

> > Thanks for the reply. I found it odd too. Let me know if you find
> > anything.
>
> Got it. I'm very glad you found that 8)
>
>
> --- fs/ext2/inode.c.old Tue Jul 20 06:23:19 1999
> +++ fs/ext2/inode.c Wed Jul 21 05:55:27 1999
> @@ -707,15 +707,18 @@
> unsigned int flags;
>
> retval = -EPERM;
> - if (iattr->ia_valid & ATTR_ATTR_FLAG &&
> - ((!(iattr->ia_attr_flags & ATTR_FLAG_APPEND) !=
> + if (iattr->ia_valid & ATTR_ATTR_FLAG)
> + {
> + if((!(iattr->ia_attr_flags & ATTR_FLAG_APPEND) !=
> !(inode->u.ext2_i.i_flags & EXT2_APPEND_FL)) ||
> - (!(iattr->ia_attr_flags & ATTR_FLAG_IMMUTABLE) !=
> - !(inode->u.ext2_i.i_flags & EXT2_IMMUTABLE_FL)))) {
> + (!(iattr->ia_attr_flags & ATTR_FLAG_IMMUTABLE) !=
> + !(inode->u.ext2_i.i_flags & EXT2_IMMUTABLE_FL))) {
> if (!capable(CAP_LINUX_IMMUTABLE))
> goto out;
> - } else if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
> + }
> + else if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
> goto out;
> + }
>
> if (iattr->ia_valid & ATTR_SIZE) {
> off_t size = iattr->ia_size;
>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/