[PATCH app-xdm 18/19] config: replace platform check with compiler defines for SU

Gaetan Nadon memsize at videotron.ca
Thu Sep 2 13:58:00 PDT 2010


On Thu, 2010-09-02 at 13:03 -0700, Alan Coopersmith wrote:

> > Not sure this is progress.  Generally people want to move away from
> > #ifdef's and move to putting checks in the configure script instead
> of
> > the other way around.

Somehow I got the opposite impression, but I cannot pin point how
exactly.
In this case, the platform check was incomplete/incorrect, so that helps
in favor of using
the compiler which is supposed to know this stuff better than anybody
else.

I also considered this platform check "duplicate code". The resource
file in config already go
through the pain of using the preprocessor, so why reinvent the wheel
again.
That's what tipped the balance in favor of ifdef. 

A small improvement would be to use CSRG_BASED as it encapsulates the
definition
of BSD-like systems. I did not think it was appropriate to include
Xosdefs.h in there.
There is also another definition of CSRG_BASED in the server.

With either method, if a new distro comes along, an update is required.
I also have
this bug report in mind
(https://bugs.freedesktop.org/show_bug.cgi?id=6305)
which does not like either method. I try to find a feature check when
possible.


> 
> Ideally we'd figure out some way to test for -m support, instead of
> having
> to keep track of the set of uname values or preprocessor defines that
> currently represent OS'es with a BSD-like userland (while new BSD
> distros
> don't spring up as often as new Linux distros, it is still a pain
> every
> few years to go find all the places to add "|| dragonfly" or whatever
> the
> next new one will be, and the hybrids like GNU/kFreeBSD confuse things
> even more).
> 
> Unfortunately, I can't think of a good way to test su functionality in
> a configure script.   I wonder if it would be better to replace use of
> su in the xdm-config with code to setuid before running the *.willing
> script, to a userid specified in a new option in the xdm-config.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100902/d2ffaa20/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100902/d2ffaa20/attachment.pgp>


More information about the xorg-devel mailing list