Date: Sat, 29 Nov 2003 15:48:34 -0800 From: Alfred Perlstein <bright@mu.org> To: Daniel Eischen <eischen@vigrid.com> Cc: current@freebsd.org Subject: Re: [PATCH] please review. file descriptor passing for libc_r. Message-ID: <20031129234834.GY35957@elvis.mu.org> In-Reply-To: <Pine.GSO.4.10.10311291753400.10943-100000@pcnet5.pcnet.com> References: <20031129202138.GU35957@elvis.mu.org> <Pine.GSO.4.10.10311291753400.10943-100000@pcnet5.pcnet.com>
next in thread | previous in thread | raw e-mail | index | archive | help
* Daniel Eischen <eischen@vigrid.com> [031129 14:57] wrote: > > > > What do you suggest we do? > > Just close the file: > > if ((fd < 0) || (fd >= _thread_dtablesize) || > (fd == _thread_kern_pipe[0]) || (fd == _thread_kern_pipe[1])) { > /* > * Don't allow silly programs to close the kernel pipe > * and non-active descriptors. > */ > errno = EBADF; > ret = -1; > } > else if (_thread_fd_table[fd] == NULL) > ret = __sys_close(fd); > else { > ... > } So remove the check? do you approve? does re@ approve? Index: uthread_close.c =================================================================== RCS file: /home/ncvs/src/lib/libc_r/uthread/uthread_close.c,v retrieving revision 1.16 diff -u -r1.16 uthread_close.c --- uthread_close.c 9 Jun 2003 16:45:37 -0000 1.16 +++ uthread_close.c 29 Nov 2003 23:48:14 -0000 @@ -50,8 +50,7 @@ struct fd_table_entry *entry; if ((fd < 0) || (fd >= _thread_dtablesize) || - (fd == _thread_kern_pipe[0]) || (fd == _thread_kern_pipe[1]) || - (_thread_fd_table[fd] == NULL)) { + (fd == _thread_kern_pipe[0]) || (fd == _thread_kern_pipe[1])) /* * Don't allow silly programs to close the kernel pipe * and non-active descriptors. -- - Alfred Perlstein - Research Engineering Development Inc. - email: bright@mu.org cell: 408-480-4684
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031129234834.GY35957>