libxfce4util broken(was: Xffm creates bad files)
Brian J. Tarricone
bjt23 at cornell.edu
Thu Apr 1 10:42:40 CEST 2004
Benedikt Meurer wrote:
> edscott wilson garcia wrote:
>
>> El mié, 31-03-2004 a las 12:42, Benedikt Meurer escribió:
>>
>>> This does not seem to be a sane solution. An application should exit
>>> with an error message if it is unable to determine the users home
>>> directory. Everything else is wrong and IMHO dangerous.
>>
>> To exit is a bit too drastic for me. Not being able to determine the
>> home directory should not be dangerous. As you suggested some days ago,
>> you cannot take away the wheels of a car so that drivers will not crash.
>> The application should know what to do if it gets NULL for a home
>> directory, otherwise, IMHO, it's a crappy application.
>
> If an application is unable to determine my homedir and uses /tmp
> instead, I would consider this dangerous. Esp. if the application does
> not notify my of that fact. Imagine, you have an application that
> saves sensitive data, you feel quite safe because your home dir is
> 0700 and you trust your admin. Now a problem occurs with the YP
> server, just after you launched your application, and the app will use
> /tmp to store your sensitive data. In terms of security its way better
> to exit the application, than doing probably insecure things.
i agree that a missing homedir should be a fatal error, but i think
there are some usability issues that should be addressed. for example,
if it's a GUI app - esp one that starts with xfce (the panel, desktop,
etc.) - it needs to provide a GUI notification if an error like this
occurs. aside from the annoyance of people filing bug reports saying
"xfce won't start" when it's actually the fault of their system's setup,
it's just good for usability as a whole, IMO. if xfce_get_homedir() and
others abort() on failure, the app itself doesn't have the ability to
display an error. of course, GUI code in libxfce4util is a no-no, so i
don't see an easy, clean solution to this. something like an error
callback interface provided by libxfce4util would work, but that sounds
awfully messy and overkill for such a simple thing.
actually, i suppose one possibility is to first check and see if DISPLAY
is set, and, if so, try running something like:
zenity --error '--text=Fatal: Unable to determine your home directory.
This is likely a system account configuration issue which must be
resolved before trying to run Xfce.'
and fall back to gdialog or xmessage if one or the other doesn't exist
(and then abort()). if there is no DISPLAY, just do a simple g_error()
as usual.
-brian
More information about the Xfce4-dev
mailing list