Bug 41513 - luit 1.1.0 builds incorrectly for FreeBSD
Summary: luit 1.1.0 builds incorrectly for FreeBSD
Status: CLOSED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: App/luit (show other bugs)
Version: 7.6 (2010.12)
Hardware: Other FreeBSD
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-06 05:23 UTC by Andrey Chernov
Modified: 2011-10-15 16:41 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Andrey Chernov 2011-10-06 05:23:28 UTC
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.
Comment 1 Jeremy Huddleston Sequoia 2011-10-06 10:52:57 UTC
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.