FreeBSD's /dev/fd only contains fds 0-2 unless fdescfs is mounted.
In practice this doesn't matter since FreeBSD >= 8 has a native closefrom
This commit is contained in:
@@ -104,8 +104,8 @@ sudo_closefrom(int lowfd)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#elif defined(HAVE_DIRFD)
|
#elif defined(HAVE_DIRFD)
|
||||||
/* Use /proc/self/fd (or /dev/fd on FreeBSD) if it exists. */
|
/* Use /proc/self/fd (or /dev/fd on macOS) if it exists. */
|
||||||
# if defined(__FreeBSD__) || defined(__APPLE__)
|
# ifdef __APPLE__
|
||||||
path = _PATH_DEV "fd";
|
path = _PATH_DEV "fd";
|
||||||
# else
|
# else
|
||||||
path = "/proc/self/fd";
|
path = "/proc/self/fd";
|
||||||
|
Reference in New Issue
Block a user