[PATCH 14/17] Close file descriptors while daemonizing auditd

David Shea dshea at redhat.com
Mon Oct 6 13:25:25 UTC 2014


On 09/30/2014 12:40 PM, Vratislav Podzimek wrote:
> On Sun, 2014-09-21 at 15:37 -0400, David Shea wrote:
>> This way parent processes don't try waiting for output that will never
>> come.
>> ---
>>   pyanaconda/isys/auditd.c | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/pyanaconda/isys/auditd.c b/pyanaconda/isys/auditd.c
>> index a75289c..dfe6ad4 100644
>> --- a/pyanaconda/isys/auditd.c
>> +++ b/pyanaconda/isys/auditd.c
>> @@ -107,6 +107,11 @@ int audit_daemonize(void) {
>>       if (child < 0)
>>           return -1;
>>   
>> +    /* Close stdin and friends */
>> +    close(STDIN_FILENO);
>> +    close(STDOUT_FILENO);
>> +    close(STDERR_FILENO);
>> +
> Any chance we could use the 'daemon()' glibc function here?
>

Yeah, probably


More information about the anaconda-patches mailing list