monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: closing file descriptors


From: Martin Pala
Subject: Re: closing file descriptors
Date: Sat, 28 Sep 2002 16:02:02 +0200

Its for security purpose - you can read about it for example in this guide:
http://www.suse.com/us/private/support/howto/secprog/index.html.

Btw. - maybe it can be better to get the number of filedescriptors from the
system, instead of using '1024' constant. On lot of servers is needed much
higher filedescriptors number (for example database servers, etc.) In above
mentioned guide is piece of code that address similar thing.

Martin

----- Original Message -----
From: <address@hidden>
To: <address@hidden>
Sent: Saturday, September 28, 2002 6:32 AM
Subject: closing file descriptors


> This piece of code bothers me in env.c:
>
>
>   /*
>    * Require that the other file descriptios are closed. Should we use
>    * sysconf() or getdtablesize() or getrlimit() or...
>    */
>   for(i = 3; i < 1024; i++)
>       (void) close(i);
>   errno= 0;
>
>
> I don't understand why this is done.
>
>
>
>
> --
> To unsubscribe:
> http://mail.freesoftware.fsf.org/mailman/listinfo/monit-general
>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]