[SSSD] [PATCH] Make basic options typed

Stephen Gallagher sgallagh at redhat.com
Mon Sep 14 12:03:14 UTC 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 09/13/2009 10:38 AM, Simo Sorce wrote:
> This patch finally allows us to define the type for basic options.
> It uses a union to store different types, and an enum to list the
> allowed types.
> It also provides for helper functions that always check the type to
> safely retrieve data, or scream loudly if we messed up.
> 
> This allowed me to remove all but 1 special option that was a duplicate
> made only to avoid converting from string to int every time we needed to
> get an option.
> The only remaining special case is the schema type, because that is a
> special string to special number transaltion. But these kind of options
> (another is tls_reqcert) are rare enough that we can avoid trying to
> make special handlers for them too.
> 
> Currently there are 4 types supported: string, blob, number, boolean.
> String has 2 subtypes, const and non const, but they are not enforced
> (you can assign a const string and then re-read it as non-const). But
> this is not really a problem, as values are always copied in the init
> functions, furthermore, although you can get values as non-const they
> should always be regarded a immutable strings as the value returned is
> the actual string saved in the option, so changing it, means changing
> the configuration.
> 
> I think we can later take this code and make it generic in the provider
> backend code, so that all backends can use it. It should be easy enough
> to do.
> 
> Simo.
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> sssd-devel mailing list
> sssd-devel at lists.fedorahosted.org
> https://fedorahosted.org/mailman/listinfo/sssd-devel

Nack. Generates a segfault running "getent passwd user at LDAP"

- -- 
Stephen Gallagher
RHCE 804006346421761

Looking to carve out IT costs?
www.redhat.com/carveoutcosts/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkquMP4ACgkQeiVVYja6o6M4OACgntkADmmKhwSSrPsv8x1sp/LI
mGEAmgM2+NNGDeB3kZO39xE2XZAnPR+p
=yJby
-----END PGP SIGNATURE-----



More information about the sssd-devel mailing list