libxfce4util broken(was: Xffm creates bad files)

Benedikt Meurer benedikt.meurer at unix-ag.uni-siegen.de
Wed Mar 31 20:42:35 CEST 2004


edscott wilson garcia wrote:
> El mar, 30-03-2004 a las 14:03, Benedikt Meurer escribió:
> 
>>Olivier Fourdan wrote:
>>
>>>Edscott,
>>>
>>>A question that pops in my mind (ie I did not dig into the code), did
>>>you free the returned value? I think it should not be freed. But again,
>>>I did not even look at the code, so I have no idea of what I'm talking
>>>about.
>>
>>No, Edscott is right. The problem is in libxfce4util. Appended a simple 
>>program that illustrates the problem. I've done some debugging on this, but I 
>>haven't figured out whats wrong so far. Both xfce_get_userfile_r and 
>>xfce_get_homefile_r seem to be broken. The code is quite simple, but for some 
>>reason I cannot seem to find the problem. Any help would be appreciated.
> 
> For xfce_get_userfile_r() I think it might be best to change the way the
> function works and make it return a gchar* which should be freed by the
> user when no longer needed. 

Theres already xfce_get_{home,user}file for this purpose.

> Or if a const gchar* is possible by an inline macro, use that instead. 
> For a home directory this works as a const gchar* and never returns
> NULL:
> #define XFCE_HOME (g_get_home_dir()?g_get_home_dir():g_get_tmp_dir())

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.

> That's more the way gtk and glib work and it makes for easier coding.
> just my $0.02. If you want me to fix the library I'll proceed that way.

I see two possibilites: Either we fix xfce_get_{user,home}file_r, or we remove 
it from libxfce4util.

Benedikt

-- 
NetBSD Operating system:                       http://www.NetBSD.org/
pkgsrc "Work in progress":                  http://pkgsrc-wip.sf.net/
XFce desktop environment:                        http://www.xfce.org/
German Unix-AG Association:                   http://www.unix-ag.org/
os-network:                                 http://www.os-network.de/

OpenPGP Key: http://www.home.unix-ag.org/bmeurer/#gpg




More information about the Xfce4-dev mailing list