Bug 63575 - [Patch] Fix handling of non-string values coming from rules code
Summary: [Patch] Fix handling of non-string values coming from rules code
Status: RESOLVED FIXED
Alias: None
Product: PolicyKit
Classification: Unclassified
Component: daemon (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: David Zeuthen (not reading bugmail)
QA Contact: David Zeuthen (not reading bugmail)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-15 21:32 UTC by Miloslav Trmac
Modified: 2013-05-06 18:09 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
0001-Fix-a-TypeError-when-no-admin-rules-are-registered.patch (749 bytes, patch)
2013-04-15 21:33 UTC, Miloslav Trmac
Details | Splinter Review
0001-jsauthority-We-can-really-only-handle-a-string.patch (930 bytes, patch)
2013-04-16 18:07 UTC, Colin Walters
Details | Splinter Review
0001-Fix-handling-of-null-returned-from-_runRules.patch (1.47 KB, patch)
2013-04-18 18:36 UTC, Miloslav Trmac
Details | Splinter Review
0002-Refuse-non-string-parameters-to-Polkit.spawn.patch (1.29 KB, patch)
2013-04-18 18:36 UTC, Miloslav Trmac
Details | Splinter Review

Description Miloslav Trmac 2013-04-15 21:32:04 UTC

    
Comment 1 Miloslav Trmac 2013-04-15 21:33:55 UTC
Created attachment 78040 [details] [review]
0001-Fix-a-TypeError-when-no-admin-rules-are-registered.patch
Comment 2 Colin Walters 2013-04-16 18:07:13 UTC
Your patch looks correct, but I find it baffling the JS code turns an array into a comma separated string, which the C code then splits back...
Comment 3 Colin Walters 2013-04-16 18:07:48 UTC
Created attachment 78105 [details] [review]
0001-jsauthority-We-can-really-only-handle-a-string.patch

Does this further patch look correct?
Comment 4 Miloslav Trmac 2013-04-18 18:36:10 UTC
Created attachment 78191 [details] [review]
0001-Fix-handling-of-null-returned-from-_runRules.patch

(In reply to comment #3)
> Created attachment 78105 [details] [review] [review]
> 0001-jsauthority-We-can-really-only-handle-a-string.patch
> 
> Does this further patch look correct?

Yes.  (Currently JSVAL_TO_STRING seems to return NULL for null, but that's an an undefined implementation detail - and g_utf16_to_utf8 undefined on NULL anyway.)

There are two other places that don't handle the JSVAL_TO_* assumptions correctly, attaching further patches (and retitling bug).
Comment 5 Miloslav Trmac 2013-04-18 18:36:33 UTC
Created attachment 78192 [details] [review]
0002-Refuse-non-string-parameters-to-Polkit.spawn.patch
Comment 6 Colin Walters 2013-05-06 17:46:58 UTC
Comment on attachment 78192 [details] [review]
0002-Refuse-non-string-parameters-to-Polkit.spawn.patch

Review of attachment 78192 [details] [review]:
-----------------------------------------------------------------

Looks right.
Comment 7 Miloslav Trmac 2013-05-06 18:09:34 UTC
Thanks, all applied (with trivial fix to apply on top of the s/dJS/JS/ change).


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.