Commit f48b1faa authored by Ray Strode's avatar Ray Strode

Port JavaScript authority to mozjs52

Currently polkit depends on mozjs24 to provide the JavaScript
support for the JavaScript authority.

The problem is, mozjs24 is quite old at this point. Most other
parts of the desktop have moved on.

This patchset updates polkit to target mozjs52, instead. As a
side benefit, we can re-enable the JIT, since it no longer seems
to conflict with the watchdog thread used to detect when a
javascript script is caught in an infinite loop.

Most of the porting work was made by looking at what changes GJS
performed when it retarted mozjs versions, and mimicing them.

I also got some inspiration and a commit from an earlier port to
mozjs38:

https://lists.freedesktop.org/archives/polkit-devel/2017-April/000533.html
parents 105abaa5 ca50ffa0
......@@ -79,7 +79,7 @@ PKG_CHECK_MODULES(GLIB, [gmodule-2.0 gio-unix-2.0 >= 2.30.0])
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
PKG_CHECK_MODULES(LIBJS, [mozjs-24])
PKG_CHECK_MODULES(LIBJS, [mozjs-52])
AC_SUBST(LIBJS_CFLAGS)
AC_SUBST(LIBJS_CXXFLAGS)
......
......@@ -182,6 +182,14 @@ static const RulesTestCase rules_test_cases[] = {
NULL,
POLKIT_IMPLICIT_AUTHORIZATION_AUTHENTICATION_REQUIRED,
},
/* actions without explict rules aren't automatically NOT_AUTHORIZED */
{
"basic2",
"net.company.productA.action2",
"unix-user:john",
NULL,
POLKIT_IMPLICIT_AUTHORIZATION_UNKNOWN,
},
/* Ordering tests ... we have four rules files, check they are
* evaluated in order by checking the detail set by each rules
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment