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

Stephen Gallagher sgallagh at redhat.com
Mon Sep 28 14:33:22 UTC 2009


On 09/28/2009 09:55 AM, Simo Sorce wrote:
> 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.
> 
> _______________________________________________
> sssd-devel mailing list
> sssd-devel at lists.fedorahosted.org
> https://fedorahosted.org/mailman/listinfo/sssd-devel

New version does not require the file name for the _from_fd() functions.
It will create a string "dummy_<fd>" to use for the config file name
internally.



-- 
Stephen Gallagher
RHCE 804006346421761

Looking to carve out IT costs?
www.redhat.com/carveoutcosts/
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-Add-config_from_fd-to-ini_config.patch
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20090928/9706e1f7/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20090928/9706e1f7/attachment.sig>


More information about the sssd-devel mailing list