Re: [REQUEST FOR VOTES] snmpd: Call fclose() after fdopen() but not close()

Bart Van Assche <[email protected]>
Newsgroups gmane.network.net-snmp.devel
Message-ID <[email protected]>
On 2020-08-08 16:16, Magnus Fromreide wrote:
> That file is a mess.
> 
> Have anyone heard from Alexander Prömel regarding those temporary hard coded
> pathnames that should be fixed soon? I think 14 years cover any reasonable
> definition of the word 'soon'.
> 
> Why are both the file descriptor and the FILE* stored in the first place?
> It seems the read part of the code is using buffered I/O (fIn) while the
> write part of the code is using unbuffered I/O (fdOut) so I think fdIn and
> fOut should be removed completley.

I propose to delete the uClinux code from agent/mibgroup/util_funcs.c.
get_exec_pipes() is only used to open persistent pipes. So it is essential
to use fork(). Using vfork() in the implementation of get_exec_pipes() is
wrong because vfork() blocks the caller until the child process has
finished.

Bart.


_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.