summaryrefslogtreecommitdiff
path: root/src/nm-dbus-manager.h
AgeCommit message (Collapse)AuthorFilesLines
2015-03-13dbus-manager: add nm_dbus_manager_setup() function for testingThomas Haller1-0/+1
(cherry picked from commit 9b16e85ecef0515e7050b5b61997cca5392dce23)
2014-07-23core: fill in nm-types.h, clean out other headersDan Winship1-2/+4
Clean up some of the cross-includes between headers (which made it so that, eg, if you included NetworkManagerUtils.h in a test program, you would need to build the test with -I$(top_srcdir)/src/platform, and if you included nm-device.h you'd need $(POLKIT_CFLAGS)) by moving all GObject struct definitions for src/ and src/settings/ into nm-types.h (which already existed to solve the NMDevice/NMActRequest circular references). Update various .c files to explicitly include the headers they used to get implicitly, and remove some now-unnecessary -I options from Makefiles.
2013-10-31core: grab remote process id when authenticating D-Bus clientsDan Williams1-2/+4
2013-05-20core: make nm-properties-changed-signal always export the right propertiesDan Winship1-0/+4
Change the way that nm-properties-changed-signal works, and parse the dbus-binding-tool-generated info to get the exact list of properties that it's expected to export. This makes NM_PROPERTY_PARAM_NO_EXPORT unnecessary, and also fixes the problem of properties like NMDevice:hw-address being exported on classes where it shouldn't be.
2013-04-08core: add DBus Proxy creation helperDan Williams1-0/+6
We need to use dbus_g_proxy_new_for_peer() when creating a proxy for private service connections.
2013-04-08core: route dbus_bus_get_unix_user() through NMDBusManagerDan Williams1-0/+4
Since dbus senders are faked for private connections, we can't just call dbus_bus_get_unix_user() on fake senders. They need to be checked against the NMDBusManager's list of private connections first.
2013-04-08core: add caller info functions to DBusManagerDan Williams1-0/+11
Because the DBusManager is the thing that knows about private connections, it's the thing best positioned to get caller details like sender and UID.
2013-04-08core: add a root-only private D-Bus socketDan Williams1-2/+14
For cases where NM may run without a bus daemon in root-only environments, like an initramfs. For disconnection, since private connection just get a disconnect message instead of NameOwnerChanged signals broadcast by a bus daemon, just synthesize the NameOwnerChanged signals using our fake owner name. It's just easier to do this rather than modify any code that cares about disconnects. Note that the new private socket is only enabled if built with dbus-glib >= 0.100 as there are bugs in previous versions in the implementation of dbus_g_proxy_new_for_peer() which clients must use to talk to the private socket.
2013-04-08core: add nm_dbus_g_method_invocation_get_g_connection()Dan Williams1-0/+5
This method exists in dbus-glib >= 101, but if it doesn't, emulate it. See https://bugs.freedesktop.org/show_bug.cgi?id=55729
2013-04-08core: use wrappers for DBus object registration/unregistrationDan Williams1-0/+6
When providing a service on the bus daemon and a private connection, we'll need to track objects so we can register them with the private connection too. Thus all registration/unregistration calls have to go through the NMDBusManager, not straight to dbus-glib.
2011-03-14build: do the right thing with config.h (bgo #644664)Kjartan Maraas1-1/+0
1) it shouldn't be included in headers 2) it should be the first thing included in source files 3) it's needed for getting translation right
2010-12-10core: use #defines for NMDBusManager signal namesDan Williams1-0/+3
Helps catch typos at compile time instead of runtime.
2008-11-212008-11-21 Dan Williams <dcbw@redhat.com>Dan Williams1-1/+2
* src/nm-dbus-manager.c src/nm-dbus-manager.h - (nm_dbus_manager_get_name_owner): return error * src/nm-manager.c - (impl_manager_activate_connection): perform additional validation on ActivateConnection calls of user connections - (is_user_request_authorized): ensure that the requestor is the same UID as the UID that owns the user settings service; users shouldn't be able to control another user's connections git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4325 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-032008-11-02 Dan Williams <dcbw@redhat.com>Dan Williams1-10/+10
* Add license headers to everything in src/ git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4247 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-06-262008-06-26 Dan Williams <dcbw@redhat.com>Dan Williams1-4/+4
* Update FSF address in license headers (Michael Biebl <biebl@debian.org>) git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3775 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-11-272007-11-27 Dan Williams <dcbw@redhat.com>Dan Williams1-1/+1
* src/nm-dbus-manager.h src/nm-hal-manager.c - Include the correct headers now that NetworkManagerDbusUtils.h doesn't do it for them * src/Makefile.am src/NetworkManagerDbusUtils.c src/NetworkManagerDbusUtils.h - Remove these two source files; they are unused git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3111 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-10-102007-10-10 Tambet Ingo <tambet@gmail.com>Tambet Ingo1-9/+0
Move ppp-manager over to dbus-glib. The big deal is that it was the last piece of code that used NM's own version of dbus signal handling and custom dictionary marshalling/unmarshalling. With this change, all that obsolete code can disappear and we get to maintain over 2000 lines less code. * libnm-util/dbus-dict-helpers.c: * libnm-util/dbus-dict-helpers.h: Remove. * src/ppp-manager/nm-pppd-plugin.c: Convert it to use dbus-glib. * src/ppp-manager/nm-pppd-plugin.xml: Implement. * src/ppp-manager/nm-ppp-manager.c: Use dbus-glib instead of * home-brewed dbus signal handlers. * src/nm-dbus-manager.c: Remove all the manual dbus signal * handling. * configure.in: Remove test/libnm-util/Makefile creation. * test/Makefile.am: Remove libnm-util from SUBDIRS. * test/libnm-util/: Remove the whole directory. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2965 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-09-122007-09-12 Tambet Ingo <tambet@gmail.com>Tambet Ingo1-1/+0
* src/vpn-manager/nm-vpn-connection.[ch]: * src/vpn-manager/nm-vpn-manager.[ch]: * src/vpn-manager/nm-vpn-service.[ch]: Rewrite the vpn handling * code. Using dbus-glib, GObjects, signals etc. * libnm-glib/nm-vpn-manager.[ch]: * libnm-glib/nm-vpn-connection.[ch]: Now that the NM * implementation changed so much, rewrite these too. * libnm-glib/Makefile.am: Add new files to build, build new * binding files for the new introspection files. * libnm-glib/nm-client.[ch]: Remove all VPN related stuff from * here. * libnm-glib/nm-dbus-utils.[ch]: Renamed from nm-utils.[ch] that * was shadowing the header with the same name from libnm-utils. * libnm-glib/nm-vpn-plugin.[ch]: Implement. * libnm-util/Makefile.am: Add nm-utils.[ch] to build. * introspection/nm-vpn-plugin.xml: Implement. * introspection/nm-vpn-connection.xml: Implement. * introspection/nm-vpn-manager.xml: Implement. * src/NetworkManagerSystem.c * (nm_system_vpn_device_set_from_ip4_config): Remove the named manager argument, it can just as easily get it as the caller. (nm_system_vpn_device_unset_from_ip4_config): Ditto. * src/vpn-manager/nm-dbus-vpn.[ch]: Remove. * src/nm-dbus-manager.h: Fix up the name_owner signal signature. * src/dhcp-manager/nm-dhcp-manager.c (garray_to_string): Remove, * use one from libnm-utils. * libnm-util/nm-connection.c: Ditto. * src/NetworkManagerMain.h: Remove, it's finally empty. * configure.in: Remove utils/ from build. * include/NetworkManagerVPN.h: Add some more defines to reduce * the amount of hard-coded strings. * utils/: Move it over to libnm-util. * test/Makefile.am: Link against libnm-util now that util/ is * gone. * dispatcher-daemon/Makefile.am: Ditto. * src/Makefile.am: Ditto. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2798 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-02-122007-02-12 Tambet Ingo <tambet@ximian.com>Tambet Ingo1-3/+0
Totally break NetworkManager. Please use 0.6 branch until futher notice. * src/: - Remove old low-level dbus interface implementations and replace them with dbus-glib one. * configure.in: - Require dbus-glib >= 0.72. - Plug in new sources to build. * libnm-glib/: - Implement GObject wrappers on top of DBUS glib auto-generated bindings to make it more convenient to use from GObject based programs. * introspection/: - Implement DBUS XML introspection files, used by both NM and libnm-glib. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2309 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-02-022007-02-02 Tambet Ingo <tambet@ximian.com>Tambet Ingo1-11/+5
* src/nm-dbus-manager.c: * src/nm-dbus-manager.h: - Convert all internal DBUS code to use dbus-glib bindings. - Remove GObject properties, we don't need them here. - Don't explicitly set things to NULL after freeing, glib is happy to do it if asked nicely (G_DEBUG=gc-friendly). - Make public API argument checks type safe. - Remove unnecessary (and wrong) cast to GObject for the first argument to g_signal_* calls - The first argument is a gpointer. - Export DBusGConnection to other cool classes that (are going to) use dbus-glib. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2260 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-01-042007-01-04 Dan Williams <dcbw@redhat.com>Dan Williams1-1/+1
Threading removal related cleanups: - Use the glib default main context. Remove the device main context member from NMDevice, and the main_context member from NMData. Change all the idle and timeout scheduler functions to use plain g_idle_add() and g_timeout_add(). - As a side-effect of the first change, nm_dbus_manager_get() no longer takes an argument; fix that up too. - Remove all locking, which is useless since we no longer use threads. For example, nm_get_device_by_iface_locked() has been removed. The global device list lock, the AP List lock, and all static locks in NetworkManagerPolicy.c have been removed. The locking utility functions in NetworkManagerUtils.c have also been removed. - Other cleanups in spacing and code style git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2205 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-11-252006-11-25 Dan Williams <dcbw@redhat.com>Dan Williams1-2/+2
Rework DBus manager signal handling to be more flexible. Previously, only one signal handler could be registered for a particular interface. The DBus manager now reference counts DBus bus matches and allows multiple clients to register signal handlers for the same interface and sender. * src/NetworkManager.c - (main): track NMI signal handler ID and remove it when we quit * src/NetworkManagerMain.h - Keep track of NMI signal handler ID * src/nm-dbus-manager.c src/nm-dbus-manager.h - rework signal handling; each signal handler references one signal match, but a signal match may be referenced by one or more signal handlers. Matches are refcounted and are destroyed when the last signal handler that references the match is removed. This is necessary because two signal handlers may end up requiring the same dbus bus match, so the match must live until the last signal handler is destroyed (for example, with the wpa_supplicant network interface dbus interface). * src/dhcp-manager/nm-dhcp-manager.c - (nm_dhcp_manager_new): track DHCP signal handler id - (nm_dhcp_manager_dispose): remove DHCP signal handler * src/vpn-manager/nm-vpn-service.c - (nm_vpn_service_add_watch): track VPN service signal handler id - (nm_vpn_service_remove_watch): remove VPN service signal handler git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2124 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-10-132006-10-13 Dan Williams <dcbw@redhat.com>Dan Williams1-0/+96
* Huge DBus refactor: - Create a "DBus Manager" object which manages the connection and sends signals on NameOwnerChanged and connection/disconnection events, handles reconnection to the bus if NM gets kicked off, and abstracts signal handling - Remove DBusConnection members from places where they are no longer needed due to the refactor, like the dbus-connection property of the named manager, and from NMData - Reformats a bunch of the code to gnome style (8-space tabs, braces on same line as statement, 80-col width). Consider it open season to reformat any bits to gnome style. style that aren't already. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2061 4912f4e0-d625-0410-9fb7-b9a5a253dbdc