components/desktop/polkit/patches/11-mozjs.patch
author Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
Fri, 10 Feb 2017 10:03:57 -0800
changeset 7661 aff9737ef6ba
parent 7431 1b1f1123c9e3
permissions -rw-r--r--
25534788 Resync gnome/desktop patches with upstream efforts
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7431
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
     1
This is an upstream patch that moves us to using mozjs in Solaris instead
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
     2
of duktape. When we update to a version of polkit that includes this, we
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
     3
should be able to delete this set of 4 patches 
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
     4
7661
aff9737ef6ba 25534788 Resync gnome/desktop patches with upstream efforts
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 7431
diff changeset
     5
This was committed upstream for a release after 0.113:
aff9737ef6ba 25534788 Resync gnome/desktop patches with upstream efforts
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 7431
diff changeset
     6
https://cgit.freedesktop.org/polkit/commit/?id=03dafd1fac8154c0a581395f1b7bf29e56a83491
aff9737ef6ba 25534788 Resync gnome/desktop patches with upstream efforts
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 7431
diff changeset
     7
7431
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
     8
Remove mozjs185 and mozjs17 from autoconf and replace them
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
     9
with mozjs24.
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    10
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    11
Now that polkitbackendjsauthority is compiling in C++ mode
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    12
and the autoconf supports mozjs24, update the module so
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    13
that it builds with mozjs24.
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    14
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    15
Signed-off-by: Jeremy Linton <jeremy.linton at arm.com>
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    16
---
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    17
 configure.ac                                   | 14 +----
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    18
 src/polkitbackend/polkitbackendjsauthority.cpp | 74 ++++++++------------------
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    19
 2 files changed, 25 insertions(+), 63 deletions(-)
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    20
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    21
diff --git a/configure.ac b/configure.ac
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    22
index 18c1f4e..f457a84 100644
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    23
--- a/configure.ac
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    24
+++ b/configure.ac
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    25
@@ -131,18 +131,8 @@ AC_DEFINE([GLIB_VERSION_MIN_REQUIRED], [GLIB_VERSION_2_30],
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    26
 AC_DEFINE([GLIB_VERSION_MAX_ALLOWED], [G_ENCODE_VERSION(2,34)],
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    27
         [Notify us when we'll need to transition away from g_type_init()])
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    28
 
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    29
-AC_ARG_WITH(mozjs, AS_HELP_STRING([--with-mozjs=@<:@mozjs185/mozjs-17.0|auto@:>@],
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    30
-		                  [Specify version of Spidermonkey to use]),,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    31
-            with_mozjs=auto)
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    32
-AS_IF([test x${with_mozjs} != xauto], [
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    33
-  PKG_CHECK_MODULES(LIBJS, ${with_mozjs})
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    34
-], [
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    35
-  PKG_CHECK_MODULES(LIBJS, [mozjs185], have_mozjs185=yes, have_mozjs185=no)
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    36
-  AS_IF([test x${have_mozjs185} = xno], [
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    37
-  PKG_CHECK_MODULES(LIBJS, [mozjs-17.0], have_mozjs17=yes,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    38
-   [AC_MSG_ERROR([Could not find mozjs185 or mozjs-17.0; see http://ftp.mozilla.org/pub/mozilla.org/js/])])
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    39
-  ])
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    40
-])
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    41
+PKG_CHECK_MODULES(LIBJS, [mozjs-24])
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    42
+
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    43
 AC_SUBST(LIBJS_CFLAGS)
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    44
 AC_SUBST(LIBJS_CXXFLAGS)
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    45
 AC_SUBST(LIBJS_LIBS)
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    46
diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp b/src/polkitbackend/polkitbackendjsauthority.cpp
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    47
index 2112868..1541856 100644
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    48
--- a/src/polkitbackend/polkitbackendjsauthority.cpp
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    49
+++ b/src/polkitbackend/polkitbackendjsauthority.cpp
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    50
@@ -92,11 +92,7 @@ struct _PolkitBackendJsAuthorityPrivate
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    51
 };
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    52
 
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    53
 static JSBool execute_script_with_runaway_killer (PolkitBackendJsAuthority *authority,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    54
-#if JS_VERSION == 186
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    55
                                                   JSScript                 *script,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    56
-#else
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    57
-                                                  JSObject                 *script,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    58
-#endif
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    59
                                                   jsval                    *rval);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    60
 
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    61
 static void utils_spawn (const gchar *const  *argv,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    62
@@ -157,17 +153,13 @@ static JSClass js_global_class = {
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    63
   "global",
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    64
   JSCLASS_GLOBAL_FLAGS,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    65
   JS_PropertyStub,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    66
-  JS_PropertyStub,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    67
+  JS_DeletePropertyStub,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    68
   JS_PropertyStub,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    69
   JS_StrictPropertyStub,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    70
   JS_EnumerateStub,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    71
   JS_ResolveStub,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    72
   JS_ConvertStub,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    73
-#if JS_VERSION == 186      
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    74
   NULL,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    75
-#else
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    76
-  JS_FinalizeStub,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    77
-#endif
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    78
   JSCLASS_NO_OPTIONAL_MEMBERS
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    79
 };
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    80
 
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    81
@@ -177,17 +169,13 @@ static JSClass js_polkit_class = {
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    82
   "Polkit",
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    83
   0,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    84
   JS_PropertyStub,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    85
-  JS_PropertyStub,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    86
+  JS_DeletePropertyStub,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    87
   JS_PropertyStub,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    88
   JS_StrictPropertyStub,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    89
   JS_EnumerateStub,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    90
   JS_ResolveStub,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    91
   JS_ConvertStub,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    92
-#if JS_VERSION == 186      
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    93
   NULL,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    94
-#else
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    95
-  JS_FinalizeStub,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    96
-#endif
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    97
   JSCLASS_NO_OPTIONAL_MEMBERS
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    98
 };
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
    99
 
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   100
@@ -300,22 +288,14 @@ load_scripts (PolkitBackendJsAuthority  *authority)
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   101
   for (l = files; l != NULL; l = l->next)
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   102
     {
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   103
       const gchar *filename = l->data;
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   104
-#if JS_VERSION == 186
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   105
-      JSScript *script;
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   106
-#else
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   107
-      JSObject *script;
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   108
-#endif
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   109
+      JS::RootedScript script(authority->priv->cx);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   110
+      JS::CompileOptions options(authority->priv->cx);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   111
+      JS::RootedObject   obj(authority->priv->cx,authority->priv->js_global);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   112
+      options.setUTF8(true);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   113
+      script = JS::Compile (authority->priv->cx,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   114
+                            obj, options,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   115
+                            filename);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   116
 
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   117
-#if JS_VERSION == 186
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   118
-      script = JS_CompileUTF8File (authority->priv->cx,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   119
-				   authority->priv->js_global,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   120
-				   filename);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   121
-      
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   122
-#else
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   123
-      script = JS_CompileFile (authority->priv->cx,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   124
-			       authority->priv->js_global,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   125
-			       filename);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   126
-#endif
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   127
       if (script == NULL)
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   128
         {
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   129
           polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   130
@@ -355,6 +335,8 @@ reload_scripts (PolkitBackendJsAuthority *authority)
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   131
 
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   132
   JS_BeginRequest (authority->priv->cx);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   133
 
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   134
+  JSAutoCompartment ac(authority->priv->cx,  authority->priv->js_global);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   135
+
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   136
   if (!JS_CallFunctionName(authority->priv->cx,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   137
                            authority->priv->js_polkit,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   138
                            "_deleteRules",
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   139
@@ -369,11 +351,7 @@ reload_scripts (PolkitBackendJsAuthority *authority)
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   140
 
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   141
   polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   142
                                 "Collecting garbage unconditionally...");
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   143
-#if JS_VERSION == 186
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   144
   JS_GC (authority->priv->rt);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   145
-#else
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   146
-  JS_GC (authority->priv->cx);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   147
-#endif
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   148
 
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   149
   load_scripts (authority);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   150
 
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   151
@@ -465,7 +443,7 @@ polkit_backend_js_authority_constructed (GObject *object)
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   152
   PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (object);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   153
   gboolean entered_request = FALSE;
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   154
 
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   155
-  authority->priv->rt = JS_NewRuntime (8L * 1024L * 1024L);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   156
+  authority->priv->rt = JS_NewRuntime (8L * 1024L * 1024L, JS_USE_HELPER_THREADS);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   157
   if (authority->priv->rt == NULL)
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   158
     goto fail;
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   159
 
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   160
@@ -479,19 +457,17 @@ polkit_backend_js_authority_constructed (GObject *object)
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   161
   JS_SetOptions (authority->priv->cx,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   162
                  JSOPTION_VAROBJFIX
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   163
                  /* | JSOPTION_JIT | JSOPTION_METHODJIT*/);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   164
-  JS_SetVersion(authority->priv->cx, JSVERSION_LATEST);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   165
   JS_SetErrorReporter(authority->priv->cx, report_error);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   166
   JS_SetContextPrivate (authority->priv->cx, authority);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   167
 
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   168
   JS_BeginRequest(authority->priv->cx);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   169
   entered_request = TRUE;
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   170
 
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   171
-  authority->priv->js_global =
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   172
-#if JS_VERSION == 186
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   173
-    JS_NewGlobalObject (authority->priv->cx, &js_global_class, NULL);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   174
-#else
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   175
-    JS_NewCompartmentAndGlobalObject (authority->priv->cx, &js_global_class, NULL);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   176
-#endif
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   177
+  {
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   178
+  JS::CompartmentOptions compart_opts;
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   179
+  compart_opts.setVersion(JSVERSION_LATEST);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   180
+  authority->priv->js_global = JS_NewGlobalObject (authority->priv->cx, &js_global_class, NULL, compart_opts);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   181
+  JSAutoCompartment ac(authority->priv->cx,  authority->priv->js_global);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   182
 
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   183
   if (authority->priv->js_global == NULL)
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   184
     goto fail;
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   185
@@ -548,11 +524,12 @@ polkit_backend_js_authority_constructed (GObject *object)
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   186
 
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   187
   setup_file_monitors (authority);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   188
   load_scripts (authority);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   189
-
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   190
+  }
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   191
   JS_EndRequest (authority->priv->cx);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   192
   entered_request = FALSE;
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   193
 
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   194
   G_OBJECT_CLASS (polkit_backend_js_authority_parent_class)->constructed (object);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   195
+
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   196
   return;
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   197
 
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   198
  fail:
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   199
@@ -766,7 +743,6 @@ subject_to_jsval (PolkitBackendJsAuthority  *authority,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   200
   char *session_str = NULL;
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   201
 
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   202
   src = "new Subject();";
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   203
-
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   204
   if (!JS_EvaluateScript (authority->priv->cx,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   205
                           authority->priv->js_global,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   206
                           src, strlen (src),
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   207
@@ -999,11 +975,7 @@ rkt_on_timeout (gpointer user_data)
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   208
   g_mutex_unlock (&authority->priv->rkt_timeout_pending_mutex);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   209
 
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   210
   /* Supposedly this is thread-safe... */
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   211
-#if JS_VERSION == 186
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   212
   JS_TriggerOperationCallback (authority->priv->rt);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   213
-#else
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   214
-  JS_TriggerOperationCallback (authority->priv->cx);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   215
-#endif
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   216
 
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   217
   /* keep source around so we keep trying to kill even if the JS bit catches the exception
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   218
    * thrown in js_operation_callback()
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   219
@@ -1041,11 +1013,7 @@ runaway_killer_teardown (PolkitBackendJsAuthority *authority)
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   220
 
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   221
 static JSBool
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   222
 execute_script_with_runaway_killer (PolkitBackendJsAuthority *authority,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   223
-#if JS_VERSION == 186
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   224
                                     JSScript                 *script,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   225
-#else
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   226
-                                    JSObject                 *script,
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   227
-#endif
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   228
                                     jsval                    *rval)
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   229
 {
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   230
   JSBool ret;
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   231
@@ -1103,6 +1071,8 @@ polkit_backend_js_authority_get_admin_auth_identities (PolkitBackendInteractiveA
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   232
 
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   233
   JS_BeginRequest (authority->priv->cx);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   234
 
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   235
+  JSAutoCompartment ac(authority->priv->cx,  authority->priv->js_global);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   236
+
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   237
   if (!action_and_details_to_jsval (authority, action_id, details, &argv[0], &error))
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   238
     {
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   239
       polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   240
@@ -1212,6 +1182,8 @@ polkit_backend_js_authority_check_authorization_sync (PolkitBackendInteractiveAu
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   241
 
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   242
   JS_BeginRequest (authority->priv->cx);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   243
 
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   244
+  JSAutoCompartment ac(authority->priv->cx,  authority->priv->js_global);
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   245
+
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   246
   if (!action_and_details_to_jsval (authority, action_id, details, &argv[0], &error))
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   247
     {
1b1f1123c9e3 24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff changeset
   248
       polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),