lxsession-logout - dbus-interface.c - Wrong logic condition
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxsession (Ubuntu) |
Fix Committed
|
Undecided
|
Unassigned |
Bug Description
Tool: lxsession-logout
File: dbus-interface.c
Line: 192 (function systemd_query)
===============
if (g_variant_
{
}
g_variant_unref (result);
return function_result;
===============
If result is "no" g_strcmp0 return "-1" as per documentation function and conditial if is satisfied.
____________
g_strcmp0 ()
int g_strcmp0 (const char *str1, const char *str2);
Compares str1 and str2 like strcmp(). Handles NULL gracefully by sorting it before non-NULL strings. Comparing two NULL pointers returns 0.
str1 :
a C string or NULL
str2 :
another C string or NULL
Returns :
-1, 0 or 1, if str1 is <, == or > than str2.
Since 2.16
_______________
Correct Line 192 is:
WRONG
if (g_strcmp0 (str, "yes") || g_strcmp0 (str, "challenge"))
RIGHT:
if ( g_strcmp0 (str, "yes") == 0 || g_strcmp0 (str, "challenge") == 0 )
According to this thread - http:// sourceforge. net/p/lxde/ bugs/616/
This fix was committed to the git repo in November 2014.