Commit Graph

277 Commits

Author SHA1 Message Date
Dan Williams
0ba142690a build: make sure nm-secret-agent.xml gets into the tarball 2011-02-02 21:39:03 -06:00
Dan Williams
77239854f4 agents: send system-owned secrets to the agent if it has 'modify' permission
If we can authenticate the agent for 'modify' permission, then send
any existing system secrets to it as the user has permission to change
those secrets.  This means the agent doesn't have to call GetSecrets()
itself, which means simpler code on the agent side for a slight LoC
hit in NM itself.

This also moves the permissions checking into the NMAgentManager to
check each agent, which is sub-optimal since now the agent manager
has to do PolicyKit stuff, but hey that's life.  Agents need secrets,
and we do need to authenticate every agent before we send secrets to
them, and the NMSettingsConnection doesn't know about individual
agents at all.
2011-02-02 16:19:15 -06:00
Dan Williams
570c0eb2df settings: implement deleting secrets from agents when connection is deleted 2011-01-31 23:33:46 -06:00
Dan Williams
b3959aefa3 core: rename NMSysconfigConnection -> NMSettingsConnection 2011-01-26 11:38:12 -06:00
Dan Williams
d1979ba63e secrets: simplify GetSecrets call flow
The Settings.Connection interface is now only provided by NetworkManager
itself since there is only one settings service.  NM can validate
requests for secrets internally and thus there's no need to lock down
GetSecrets using a separate D-Bus interface, since PolicyKit provides
that functionality on systems where this is desirable (ie multi-user).
Single-user systems that do not have PolicyKit will inherently trust
the user already, or if not D-Bus auth is flexible enough to lock
down the GetSecrets method individually even if it's not on a separate
D-Bus interface.

Second, since only clients like connection editors or applets will be
calling the GetSecrets method, there's no need for 'hints' or
'request_new' arguments here since this  method should never trigger
an interactive secrets request.  Only NM should send those requests
when it knows it needs to ask the user, either during connection or
after validating the incoming GetSecrets request.  A connection editor
type application should never be able to trigger the normal
"What's your passphrase" dialog thats provided by the secret agent
for that user's session.
2011-01-26 10:17:07 -06:00
Dan Williams
b7259fd2a8 Merge remote branch 'origin/master' into rm-userset 2011-01-25 15:41:03 -06:00
Dan Williams
bc6fc7b910 vpn: fix VPN active connection D-Bus API handling (bgo #569294)
Due to limitations in dbus-glib, where one GObject cannot have more
than one introspection XML object attached to it, we used to include
more than one <interface> in the VPNConnection object introspection
XML.  This was suboptimal for two reasons:

1) it duplicated the Connection.Active introspection XML which
made it harder for clients to use the introspection data in a
dynamic fashion, besides looking ugly in the docs

2) not many other programs use this feature of dbus-glib, which
means it didn't get a lot of testing, and broke, which sucks
for NM.

To fix this issue, create a base class for NMVpnConnection that
handles the Connection.Active API, and make NMVpnConnection itself
handle just the VPN pieces that it layers on top.  This  makes
dbus-glib happy because we aren't using two <interface> blocks
in the same introspection XML, and it makes the NM code more
robust because we can re-use the existing Connection.Active
introspection XML in the NMVpnConnectionBase class.
2011-01-25 12:41:03 -06:00
Dan Williams
9cf13cc3e1 agent: request_new -> flags
Use some flags to modify GetSecrets behavior instead of just the
request_new boolean.
2011-01-18 14:17:18 -06:00
Dan Williams
a2f36e8bd4 agent: add CancelGetSecrets D-Bus API
Allows NM to signal to an agent that an in-progress secrets
request is no longer needed.  This could happen if the device
for which the request was started was removed, disabled, or the
network being connected to changed, or whatever.
2011-01-18 13:19:29 -06:00
Dan Williams
acd16ceeed api: fix argument direction for SecretAgent API calls 2011-01-13 14:08:36 -06:00
Dan Williams
f9ceafd4a1 Merge remote branch 'origin/master' into rm-userset 2011-01-12 15:46:37 -06:00
Dan Williams
063859ba66 libnm-glib: add nm_client_add_and_activate_connection() 2011-01-12 00:39:34 -06:00
Dan Williams
215306f5a1 core: add AddAndActivate D-Bus method
Given connection details, complete the connection as well as possible
using the given specific object and device, add it to system
settings, and activate it all in one method.
2011-01-10 23:39:12 -06:00
Dan Williams
9d24269e30 wimax: add Center Frequency, RSSI, CINR, TX Power, and BSID properties
Useful diagnostic/support info when device is connected.
2011-01-06 15:18:19 -06:00
Dan Williams
9e80c1e85d wimax: make WiMAX mostly work
Heavily modify Inaky's Intel WiMAX SDK glue (originally from connman)
to be more generic and more thread-safe, and suitable for use with
NetworkManager instead of rolling our own client code.  Rewrite the
NMDeviceWimax code to mostly work.

Still to be done: actual connection logic, DHCP handling, spawning
wimaxd if it's not started yet
2011-01-03 23:55:38 -06:00
Dan Williams
0587ef1179 Merge remote branch 'origin/master' into wimax 2011-01-02 17:24:23 -06:00
Dan Williams
1496f8056f libnm-glib: add secret agent base class 2010-12-14 00:03:22 -06:00
Dan Williams
a30cf19858 agent: add agent manager and minimal agent class 2010-12-10 12:38:19 -06:00
Dan Williams
9d077444a9 settings: remove settings dict from connection 'updated' signal
New connections should not be pushed out in the Updated signal
because signals cannot be restricted to particular clients, and
some clients may not have permission to view the connection.

Upon receiving the Updated signal, clients should re-read the
connection using GetSettings to ensure that the client still
has permissions to view the connection, and to get the updated
settings.
2010-12-02 14:34:38 -06:00
Dan Williams
37845af954 settings: return new connection object path from AddConnection
Finally.
2010-10-29 14:34:33 -05:00
Dan Williams
e5adfcbabe settings: remove remnants of unused CheckPermissions signal 2010-10-26 11:40:43 -05:00
Dan Williams
8b41f70dd5 Merge remote branch 'origin/master' into rm-userset 2010-09-27 10:30:46 -05:00
Jiří Klimeš
facf6b176f core: add Version property to org.freedesktop.NetworkManager interface 2010-09-27 10:34:56 +02:00
Dan Williams
3945f75bda core: consolidate all permissions checking into main D-Bus interface
Moves the system settings permissions checking into the core service's
permissions checking, which at the same time enables 3-way permission
reporting (yes, no, auth) instead of the old yes/no that we had for
system settings permissions before.  This allows UI to show a lock
icon or such when the user could authenticate to gain the permission.

It also moves the wifi-create permissions' namespace to the main
namespace (not .settings) since they really should be checked before
starting a shared wifi connection, rather than having anything to do
with the settings service.
2010-08-26 14:26:12 -05:00
Daniel Gnoutcheff
6ebc201636 WIP: NMSysconfig: enforce access controls 2010-08-15 03:25:58 -04:00
Daniel Gnoutcheff
f98e2528a6 NetworkMangerSettings -> NetworkManager.Settings
Just for consistency, make settings related stuff live under the
org.freedesktop.NetworkManager namespace, rather than its own
org.freedesktop.NetworkManagerSettings namespace. Renames are done for
DBus interface names, DBus object paths, and polkit actions.
2010-08-07 01:19:46 -04:00
Daniel Gnoutcheff
aee48901f4 Merged NM{Exported,Sysconfig}Connection
In continuation of the theme, the removal of user settings services
means that the distinction between NMSysconfigConnection and
NMExportedConnection is no longer needed. Merge NMExportedConnection
into NMSysconfigConnection.
2010-08-06 13:05:46 -04:00
Daniel Gnoutcheff
da6816a03b nm-glib/DBus: merge nm-settings{,-system} iface
Much as with nm-remote-settings and nm-remote-settings-system, the
removal of user settings services means there is no more need for
separate interfaces for user and system settings services.

In libnm-glib, this commit merges everything in
nm-settings-system-interface into nm-settings-interface.  Alongside with
that, we merge everything in the
org.freedesktop.NetworkManagerSettings.System DBus interface into
org.freedesktop.NetworkManagerSettings.
2010-08-06 13:05:46 -04:00
Daniel Gnoutcheff
d503c09466 DBus API: removing user settings support
Remove bits from the external DBus API that were once needed for user
settings support.
2010-08-06 13:05:46 -04:00
Dan Williams
664ccd4464 Revert "core: fix compilation on glib < 2.23.4"
This reverts commit 8a1fe31b31.

This commit was not intended to be pushed, as it's not ready yet
and isn't even my commit (thus attribution is wrong).
2010-07-12 18:20:09 -07:00
Dan Williams
8a1fe31b31 core: fix compilation on glib < 2.23.4
Where G_FILE_MONITOR_EVENT_MOVED isn't defined yet.
2010-07-02 10:42:32 -07:00
Jiří Klimeš
1b49f941a6 core: MAC address spoofing/cloning (rh #447827) (bgo #553771)
This commit implements MAC cloning feature in NetworkManager. To support that,
'PermHwAddress' property is added into *.Device.Wired and *.Device.Wireless
interfaces. The permanent MAC address is obtained when creating the device, and
is used for 'locking' connections to the device. If a cloned MAC is specified
in connection to be activated, the MAC is set to the interface in stage1. While
disconecting, the permanent MAC is set back to the interface.
2010-06-22 14:21:25 +02:00
Dan Williams
763f2f1d01 core: expose device's IP interface when activated
Lets apps find out what the actual kernel interface name is for the
device so they can do fun stuff with it.
2010-06-10 10:16:39 -07:00
Dan Williams
ae4b47ca99 core: PolicyKit protect Deactivate and Disconnect 2010-06-04 00:42:10 -07:00
Dan Williams
65818d517e core: PolicyKit-protect sleep/wake
Default to 'not allowed', distros that need backwards compatibility
can flip this to 'yes' if they need to. At this point, only power
management scripts should call these functions.
2010-05-29 23:11:45 -07:00
Dan Williams
c013490ba3 core: PolicyKit-protect enable/disable networking method 2010-05-29 23:00:46 -07:00
Dan Williams
716a9c6c0d core: add permissions framework for various operations (rh #585182) (bgo #619323) 2010-05-28 18:23:00 -07:00
Dan Williams
fea6431a20 core/libnm-glib: implement better missing firmware support (rh #594578)
Track missing firmware and ensure the device can't be used when firmware
is missing.  Add a property for missing firmware so that clients can do
something intelligent with this information.
2010-05-25 10:52:25 -07:00
Dan Williams
fa70542c61 core: add networking enable/disable knob distinct from sleep/wake (rh #589108) (bgo #346615)
Since forever we've used sleep/wake as the way to implement
Networking Enabled.  When the state file was introduced to make the
networking and wifi states persistent, we ran into a bug where
a failed suspend (like if the machine ran out of power while
suspended) would result in networking being disabled on reboot
since suspend/resume used the same knob as enable/disable.

This patch adds a distinct call for enable/disable networking
which changes the state file, while sleep/wake no longer change
the state file.
2010-05-22 09:51:22 -07:00
Dan Williams
c4f3bf002b Merge remote branch 'origin/master' into wimax 2010-05-19 08:55:26 -07:00
Dan Williams
e99ad94411 api: fix SetLogging description typo 2010-05-04 10:04:55 -07:00
Dan Williams
1d409aeb53 core: fix Address property type of IP6Config objects
We can change the property's D-Bus signature (and thus API) here
because querying the IP6Config object's properties caused NM to
crash.  Apparently we forgot to change the type of the Address
property when we C&P-ed the IP4Config into the IP6Config, and
DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT is certainly the wrong type
to use since the backing object that dbus-glib would marshal
into the ARRAY_OF_ARRAY_OF_UINT wasn't that type, causing a
crash in dbus-glib when a client got the IP6Config.
2010-04-17 17:19:30 -07:00
Dan Williams
e2ad8c2a54 core: add 'default6' property for ActiveConnection objects
Since IPv4 and IPv6 have different routing one device can have the
active IPv4 connection and a completely different one can have the
active IPv6 one.
2010-04-15 15:18:08 -07:00
Dan Williams
02002ef9d1 logging: add D-Bus method to change logging 2010-04-08 08:56:17 -07:00
Dan Williams
6773cc6a63 api: clarify Connection.Updated arguments 2010-03-24 14:10:34 -07:00
Dan Williams
b95c390015 bluetooth: add timeout for bluetooth connection request 2010-03-23 23:07:17 -07:00
Dan Williams
c5eb684718 Merge remote branch 'origin/btdun' 2010-02-18 10:18:20 -08:00
Dan Williams
86e4843902 introspection: sync device state reason codes with NetworkManager.h 2010-01-28 12:15:00 -08:00
Dan Williams
133c86ee92 introspection: fix inclusion of Dhcp6Config XML 2010-01-20 17:30:48 -08:00
Dan Williams
ac2505b64c Merge commit 'origin/master' into dhcp6 2010-01-20 15:42:26 -08:00