On 2/2/24 12:05, Alan Coopersmith wrote:
On 2/2/24 05:45, Enrico Weigelt, metux IT consult wrote:
Hello folks,

I wonder whether we still need the Fopen() function.

It's a funny and complicated way of loading a file with dropped privs
(by calling `cat` on that file !).

It only does the cat if HAS_SAVED_IDS_AND_SETEUID is not defined, and
that should be defined on all POSIX systems - though it looks like our
current check is:

#if defined(SVR4) || defined(__linux__) || defined(CSRG_BASED)
#define HAS_SAVED_IDS_AND_SETEUID
#endif

I suspect for the OS'es that the xserver code builds on today, that
could be replaced by #ifndef WIN32, which would then allow the first
half of that #ifdef in Fopen to be deleted, leaving just the simpler
case, since Fopen is already not built for WIN32.

https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1266

--
        -Alan Coopersmith-                 alan.coopersm...@oracle.com
         Oracle Solaris Engineering - https://blogs.oracle.com/solaris

Reply via email to