Commit 39ed9c29 authored by Dan Williams's avatar Dan Williams

core: get D-Bus manager during auth if not provided

parent 1b219493
......@@ -20,6 +20,7 @@
#include "nm-manager-auth.h"
#include "nm-logging.h"
#include "nm-dbus-manager.h"
#include <dbus/dbus-glib-lowlevel.h>
#include <string.h>
......@@ -325,9 +326,14 @@ nm_auth_get_caller_uid (DBusGMethodInvocation *context,
DBusError dbus_error;
g_return_val_if_fail (context != NULL, FALSE);
g_return_val_if_fail (dbus_mgr != NULL, FALSE);
g_return_val_if_fail (out_uid != NULL, FALSE);
if (!dbus_mgr) {
dbus_mgr = nm_dbus_manager_get ();
g_assert (dbus_mgr);
} else
g_object_ref (dbus_mgr);
*out_uid = G_MAXULONG;
sender = dbus_g_method_get_sender (context);
......@@ -356,6 +362,7 @@ nm_auth_get_caller_uid (DBusGMethodInvocation *context,
success = TRUE;
out:
g_object_unref (dbus_mgr);
g_free (sender);
return success;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment