add closefrom() call

2007-07-04 Thread Ighighi Ighighi
The closefrom() call, available in Solaris, is present in NetBSD since version 3.0. It is implemented with the F_CLOSEM fcntl() available since version 2.0. These 2 fcntl would be cool to have in FreeBSD: F_CLOSEM Close all file descriptors greater than or equal to fd. F_MAXFDRetu

Re: add closefrom() call

2007-07-06 Thread Ighighi Ighighi
LI Xin wrote: Here is my implementation for FreeBSD. Some difference between my and DragonFly's implementation: - closefrom(-1) would be no-op on DragonFly, my version would close all open files (From my understanding of OpenSolaris's userland implementation, this is Solaris's behavior). - my

Re: local "jailed" symlinks

2007-09-13 Thread Ighighi Ighighi
On 9/13/07, Joshua Isom _ jrisom at gmail.com _ wrote: > Make all of your symlinks relative instead of absolute. It might mean > linking /foo/bar/baz to /bax/bay/baw as ../../../bax/bay/baw but it > would suffice. This is precisely the kind of manual intervention that I want to avoid... Ideally,

Re: add closefrom() call

2007-07-09 Thread Ighighi
>Date: Mon, 09 Jul 2007 15:00:21 +0800 >From: LI Xin <[EMAIL PROTECTED] > >Subject: Re: add closefrom() call >To: Robert Watson <[EMAIL PROTECTED] > >Cc: FreeBSD Hackers >, [EMAIL PROTECTED]

local "jailed" symlinks

2007-09-13 Thread Ighighi
I run multiple operating systems on my PC and access their filesystems from FreeBSD. Recently I've been playing with the idea that it may be useful to have a mount flag similar to MNT_NOSYMFOLLOW that restricts symbolic links in the flagged filesystems to them, that at least avoids crossing to pa

add closefrom() call revisited

2007-09-19 Thread Ighighi
/closefrom syscall X./closefrom sysctl X./closefrom brute X SHAR_END echo x closefrom/module mkdir -p closefrom/module > /dev/null 2>&1 echo x closefrom/test mkdir -p closefrom/test > /dev/null 2>&1 echo x closefrom/test/closefrom.c sed 's/^X//' > closefrom/test/cl

POSIXfy readlink() call

2007-09-28 Thread Ighighi
The POXIX prototype for readlink(2) is: ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize); See: http://www.opengroup.org/onlinepubs/95399/functions/readlink.html NetBSD already did it: http://netbsd.gw.com/cgi-bin/man-cgi?readlink+2+ It'd be good have it corr