[PATCH 14/17] Close file descriptors while daemonizing auditd
Vratislav Podzimek
vpodzime at redhat.com
Tue Sep 30 16:40:06 UTC 2014
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?
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list