]> granicus.if.org Git - sudo/commitdiff
FreeBSD's /dev/fd only contains fds 0-2 unless fdescfs is mounted.
authorTodd C. Miller <Todd.Miller@sudo.ws>
Fri, 26 Apr 2019 21:21:29 +0000 (15:21 -0600)
committerTodd C. Miller <Todd.Miller@sudo.ws>
Fri, 26 Apr 2019 21:21:29 +0000 (15:21 -0600)
In practice this doesn't matter since FreeBSD >= 8 has a native closefrom

lib/util/closefrom.c

index 106925b9ebbd4e7c92559b95941abeec1a86e001..7f773a2e13193df6f1d1e960eefd446e65a61c54 100644 (file)
@@ -104,8 +104,8 @@ sudo_closefrom(int lowfd)
        return;
     }
 #elif defined(HAVE_DIRFD)
-    /* Use /proc/self/fd (or /dev/fd on FreeBSD) if it exists. */
-# if defined(__FreeBSD__) || defined(__APPLE__)
+    /* Use /proc/self/fd (or /dev/fd on macOS) if it exists. */
+# ifdef __APPLE__
     path = _PATH_DEV "fd";
 # else
     path = "/proc/self/fd";