summaryrefslogtreecommitdiff
path: root/src/nm-manager-auth.c
Commit message (Collapse)AuthorAgeFilesLines
* fixup! core: fix crash in nm-manager-authth/crash_authThomas Haller2013-11-221-7/+3
|
* fixup! core: fix crash in nm-manager-authThomas Haller2013-11-221-3/+0
|
* fixup! core: fix crash in nm-manager-authThomas Haller2013-11-221-4/+3
|
* fixup! core: fix crash in nm-manager-authThomas Haller2013-11-221-7/+8
|
* fixup! core: fix crash in nm-manager-authThomas Haller2013-11-221-14/+3
|
* fixup! core: fix crash in nm-manager-authThomas Haller2013-11-221-2/+5
|
* fixup! core: fix crash in nm-manager-authThomas Haller2013-11-221-6/+3
|
* core: fix crash in nm-manager-authThomas Haller2013-11-221-8/+20
| | | | | | | | | | | | | | | | | | | When doing nm_auth_chain_unref(), the code iterated over the ->calls and cancelled them. However, some of these calls might not have passed on to polkit_authority_check_authorization(), but instead being scheduled with g_idle_add(). These calls have to be canceled too because the NMAuthChain will already be destroyed when auth_call_complete() calls. #0 0x00007f166efda359 in g_slist_remove () from /lib64/libglib-2.0.so.0 #1 0x00007f167311bcc1 in auth_call_complete () #2 0x00007f166efbde06 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0 #3 0x00007f166efbe158 in g_main_context_iterate.isra.22 () from /lib64/libglib-2.0.so.0 #4 0x00007f166efbe55a in g_main_loop_run () from /lib64/libglib-2.0.so.0 #5 0x00007f16730d3c0d in main () Signed-off-by: Thomas Haller <thaller@redhat.com>
* core: nm-manager-auth.c: make cancellable only when neededThomas Haller2013-11-221-3/+4
| | | | | | | | | The cancellable is only needed when calling polkit_authority_check_authorization(). AuthCall objects are either passed on for cleanup to g_idle_add or to polkit. Not both at the same time, so this also makes it clear, which type we have at hand. Signed-off-by: Thomas Haller <thaller@redhat.com>
* core: trivial, remove setting values of struct before g_free()Thomas Haller2013-11-221-4/+0
| | | | | | | Setting any variables of the struct before freeing it's memory is of no use. Signed-off-by: Thomas Haller <thaller@redhat.com>
* core: trivial, rename variableThomas Haller2013-11-221-6/+6
| | | | | | | The name idle_id is used for two different cases, rename the variable, so that it is easier to see what's going on. Signed-off-by: Thomas Haller <thaller@redhat.com>
* core: remove unused auth chain creation functionsDan Williams2013-10-311-55/+13
| | | | No longer used by anything.
* core: add function to create auth chains from a subjects or contextsDan Williams2013-10-311-10/+68
| | | | The subject already contains all the information we need.
* core: grab remote process id when authenticating D-Bus clientsDan Williams2013-10-311-1/+2
|
* core: convert the DBus manager to a single-ref objectDan Williams2013-05-201-6/+1
| | | | | It's created very, very early and never needs to be unrefed by anything except the main() function.
* auth: move common nm_dbus_manager_get_caller_info() functionality into ↵Dan Williams2013-04-081-7/+27
| | | | | | | | | | 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.
* core: remove unused argument to nm_auth_chain_new()Dan Williams2013-04-081-9/+5
|
* core: assume root always has a session for connection visibilityDan Williams2013-04-081-0/+4
| | | | | | | | Normally, users which are not part of a login session can't access connections. Root won't always be part of a login session, so allow root to bypass visibility checks. The code already bypassed the ACL checks for root, but in multiple places. Consolidate those checks into one function.
* core: remove unused auth functionsDan Williams2013-04-081-53/+0
| | | | Functionality moved to NMDBusManager.
* core: use same codepaths for root and non-root during authenticationDan Williams2013-04-081-21/+53
| | | | | | | | | | | | | | | | | | | 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.
* core: push PolicyKit unavailable error to callers instead of logging itDan Williams2013-04-081-20/+13
| | | | | | | The error is now pushed to things that request PK auth so that we don't lose it, because we don't want to unconditionally log it from NM, but still want things to know that their request couldn't be fulfilled because PK wasn't running.
* core: simplify auth chain early exitDan Williams2013-04-081-11/+10
| | | | | | Don't create a GError with a domain of 0, which causes a glib warning, and make it clearer when we're early-finishing with an error and when we're not.
* core: use nm_connection_get_setting_<type>() whenever possibleThomas Graf2011-12-061-1/+1
| | | | | | Leads to shorter, easier to read code and improves type casting safety. Signed-off-by: Thomas Graf <tgraf@redhat.com>
* core: add nm_auth_chain_steal_data()Dan Williams2011-07-011-0/+31
| | | | | New function for removing data from the auth chain without destroying it.
* core: allow multiple authority changed callbacksDan Williams2011-07-011-20/+57
| | | | | We'll need this later; just keep all registered callbacks in a list and track them by func/data.
* core: don't schedule authentication requests twiceDan Williams2011-07-011-1/+2
| | | | | | | If an error occurred, or PolicyKit is disabled, we don't want to schedule two idle handlers to return the result of an authentication request. We'll soon be queuing up multiple requests at the same time so we don't want this to happen.
* core: clean up auth handling after polkit enable/disable changesDan Williams2011-05-201-51/+59
| | | | | Slash and burn the #ifdef jungle so that the flow and blocks are cleaner and less confusing to follow.
* core: rename PolkitCall to AuthCallDan Williams2011-05-201-17/+17
|
* core: allow build-time enable/disable of PolicyKitDan Williams2011-05-181-5/+32
| | | | When PK is turned off, everything is authorized.
* core: consolidate PolicyKit codeDan Williams2011-05-181-26/+117
| | | | | | 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.
* core: add ulong data helpers to NMAuthChainDan Williams2011-02-111-0/+28
| | | | | | 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.
* core: add method to start authentication with a D-Bus senderDan Williams2011-02-021-3/+15
|
* core: fix possible leak in error pathDan Williams2010-12-101-0/+1
|
* core: add nm_auth_uid_in_acl()Dan Williams2010-11-181-3/+47
| | | | | | For checking whether a specific user ID is: 1) in a known session 2) allowed by the connection's permissions ACL
* core: make nm_auth_get_caller_uid() error description non-constDan Williams2010-11-181-4/+4
| | | | | For consistency with the next commit, so we don't need to remember when to free the description or not.
* core: add helper to access authentication resultDan Williams2010-11-171-0/+9
|
* core: get D-Bus manager during auth if not providedDan Williams2010-10-261-1/+8
|
* Merge remote branch 'origin/master' into gsocDan Williams2010-08-261-7/+29
|\
| * core: validate Enable/Disable WiFi and WWAN requests (rh #626337)Dan Williams2010-08-251-7/+29
| | | | | | | | | | | | | | | | 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.
* | core: remove internal API refs. to user settingsDaniel Gnoutcheff2010-08-061-63/+0
|/ | | | | | 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.
* core: add nm_auth_uid_authorized() to check user permissionsDan Williams2010-06-031-0/+62
| | | | Basically cleaned up is_user_request_authorized() from nm-manager.c.
* core: check permissions on the user settings service tooDan Williams2010-06-031-6/+21
| | | | | And if the permissions change, make sure we allow or deny user settings connections as appropriate.
* core: simplify auth chain permission callback handlingDan Williams2010-06-021-2/+12
|
* core: make nm_auth_is_caller_root() more genericDan Williams2010-05-311-13/+10
|
* core: root can always enable/disable and sleep/wakeDan Williams2010-05-301-0/+52
|
* core: PolicyKit-protect enable/disable networking methodDan Williams2010-05-291-8/+62
|
* core: add permissions framework for various operations (rh #585182) (bgo ↵Dan Williams2010-05-281-0/+212
#619323)