Trash specification, version 0.1

Alexander Larsson alexl at redhat.com
Mon Aug 30 12:50:57 EEST 2004


On Mon, 2004-08-30 at 10:36, Mikhail Ramendik wrote:
> > > It may also choose to create .Trash directories in Top directories of 
> > > some mounted file systems. How these directories are created (by the 
> > > system administrator, a daemon, etc.) is determined by the 
> > > implementation.
> > 
> > Not determined by the implementation. Determined by the spec, but not
> > finished yet.
> 
> I'm not sure one should predefine this. There are different systems,
> with different levels of system administrator involvement, and different
> security requirements. On a tightly administered corporate network,
> creation-by-sysadmin is best. On a loosely administered university
> network, creation-by-daemon might work wonders. 

It depends quite a bit on what model of .Trash directories we choose,
see the current discussion on that.

> > The spec says "$topdir/.Trash/user". I'd prefer "$topdir/.Trash/$uid",
> > since it contains no strange characters, and the filesystem permissions
> > are tied to the uid, not the username which can change. (The uid is the
> > numerical id of the user)
> 
> But might this create a problem with removable devices, and with some
> cases of shared network resources? As far as I understand, $uid is
> usually machine-specific. The same user can have different $uid values
> on different computers, even in the same environment (especially if no
> centralised logon is implemented).

It depends. On centralized systems, the uid is the same. On
decentralized single user systems the main uid is typically always the
same (500 on all redhat derivates for instance), which is nice for
removable devices. It also creates no problem with encoding of the
filename (the username might have length/characters/whatever not
representable on the filesystem). Furthermore, on a filesystem with
permissions saved, even if the usernames and the directory names are the
same, one cannot use the same trash dir unless the uid is the same,
because you won't own the trash dir, so with uid as name, we share the
trashname in exactly the case where it will work.

Of course, in the case of a filesystem without permissions and same
username but different uids, using the username (if it can be used as a
directory name on the filesystem) works better.

I prefer the uid approach.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl at redhat.com    alla at lysator.liu.se 
He's a suicidal voodoo master criminal gone bad. She's a tortured winged safe 
cracker with her own daytime radio talk show. They fight crime! 




More information about the xdg mailing list