Porting sudo to QNX6
allen at huarp.harvard.edu
Thu May 15 12:49:58 EDT 2003
I have successfully compiled sudo under QNX6.2.0, but I did
have a couple snags I had to work around:
When uid=0 and euid=user-uid, the call to setreuid(0,0)
fails. This is reportedly due to changes in the Unix98
standard. What's illegal is not setting the euid to 0,
but 'setting' the real uid to 0. The legal call is
I'm not sure what the most portable way to patch this is.
In the PERM_FULL_ROOT and PERM_ROOT cases, are there
any assumptions about the uid and euid? Is it just that
one or the other is 0? If euid is 0, we can do anything,
so setreuid(0,0) is fine. If euid!=0, then uid had
better be 0, so setreuid(-1,0) would be the correct
The select header does not define NFDBITS et. al.
This is somewhat academic because select() is
broken for terminals in edit mode, so I configure
--with-password-timeout=0, but tgetpass still
needs to be able to compile the select code,
so I hacked in a bit of stuff.
Why did you choose to use select rather than alarm()?
That approach seems over-complicated, considering
you are waiting on just one fd.
I'm more than happy to provide real patches, but I
wanted to get some idea how you would like me to
address these issues first.
Anderson Group - Stratospheric Chemistry Research
More information about the sudo-workers