Possible PolicyKit issues

Joe Marcus Clarke marcus at freebsd.org
Wed Apr 30 13:21:55 PDT 2008


David Zeuthen wrote:
> On Wed, 2008-04-30 at 13:52 -0400, Joe Marcus Clarke wrote:
>> David Zeuthen wrote:
>>> On Wed, 2008-04-30 at 13:44 -0400, Joe Marcus Clarke wrote:
>>>> Correct.  I think it does read all the data, then the stream puts out 
>>>> EOF which causes the helper to be called ad infinitum.
>>> I see. Mmm.. In that case, polkit_grant_io_func() can detect EOF
>>> (getline() returning -1) and then call the remove_watch() method
>>> supplied by polkit-gnome-manager.c right?
>> It could, but what's the difference between that and returning FALSE in 
>> the caller?  Both would result in the watch being removed.  And since 
>> the io_func reads the entire amount of data (until EOF) that shouldn't 
>> be a problem.
> 
> The PAM conversation happens over that fd and for some cases I don't
> think we read all the data at once. So there may be multiple calls to
> polkit_grant_io_func(). As such, returning FALSE won't work for all
> cases.

It looks like it will (read all data).  The polkit_grant_io_func() runs 
in a while loop waiting for readline to return -1.  I don't see that 
this function ever returns to the caller until readline returns -1 
(signifying EOF or some other error).  Am I misunderstanding something?

Joe

-- 
Joe Marcus Clarke
FreeBSD GNOME Team	::	gnome at FreeBSD.org
FreeNode / #freebsd-gnome
http://www.FreeBSD.org/gnome


More information about the hal mailing list