* fs/attr.c patch
@ 2011-05-19 11:57 samsonov
2011-05-19 14:50 ` Serge E. Hallyn
0 siblings, 1 reply; 2+ messages in thread
From: samsonov @ 2011-05-19 11:57 UTC (permalink / raw)
To: linux-kernel
--- ./linux-2.6.33.4.orig/fs/attr.c 2010-05-13 02:04:27.000000000 +0400
+++ ./linux-2.6.33.4/fs/attr.c 2011-05-19 15:43:14.533672804 +0400
@@ -35,9 +35,7 @@
/* Make sure caller can chgrp. */
if ((ia_valid & ATTR_GID) &&
- (current_fsuid() != inode->i_uid ||
- (!in_group_p(attr->ia_gid) && attr->ia_gid != inode->i_gid)) &&
- !capable(CAP_CHOWN))
+ !(in_group_p(attr->ia_gid) && is_owner_or_cap(inode)))
goto error;
/* Make sure a caller can chmod. */
I think that fileowner can change group of file.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: fs/attr.c patch
2011-05-19 11:57 fs/attr.c patch samsonov
@ 2011-05-19 14:50 ` Serge E. Hallyn
0 siblings, 0 replies; 2+ messages in thread
From: Serge E. Hallyn @ 2011-05-19 14:50 UTC (permalink / raw)
To: samsonov; +Cc: linux-kernel
But you're removing the ability for a process with CAP_CHOWN to
chgrp all files.
You also change behavior (which may be wrong) when doing chgrp to
which would cause no change but the group is not in_group_p(),
which might break current users.
Quoting samsonov@krista.ru (samsonov@krista.ru):
> --- ./linux-2.6.33.4.orig/fs/attr.c 2010-05-13 02:04:27.000000000 +0400
> +++ ./linux-2.6.33.4/fs/attr.c 2011-05-19 15:43:14.533672804 +0400
> @@ -35,9 +35,7 @@
>
> /* Make sure caller can chgrp. */
> if ((ia_valid & ATTR_GID) &&
> - (current_fsuid() != inode->i_uid ||
> - (!in_group_p(attr->ia_gid) && attr->ia_gid != inode->i_gid)) &&
> - !capable(CAP_CHOWN))
> + !(in_group_p(attr->ia_gid) && is_owner_or_cap(inode)))
> goto error;
>
> /* Make sure a caller can chmod. */
>
> I think that fileowner can change group of file.
>
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-05-19 14:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-19 11:57 fs/attr.c patch samsonov
2011-05-19 14:50 ` Serge E. Hallyn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox