Despite its all autoconfiguration attempts luit needs to manually add -DBSD to CFLAGS to make this line from sys.c working: #if (defined(BSD) && !defined(_POSIX_SAVED_IDS)) || defined(_MINIX) because it immediately quits with "Couldn't drop privileges: Function not implemented" otherwise - FreeBSD does not turn _POSIX_SAVED_IDS on.
This has been there since the initial import. On FreeBSD 7, FreeBSD 8, and NetBSD 5.1: sys.c includes <unistd.h> <unistd.h> includes <sys/unistd.h> <sys/unistd.h> has: /* * Although we have saved user/group IDs, we do not use them in setuid * as described in POSIX 1003.1, because the feature does not work for * root. We use the saved IDs in seteuid/setegid, which are not currently * part of the POSIX 1003.1 specification. XXX revisit for 1003.1-2001 * as this is now mandatory. */ #ifdef _NOT_AVAILABLE #define _POSIX_SAVED_IDS 1 /* saved set-user-ID and set-group-ID */ #endif OpenBSD has _POSIX_SAVED_IDS I think the old imake build system was setting BSD... nothing sets it any more. commit 82bec8b84d90d37f75f10b3abe9ec34a3415a622 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu Oct 6 10:50:54 2011 -0700 Fix ifdef-foo for the BSDs which are still living in the 90s NetBSD and FreeBSD still don't _POSIX_SAVED_IDS https://bugs.freedesktop.org/show_bug.cgi?id=41513 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.