Mon 2010/Aug/30
-
Christian Hammond has been working on a very cool branch of GtkFileChooser to let you define roots for the file dialog. Normally, this is what my file chooser looks like — it lets me browse anything on my file system:
In the following screenshot, the file chooser has been rooted to show only my $HOME. Note that no volumes or shortcuts that are outsideof my $HOME show up in the shortcuts pane.
The API makes it easy.
GSList *roots; roots = g_slist_append (NULL, "file:///home/federico"); gtk_file_chooser_set_root_uris (chooser, roots);
And in the following example, the filechooser has been constrained to my $HOME and to /tmp:
This is basically the infrastructure we need to support proper lockdown in the file chooser. At some point it may be interesting for sysadmins to say, "don't let users wander in the filesystem, but constrain them to their home directory, the corporate shares and their USB stick".
This is bug 609886 - multiroot support for GtkFileChooser.
The patches are not quite ready yet (in particular, passing a GSList of strings is not very nice for language bindings, I think), but it should be easy to fix for production. Any volunteers?
Syndicated 2010-08-30 14:36:00 from Federico Mena-Quintero - Activity Log