[BRLTTY] auth server refuses to start if built without polkit

Dave Mielke dave at mielke.cc
Thu Jul 6 08:21:03 EDT 2017


[quoted lines by Chris Brannon on 2017/07/05 at 11:23 -0700]

>I'd say one of them succeeding should be good enough.  

I've discussed this with the guys who maintain BrlAPI and they agree.

>It's going to complicate the code a little more, because now we have to keep 
>track of both the methods listed in the auth parameter string and the methods 
>that were successfully initialized. 

Of course it'll complicate the code a little, but there's no need to keep track 
of all of the methods that succeed. If only one of them succeeding is good 
enough then there's no need to try any more of them as soon as one of them 
succeeds. In other words, there's only a need to know which one succeeded.

>2. Add a boolean is_initialized flag to each MethodDescriptor, or use NULL 
>MethodDescriptor pointers to indicate uninitialized MethodDescriptors. Then, 
>we have to check to make sure a MethodDescriptor is initialized before trying 
>to use it.

I disagree. I think a far better approach is for the initialize method to 
return a handle of the succeeding paradigm to the caller, and for the caller to 
then pass that same handle to the release function. This would actually make 
the auth code become fully reentrant.

-- 
Dave Mielke           | 2213 Fox Crescent | http://Mielke.cc/
Phone: 1-613-726-0014 | Ottawa, Ontario   | http://Mielke.cc/bible/
EMail: Dave at Mielke.cc | Canada  K2A 1H7   | The Bible is the very Word of God.


More information about the BRLTTY mailing list