Commit Graph

33 Commits

Author SHA1 Message Date
Dan Williams
1126e22572 core: remove unused auth chain creation functions
No longer used by anything.
2013-10-31 14:15:08 -05:00
Dan Williams
7fe84e0ec7 core: add function to create auth chains from a subjects or contexts
The subject already contains all the information we need.
2013-10-31 14:15:07 -05:00
Dan Williams
72bdb5707e auth: move common nm_dbus_manager_get_caller_info() functionality into nm_auth_chain_new()
Most callers of nm_auth_chain_new() call nm_dbus_manager_get_caller_info()
right before that, so just fold the get_caller_info() call into
nm_auth_chain_new() to reduce code complexity in callers.  Yes, this
means sometimes we call nm_dbus_manager_get_caller_info() twice,
but that's not really a problem.
2013-04-08 10:55:38 -05:00
Dan Williams
b389ad3141 core: remove unused argument to nm_auth_chain_new() 2013-04-08 10:55:38 -05:00
Dan Williams
80f8fce675 core: remove unused auth functions
Functionality moved to NMDBusManager.
2013-04-08 10:55:37 -05:00
Dan Williams
0621de7d48 core: use same codepaths for root and non-root during authentication
Instead of doing something like

<get caller UID>
if (root) {
   perform_operation()
   other boilerplate stuff
   return;
}

nm_auth_chain_new(perform_operation)
...

just have root also go through the auth chain, which is now
short circuited for root.  This ensures we always use the same
code paths for root and non-root, and that fixes made in one path
are also executed for the other.
2013-04-08 10:55:37 -05:00
Dan Williams
c08279dff4 core: add nm_auth_chain_steal_data()
New function for removing data from the auth chain without
destroying it.
2011-07-01 15:38:38 -05:00
Dan Williams
937970f60c core: allow multiple authority changed callbacks
We'll need this later; just keep all registered callbacks
in a list and track them by func/data.
2011-07-01 15:38:38 -05:00
Dan Williams
f79dcb9560 core: consolidate PolicyKit code
Use one global PolkitAuthority object; we only really need to use it
in one place anyway.  So consolidate the code that uses polkit into
nm-manager-auth.c.
2011-05-18 22:20:24 -05:00
Dan Williams
2e2b4373eb core: add ulong data helpers to NMAuthChain
Otherwise callers would have to do the work themselves to ensure that
the top 32 bits of the ulong didn't get chopped off on 32-bit
platorms.
2011-02-11 16:43:03 -06:00
Dan Williams
016c56078d policy: rename HOSTNAME_MODIFY -> MODIFY_HOSTNAME for consistency 2011-02-11 11:32:57 -06:00
Dan Williams
ba8f562836 policy: add a "modify own" permission for single-user-visible connections
This policy will allow users to modify their personal connections (ie
maybe VPN connections, etc) distinctly from system-wide connections that
affect more than just their user.  It makes sense to be more lenient when
making changes to settings that don't affect other users.
2011-02-11 11:31:14 -06:00
Dan Williams
f2c317e3d2 policy: rename "modfiy" permission to "modify system"
Meaning stays the same, but this will allow us to differentiate
in the future between personal connections (ie, just visible to
one user) and system connections (visible to more than one user).
2011-02-11 11:19:02 -06:00
Dan Williams
4ff0b5f0b7 core: add method to start authentication with a D-Bus sender 2011-02-02 12:17:26 -06:00
Dan Williams
f9ceafd4a1 Merge remote branch 'origin/master' into rm-userset 2011-01-12 15:46:37 -06:00
Dan Williams
c28850ed52 wimax: fix up WiMAX radio enable/disable and add polkit permission 2011-01-02 17:34:23 -06:00
Dan Williams
47eaf97d67 core: add nm_auth_uid_in_acl()
For checking whether a specific user ID is:
  1) in a known session
  2) allowed by the connection's permissions ACL
2010-11-18 13:49:47 -06:00
Dan Williams
eccca738aa core: make nm_auth_get_caller_uid() error description non-const
For consistency with the next commit, so we don't need to remember
when to free the description or not.
2010-11-18 13:47:04 -06:00
Dan Williams
1064397904 core: add helper to access authentication result 2010-11-17 16:56:34 -06: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
Dan Williams
022d8e665c Merge remote branch 'origin/master' into gsoc 2010-08-26 09:18:37 -05:00
Dan Williams
f917852de3 core: validate Enable/Disable WiFi and WWAN requests (rh #626337)
Since these were properties they are harder to validate the caller as
dbus-glib doesn't have any hooks before the property is set.  So we
install a low-level dbus filter function to catch property Set
requests before they get to dbus-glib and handle the property access
there.
2010-08-25 15:12:32 -05:00
Daniel Gnoutcheff
67ba32cd29 Remove use-user-connections polkit action 2010-08-06 13:05:46 -04:00
Daniel Gnoutcheff
5fda5283b9 core: remove internal API refs. to user settings
Remove all references to connection scope and user-settings services
from the various internal APIs of the daemon. The external DBus API
remains unchanged, albeit in stub form for scope stuff.
2010-08-06 13:05:46 -04:00
Dan Williams
6cbe50ffbd core: add nm_auth_uid_authorized() to check user permissions
Basically cleaned up is_user_request_authorized() from nm-manager.c.
2010-06-03 23:04:10 -07:00
Dan Williams
78c4e0798e core: check permissions on the user settings service too
And if the permissions change, make sure we allow or deny user
settings connections as appropriate.
2010-06-03 13:03:07 -07:00
Dan Williams
299ab139e4 core: add policy for overall network control
Allows for locking down connections completely and disallowing
certain users from touching networking at all.
2010-06-02 02:23:51 -07:00
Dan Williams
a08227525c core: simplify auth chain permission callback handling 2010-06-02 02:16:14 -07:00
Dan Williams
3b6917f74b core: make nm_auth_is_caller_root() more generic 2010-05-31 09:45:26 -07:00
Dan Williams
41faf87b0e core: root can always enable/disable and sleep/wake 2010-05-30 08:30:37 -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