From 82f74aa895d25440ebc323842c4fa6c6601fb930 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Fri, 15 Jan 2016 20:08:34 +0100 Subject: [PATCH 1/2] a_dbus_convert_value(): Be less strict about wrong strings The code doesn't check the type of any of the values that it converts. However, string elements are silently skipped if they cannot be converted. The proper fix would be to make this code check types. For now, it will be ok to "convert" non-strings to an empty string. Signed-off-by: Uli Schlachter --- dbus.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dbus.c b/dbus.c index c0e0cf6a..d6323ace 100644 --- a/dbus.c +++ b/dbus.c @@ -319,8 +319,9 @@ a_dbus_convert_value(lua_State *L, int idx, DBusMessageIter *iter) case dbustype: \ { \ const char *s = lua_tostring(L, idx + 1); \ - if(s) \ - dbus_message_iter_append_basic(iter, dbustype, &s); \ + if(!s) \ + s = ""; \ + dbus_message_iter_append_basic(iter, dbustype, &s); \ } \ break; DBUS_MSG_RETURN_HANDLE_TYPE_STRING(DBUS_TYPE_STRING) From 1367968824b11689b5005f07f3f5f05b67094fc9 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Fri, 15 Jan 2016 20:12:19 +0100 Subject: [PATCH 2/2] naughty: Don't try to parse our version number The code here doesn't always work, so it's best to just don't mess with awesome.version, but return it directly. Fixes: https://github.com/awesomeWM/awesome/issues/569 Signed-off-by: Uli Schlachter --- lib/naughty/dbus.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/naughty/dbus.lua b/lib/naughty/dbus.lua index 36f9c927..9673393a 100644 --- a/lib/naughty/dbus.lua +++ b/lib/naughty/dbus.lua @@ -195,8 +195,8 @@ capi.dbus.connect_signal("org.freedesktop.Notifications", function (data, appnam naughty.destroy(obj, naughty.notificationClosedReason.dismissedByCommand) end elseif data.member == "GetServerInfo" or data.member == "GetServerInformation" then - -- name of notification app, name of vender, version - return "s", "naughty", "s", "awesome", "s", capi.awesome.version:match("%d.%d"), "s", "1.0" + -- name of notification app, name of vender, version, specification version + return "s", "naughty", "s", "awesome", "s", capi.awesome.version, "s", "1.0" elseif data.member == "GetCapabilities" then -- We actually do display the body of the message, we support , -- and in the body and we handle static (non-animated) icons.