GNOME Bugzilla – Bug 721629
if gnome-shell gets an error opening a .../gnome-shell/modes directory it just gives up, greeter not displayed
Last modified: 2015-02-27 00:48:35 UTC
Created attachment 265431 [details] [review] Patch to "fix" the bug in /usr/share/gnome-shell/js/misc/fileUtils.js, function _collectFromDirectoryAsync if a "gnome-shell/modes" directory (/usr/share/gnome-shell/modes, /usr/local/share/gnome-shell/modes ...) exists then listDirAsync is called to read it's contents. If listDirAsync can't open the directory then it just throws an exception, leaving gnome-shell dead in the water. For example: # mkdir /usr/local/share/gnome-shell/modes # chmod a-rx /usr/local/share/gnome-shell/modes now gnome-shell can't display the greeter screen, the user is left with a black screen with an arrow cursor. This is Debian bug 730177. A quick and dirty patch is to add a try/catch in listDirAsync.
Review of attachment 265431 [details] [review]: Style issues pointed out below apart, the patch is no longer relevant for master - the function in question is no longer used for anything and could just be removed altogether. ::: /usr/share/gnome-shell/js/misc/fileUtils.js.orig @@ +11,3 @@ Gio.FileQueryInfoFlags.NONE, GLib.PRIORITY_LOW, null, function (obj, res) { + try { Wrong indentation, and it would be better to use a more minimal try/catch block, e.g. something along the lines of: let enumerator; try { enumerator = obj.enumerate_children_finish(res); } catch { enumerator = null; } [...] if (enumerator != null) enumerator.next_files_async(...); else callback([]);
Created attachment 265860 [details] [review] fileUtils: Remove listDirAsync() It's unused since commit da4238ec681c7, just kill it.
Review of attachment 265860 [details] [review]: I thought it was used for the run dialog, which is why I didn't kill it, but apparently not.
Comment on attachment 265860 [details] [review] fileUtils: Remove listDirAsync() Attachment 265860 [details] pushed as f2912ba - fileUtils: Remove listDirAsync() Leaving open for now, as the fix in attachment 265431 [details] [review] still makes sense in the gnome-3-10 branch ...
John, will you be updating the patch following the review?
I'm currently using gnome shell 3.14, so I can't really test this.
I'll leave this opened for gnome-shell developers to decide whether it's worth fixing in 3.10 and earlier.
I don't see us updating/testing a 3.10 patch at this point, so let's close this.