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

Chris Brannon chris at the-brannons.com
Wed Jul 5 14:23:49 EDT 2017


Dave Mielke <dave at mielke.cc> writes:

>>The initializeMethodDescriptors code from Programs/auth.c is very
>>simple.  If any method descriptor fails to initialize, then all of them
>>are released, and the auth server will not start.
>
> Is this really what we want, then? Mightn't it be better that we only require 
> one of them to succeed?

I'd say one of them succeeding should be good enough.  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.
I see a couple options.
1. Make auth->methods a linked list.  Only add a MethodDescriptor to the
list if the descriptor was successfully initialized.  If the list is
empty at the end of initializeMethodDescriptors, then bail, since
nothing will work.
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.

If we only require one to succeed, we should at least emit a warning
message to the logs indicating the failures.

-- Chris


More information about the BRLTTY mailing list