[PATCH v2] Move polkit to mozjs38

Miloslav Trmac mitr at redhat.com
Tue Apr 4 20:05:11 UTC 2017


Hello,
2017-04-04 21:10 GMT+02:00 Jeremy Linton <jeremy.linton at arm.com>:

> Update polkit to use a more recent version of the mozjs library.
>
…

>   v1->v2: Switch back to using initjs.j rather than init.js
>

Another not-really-a-review:
    Mirek


@@ -1209,10 +1207,13 @@ polkit_backend_js_authority_check_authorization_sync
> (PolkitBackendInteractiveAu
>        goto out;
>      }
>
> +  argv[0].setObject(argv0.toObject());
> +  argv[1].setObject(argv1.toObject());
> +
>    if (!call_js_function_with_runaway_killer (authority,
>                                               "_runRules",
> -                                             G_N_ELEMENTS (argv),
> -                                             argv,
> +                                             //
>  G_N_ELEMENTS (argv),
> +                                             &argv,
>                                               &rval))
>      {
>        polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
> @@ -1220,22 +1221,17 @@ polkit_backend_js_authority_check_authorization_sync
> (PolkitBackendInteractiveAu
>        goto out;
>      }
>
> -  if (JSVAL_IS_NULL (rval))
> -    {
> -      /* this fine, means there was no match, use implicit authorizations
> */
> -      good = TRUE;
> -      goto out;
> -    }
> -
> -  if (!JSVAL_IS_STRING (rval))
> +  if (!rval.isString())
>


Removing this null check means that when polkit._runRules returns null,
“ret” is set to POLKIT_IMPLICIT_AUTHORIZATION_NOT_AUTHORIZED instead of
“implicit”.  To reproduce, on an unmodified Fedora box, interactively
logged in, compare the result of

> pkcheck -p $$ -a org.fedoraproject.FirewallD1.info
>

(and perhaps observe the “WARNING **: Expected a string” messages on stdout
when polkitd is running interactively.)
    Mirek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/polkit-devel/attachments/20170404/189dd7da/attachment.html>


More information about the polkit-devel mailing list