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-- |
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=2d4d117eeadde9b56ac49e82a2d701a6f6e387b5 |
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 |
The autocompartment definition in the previous patches seems to be fine, but |
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
9 |
constructing the autocompartment for the lifetime of the global object is probably |
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
10 |
a better way to handle this. |
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
11 |
|
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
12 |
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
|
13 |
--- |
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
14 |
src/polkitbackend/polkitbackendjsauthority.cpp | 15 ++++++++------- |
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
15 |
1 file changed, 8 insertions(+), 7 deletions(-) |
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 |
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
|
18 |
index ce3a980..6a0b4ab 100644 |
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
19 |
--- 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
|
20 |
+++ 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
|
21 |
@@ -76,6 +76,7 @@ struct _PolkitBackendJsAuthorityPrivate |
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
22 |
JSRuntime *rt; |
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
23 |
JSContext *cx; |
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
24 |
JSObject *js_global; |
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
25 |
+ JSAutoCompartment *ac; |
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
26 |
JSObject *js_polkit; |
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
27 |
|
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
28 |
GThread *runaway_killer_thread; |
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
29 |
@@ -335,8 +336,6 @@ 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
|
30 |
|
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
31 |
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
|
32 |
|
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
33 |
- 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
|
34 |
- |
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
35 |
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
|
36 |
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
|
37 |
"_deleteRules", |
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
38 |
@@ -467,10 +466,15 @@ 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
|
39 |
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
|
40 |
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
|
41 |
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
|
42 |
- 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
|
43 |
|
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
44 |
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
|
45 |
goto fail; |
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
46 |
+ |
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
47 |
+ authority->priv->ac = new JSAutoCompartment(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
|
48 |
+ |
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
49 |
+ if (authority->priv->ac == NULL) |
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
50 |
+ goto fail; |
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 |
JS_AddObjectRoot (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
|
53 |
|
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
54 |
if (!JS_InitStandardClasses (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
|
55 |
@@ -568,6 +572,7 @@ polkit_backend_js_authority_finalize (GObject *object) |
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
56 |
|
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
57 |
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
|
58 |
JS_RemoveObjectRoot (authority->priv->cx, &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
|
59 |
+ delete authority->priv->ac; |
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
60 |
JS_RemoveObjectRoot (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
|
61 |
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
|
62 |
|
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
63 |
@@ -1071,8 +1076,6 @@ 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
|
64 |
|
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
65 |
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
|
66 |
|
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
67 |
- 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
|
68 |
- |
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
69 |
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
|
70 |
{ |
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
71 |
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
|
72 |
@@ -1182,8 +1185,6 @@ 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
|
73 |
|
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
74 |
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
|
75 |
|
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
76 |
- 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
|
77 |
- |
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
78 |
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
|
79 |
{ |
1b1f1123c9e3
24975515 polkitd dies in polkit_backend_js_authority_check_authorization_sync
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
diff
changeset
|
80 |
polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority), |