Hi folks, I've been reading the libfshelp library and it appears that I've found a little bug on it. In the function fshelp_iscontroller, which checks if an user controls the filesystem based on the stat struct, it checks the presence of std_uid in the uid's vector two times and it doesn't for the root uid. The attached file should fix this.
Index: perms-iscontroller.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libfshelp/perms-iscontroller.c,v
retrieving revision 1.1
diff -u -r1.1 perms-iscontroller.c
--- perms-iscontroller.c 3 Jul 2001 01:10:17 -0000 1.1
+++ perms-iscontroller.c 27 Jun 2008 22:06:00 -0000
@@ -30,7 +30,7 @@
{
/* Permitted if USER has the superuser uid, the owner uid or if the
USER has authority over the process's effective id. */
- if (idvec_contains (user->uids, st->st_uid)
+ if (idvec_contains (user->uids, 0)
|| idvec_contains (user->uids, st->st_uid)
|| idvec_contains (user->uids, geteuid ()))
return 0;
Cheers,
Flávio Cruz.
fshelp-perms-iscontroller.patch
Description: Binary data
