Bug 524830 - Malformed subject string error in method polkit_subject_from_string
Malformed subject string error in method polkit_subject_from_string
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: polkit (Show other bugs)
12
All Linux
low Severity medium
: ---
: ---
Assigned To: David Zeuthen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-09-22 08:19 EDT by Radek Novacek
Modified: 2009-11-23 14:29 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-11-23 14:29:12 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Simple program for reproducing the bug (1.35 KB, text/plain)
2009-09-22 08:19 EDT, Radek Novacek
no flags Details
patch (1.15 KB, patch)
2009-09-24 14:26 EDT, Matthias Clasen
no flags Details | Diff

  None (edit)
Description Radek Novacek 2009-09-22 08:19:24 EDT
Created attachment 362071 [details]
Simple program for reproducing the bug

Description of problem:
Method "polkit_subject_to_string" returns string that "polkit_subject_from_string" doesn't understand to.

Version-Release number of selected component (if applicable):
polkit-0.94-3.fc12.i686

How reproducible:
Compile and run the program from attachment.

Steps to Reproduce:
1. Authorize some action with "keep" action
2. Run the program
  
Actual results:
Method "polkit_subject_from_string" returns this error: "Malformed subject string 'unix-process:12803:333196'"

Expected results:
It should return correct PolkitSubject.

Additional info:
Another strange this is that "g_type_init()" must be present in the code or program is segfaulting.
Comment 1 Matthias Clasen 2009-09-22 14:18:15 EDT
I can confirm the roundtrip error.
The need to call g_type_init () is not a bug though.
Comment 2 Radek Novacek 2009-09-24 10:11:23 EDT
I can't find any mention of calling g_type_init() in the documentation, do I miss something? It is in the example but it can be easily missed. Shouldn't it be more emphasised somehow?
Comment 3 Matthias Clasen 2009-09-24 10:17:01 EDT
It is probably worth mentioning, but it is pretty well-known that this is necessary when using gobject-based libraries. Of course, if you are using GTK+, this is handled for your by gtk_init() anyway.
Comment 4 Matthias Clasen 2009-09-24 14:26:55 EDT
Created attachment 362547 [details]
patch

Here is a patch that fixes the parsing of the starttime part of a process id string. Might be cleaner to just require the starttime to always be there, instead of parsing two different formats like my patch does.
Comment 5 Matthias Clasen 2009-09-28 14:18:04 EDT
Upstream at https://bugs.freedesktop.org/show_bug.cgi?id=24197
Comment 6 Bug Zapper 2009-11-16 07:45:24 EST
This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle.
Changing version to '12'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 7 Matthias Clasen 2009-11-23 14:29:12 EST
This has been fixed in 0.95

Note You need to log in before you can comment on or make changes to this bug.