Re: gnome-vfs HACKING file



On Fri, 2003-09-12 at 09:12, Alexander Larsson wrote:
> > > Originally, I wrote the attached patch which fixes a bug in
> > > gnome_vfs_file_info_matches: the permissions field was not correctly
> > > tested during matching. This caused a rather hard-to-reproduce
> > > timing-related bug in the nautilus permissions property dialog.
> > > 
> > > This patch is against gnome-vfs cvs HEAD. This bug is present in the
> > > gnome 2.4 release.
> 
> In general this patch might likely be right. However I still like to
> understand what happened that caused problems? How come you ended up
> comparing two file_infos that were identical, except for the
> permissions? 

If you are changing the permission on a file through
nautilus_file_set_permissions, the NautilusFile which contains a copy of
the old permission is not an accurate representation of the underlying
file once the underlying file has changed. As such, it must be updated.
Update is done in nautilus-file.c:update_info_internal, line 1327. Here,
NautilusFile makes sure the two file info structure do not match before
updating its local copy.

> 
> These file_infos were probably from the same file at two times after the
> permissions changed, so one could argue that in some sense they "match",
> since the contents of the file is identical.
> 
> If we need to handle permissions like this when matching them, don't we
> need to look at uid, gid, and possibly other things too? In some way,
> isn't this changing the semantics of file_info matching, turning it onto
> an equals function?

Probably. I have no idea how bad such a change would be though. I guess
at worst, it would decrease performance of a few applications.

regards,
Mathieu
-- 
Mathieu Lacage <mathieu gnu org>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]