summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Update NEWS for releasewip/halfline/new-releaseRay Strode2018-04-031-5/+146
|
* test: Add a test case to handle actions without explicit rulesJeremy Linton2018-04-031-0/+8
| | | | | | | | | | | An implicit authorization parameter is provided to polkit_backend_js_authority_check_authorization_sync() for actions without corresponding explicit rules. Assure that is honored rather than simply being denied. Signed-off-by: Jeremy Linton <jeremy.linton@arm.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: re-enable JITRay Strode2018-04-031-6/+3
| | | | | | | | seems to work with mozjs52 Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: switch from JS_ConvertArguments to JS::CallArgsFromVpRay Strode2018-04-031-19/+14
| | | | | | Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: stop using JS_GetStringCharsZRay Strode2018-04-031-9/+6
| | | | | | | | it's not around anymore. Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: fix up set_property methodsRay Strode2018-04-031-26/+35
| | | | | | Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: use JS::Evaluate instead of JS_EvaluateScriptRay Strode2018-04-031-28/+21
| | | | | | | | | JS_EvaluateScript is no longer in the API set, so use JS::Evaluate instead. Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: adapt arguments for new JS_ExecuteScript APIRay Strode2018-04-031-1/+0
| | | | | | | | JS_ExecuteScript no longer takes a global argument. Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: adapt arguments for new JS::Compile APIRay Strode2018-04-031-6/+1
| | | | | | | | | | | The global object is implicit now and the result is an out arg. This commit adapts to the new api. Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: root some locals to the contextRay Strode2018-04-031-4/+4
| | | | | | Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: redo how global objects are set upRay Strode2018-04-031-23/+25
| | | | | | | | | | | | This commit drops usage of JS_AddObjectRoot and switches the global object over to being wrapped in a JS::Heap pointer. It stops using JS_DefineObject which no longer seems to be available, and adds a new JS::FireOnNewGlobalHook which seems to be required. Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: use InterruptCallback api instead of OperationCallbackRay Strode2018-04-031-5/+7
| | | | | | | | seems like it got renamed. Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: Fix up JS_CallFunctionName invocationsRay Strode2018-04-031-28/+28
| | | | | | | | The way args are passed in changed. Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: JSVAL_IS_NULL (o) to o.isNull()Ray Strode2018-04-031-1/+1
| | | | | | Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: JSVAL_IS_STRING (s) to s.isString()Ray Strode2018-04-031-3/+3
| | | | | | Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: JSVAL_TO_STRING (s) to s.toString()Ray Strode2018-04-031-3/+3
| | | | | | Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: JSVAL_TO_OBJECT (o) to o.toObjectOrNull()Ray Strode2018-04-031-2/+2
| | | | | | Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: s/BOOLEAN_TO_JSVAL/JS::BooleanValue/Ray Strode2018-04-031-1/+1
| | | | | | Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: s/STRING_TO_JSVAL/JS::StringValue/Ray Strode2018-04-031-4/+4
| | | | | | Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: s/OBJECT_TO_JSVAL/JS::ObjectValue/Ray Strode2018-04-031-1/+1
| | | | | | | | | This commit does a global search and replace for OBJECT_TO_JSVAL to JS::ObjectValue() Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: s/JSVAL_VOID/JS::UndefinedValue()/Ray Strode2018-04-031-1/+1
| | | | | | | | | This commit does a global search and replace for JSVAL_VOID to JS::UndefinedValue() Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: s/JSVAL_NULL/JS::NullValue()/Ray Strode2018-04-031-6/+6
| | | | | | | | | This commit does a global search and replace for JSVAL_NULL to JS::NullValue() Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: s/jsval/JS::Value/Ray Strode2018-04-031-28/+28
| | | | | | | | The API got renamed in mozjs31. Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: s/JSBool/bool/Ray Strode2018-04-031-23/+23
| | | | | | | | It's been gone since mozjs31 Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: pass "%s" format string to report functionsRay Strode2018-04-031-1/+1
| | | | | | | | This just avoids the potential for security problems down the line. Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: add UTF8 suffix to renamed functionsRay Strode2018-04-031-6/+6
| | | | | | Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: JS::SetWarningReporter instead of JS_SetErrorReporterRay Strode2018-04-031-3/+2
| | | | | | | | | | | This commit changes the code to use JS::SetWarningReporter instead of JS_SetErrorReporter. The latter, as far as I can tell, is just a slightly renamed version of the former with the args moved around a little bit. Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: change how JIT is disabledRay Strode2018-04-031-3/+4
| | | | | | | | | | JS_SetOptions seems to be replaced with JS::ContextOptionsRef now. Also, disabling the JIT seems to be three options now instead of just one. Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: call JS_InitSelfHostedCodeRay Strode2018-04-031-0/+3
| | | | | | | | This is now required Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: call JS_InitRay Strode2018-04-031-0/+3
| | | | | | | | This is now required Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: change how setVersion is calledRay Strode2018-04-031-1/+1
| | | | | | | | it's now part of a behaviors method in CompartmentOptions Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: get rid of JSRuntimeRay Strode2018-04-031-8/+2
| | | | | | | | Seems like JSContext is the only thing that matters now. Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: use JS_FN instead of JS_FSRay Strode2018-04-031-3/+3
| | | | | | | | since it doesn't crash if i do that Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* jsauthority: fix how classes are definedRay Strode2018-04-031-18/+31
| | | | | | | | | | | | | | | mozjs no longer has public stub functions that implementers of JSClass objects are supposed to use. Instead NULL means to use the default stub implementations. Furthermore, the structure has been broken out into a JSClassOps sub structure now. This commit adapts the code to the new layout. Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* configure: bump mozjs requirement to 52Ray Strode2018-04-031-1/+1
| | | | | | | | This is going to briefly break the build. Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
* polkitagent: No double warnings in polkit_agent_listener_register()Stef Walter2018-04-021-1/+0
| | | | | | | | | The caller of polkit_agent_listener_register() or similar is responsible for handling returned errors (and/or print them). Remove undconditional warning. https://bugs.freedesktop.org/show_bug.cgi?id=78193
* trivial: fix deprecated indication for polkit_agent_register_listener()Jiří Klimeš2018-04-021-1/+1
| | | | | | | polkit_agent_register_listener() is deprecated for a new function named polkit_agent_listener_register(), not polkit_authority_listener_register(). Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
* tests: Correct boundary test for overflowColin Walters2018-04-021-1/+1
| | | | | | The offset has to be strictly less than the max. https://bugs.freedesktop.org/show_bug.cgi?id=87716
* build: Use AC_USE_SYSTEM_EXTENSIONSColin Walters2018-04-024-4/+3
| | | | | This ensures that we get all of the extensions consistently, rather than having just a few files `#define _GNU_SOURCE`.
* Move to current GLibMiloslav Trmač2018-04-0214-30/+2
| | | | | | | | | | Set up glib to use the installed version for deprecation warnings instead of limiting ourselves to [2.30,2.34]; this will let us use newer API, and help us keep up to date with future deprecations. Then fix all the warnings (as of GLib 2.44.1). https://bugs.freedesktop.org/show_bug.cgi?id=91198
* Fix a race condition when terminating runaway_killer_threadMiloslav Trmač2018-04-021-34/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code used to call g_main_loop_quit() from the main thread, without having any guarantee that runaway_killer_thread_func() has even entered its g_main_loop_run(). If a main loop is not running, g_main_loop_quit() has no effect. This could occasionally be reproduced in test-polkitbackendjsauthority.c, which is creating several very short-lived PolkitBackendJSAuthority instances. Real polkitd should not generally be affected, because it is using a single instance running for the life of the process ~ for the uptime of the system, enough time to enter the runaway_killer_thread main loop. To fix this, use g_idle_source_new () to make sure g_main_loop_quit () is called from within the running main loop. Also, simplify the initialization of runaway_killer_thread by moving the creation of rkt_context and rkt_loop into the main thread; this makes the condition variable and its associated mutex completely unnecessary. Finally, only destroy rkt_timeout_pending_mutex _after_ the thread terminates; before, we were certain that rkt_source was destroyed by that time, but AFAICS that does not ensure that the rkt_on_timeout () callback has already terminated. https://bugs.freedesktop.org/show_bug.cgi?id=95513 Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* Support polkit session agent running outside user sessionSebastien Bacher2018-04-021-0/+14
| | | | | | | | | | | | | commit a68f5dfd7662767b7b9822090b70bc5bd145c50c made session applications that are running from a user bus work with polkitd, by falling back to using the currently active session. This commit is similar, but for the polkit agent. It allows, a polkit agent to be run from a systemd --user service that's not running directly in the users session. https://bugs.freedesktop.org/show_bug.cgi?id=96977
* polkitbackend: Fix typos in a couple of initialisation error messagesPhilip Withnall2018-04-021-2/+2
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=97342
* configure: enable elogind support in PolicyKitSven Eden2018-04-021-10/+43
| | | | | | | | | | | | | | | | | Currently configure.ac allows the usage of either libsystemd-login or ConsoleKit for session tracking. The elogind project (https://github.com/wingo/elogind) provides systemd-logind as a stand-alone daemon. To allow users of systems not run by the full systemd suite, for whatever reason there might be, to at least be able to not have to use ConsoleKit for session tracking, an integration of elogind usage into PolicyKit would be very helpfull. As elogind provides the same interface as systemd-logind, integration is easy. This commit changes configure.ac to look for elogind in the same way it looks for systemd-logind.
* Fix help for (pkttyagent -s)Miloslav Trmač2018-04-021-1/+1
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=92581
* Fix a memory leak on agent authentication cancellationMiloslav Trmač2018-04-021-1/+6
| | | | | | | | (This is cancellation by the daemon, possibly requested by the client, not by the agent.) https://bugs.freedesktop.org/show_bug.cgi?id=99741 Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* Fix a memory leak per agent authenticationMiloslav Trmač2018-04-021-3/+4
| | | | | | https://bugs.freedesktop.org/show_bug.cgi?id=99741 Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* Fix error handling in polkit_authority_enumerate_temporary_authorizations_finishMiloslav Trmač2018-04-021-1/+3
| | | | | | | | Fix memory leaks, and don't return a pointer to freed memory. https://bugs.freedesktop.org/show_bug.cgi?id=99741 Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* Fix memory leaks in server_handle_*_temporary_authorizationsMiloslav Trmač2018-04-021-0/+2
| | | | | | https://bugs.freedesktop.org/show_bug.cgi?id=99741 Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* Fix a memory leak in server_handle_authentication_agent_response{,2}Miloslav Trmač2018-04-021-0/+2
| | | | | | https://bugs.freedesktop.org/show_bug.cgi?id=99741 Signed-off-by: Miloslav Trmač <mitr@redhat.com>