Sunday 11 May 2014

DELL 6400 Integrated Card Reader & Ubuntu (sudo v gksu)

I've written on getting the integrated card reader to work on my Inspiron 6400 before. After changing/re-installing my operating system, this is one of those important/non-urgent jobs that gets done when I need to read a memory card (& usually not before!). However, I have noticed that the fix that I posted last July doesn't persist: that is, if I unmount a card, I can't (always) mount another without rebooting my laptop.

There's a good reason for this: I didn't understand that you should never launch a graphical application from the terminal using the sudo command.

"You should never use normal sudo to start graphical applications as Root. You should use gksudo (kdesudo on Kubuntu) to run such programs. gksudo sets HOME=~root, and copies .Xauthority to a tmp directory. This prevents files in your home directory becoming owned by Root. "
[Source]

It seems that when running a graphical application via the sudo command, the application is granted root privilege but utilizes the users configuration file. Therefore, best practise dictates that, when opening graphical applications with administrator privilege, you should invoke the application using the gksu command.

So, I'm compelled to revise my advice for fixing the integrated card reader on the Inspiron 6400. Open a terminal & then:

gksu gedit /etc/modules

Instead of being prompted for your password in the terminal (as you would if you had invoked Gedit using sudo), a administrative dialog will appear requiring your authentication. Enter your password & click OK to open Gedit as root.

When Gedit opens, add the following code to the bottom of the file:

sm_ftl

This is a better solution than the one posted last year but it is not completely effective (delayed unmounts will sometimes result in a return of the problem behaviour). However, maintaining focus on the file manager whilst swapping out cards generally displays fix persistence.

Sources & References:

No comments:

Post a Comment