utimes() with vfat is problematic
From: Jan Engelhardt
Date: Tue Jul 10 2007 - 05:47:56 EST
Hi,
vfat does not know about ownership, hence the files are always owned by the
vfat mounter (or whatever the uid= option specified). Which brings
a problem to userspace programs trying to utime() but which do not
run as the same user as the vfat mounter, because:
fs/attr.c:53
ret = -EPERM;
[...]
/* Check for setting the inode time. */
if (ia_valid & (ATTR_MTIME_SET | ATTR_ATIME_SET)) {
if (current->fsuid != inode->i_uid && !capable(CAP_FOWNER))
goto error;
}
To trigger the problem:
# mount /somevfat -o umask=0,uid=root
$ touch -d "2005-05-05" /somevfat/myfile
I am not sure how this could be dealt with besides passing -o quiet to
mount.vfat. Any ideas?
Jan
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/