[SSSD] [PATCH] Add config_from_fd() to ini_config

Simo Sorce ssorce at redhat.com
Mon Sep 28 13:55:38 UTC 2009


On Mon, 2009-09-28 at 09:38 -0400, Stephen Gallagher wrote:
> The SSSD needs a config_from_fd() variant of the config_from_file()
> call
> so that we can preopen a config file and perform some verification on
> it
> before parsing it. The config_from_fd() call is used to avoid race
> conditions between testing the file and reading it in.
> 
> Note: the *_from_fd() functions still require the config file name for
> internal information. This does not imply that it is used to open the
> file.

I think it is better not to require a file name, and, internally, just
use something like "dummy" or a random string like the process pid etc..

This way there is no risk that someone may accidentally change the code
later to re-open the file or something like that, if that is done it
will immediately break when it tries to open "dummy" (hopefully :-)

Simo.




More information about the sssd-devel mailing list