HP3000-L Archives

June 2001, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Bixby <[log in to unmask]>
Reply To:
Mark Bixby <[log in to unmask]>
Date:
Wed, 20 Jun 2001 13:25:17 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (49 lines)
Lars Appel wrote:
>
> Mark wrote...
>
> >But if you really do need to change uids, be aware then setuid() requires
> >priv-mode:
> >
> >#ifdef mpeix
> >  GETPRIVMODE();
> >  setuid(nnn);
> >  GETUSERMODE();
> >#endif
> >
> >There is no nice() function on MPE, so just omit it from the compile:
> >
> >#ifndef mpeix
> >  nice(nnn);
> >#endif
>
> Instead of modifying the original code (with #ifdef's) you could
> also supply your own setresuid() and nice() functions as wrapper
> for GETPRIVMODE/setuid/GETUSERMODE and/or no-op, respectively,
> and adjust the CPPFLAGS or CFLAGS or LDFLAGS of the build script
> or Makefile to pick up your supplemental header files and code.
>
> This way, you could minimize the modifications to the original
> source code and maybe improve your chances to also build later
> versions on MPE/iX successfully.

I've used both approaches in my various ports.  Which way I go mostly depends
on the style that modifications for the other OSes are using in a particular
port.

If an app already has a provision for OS-specific portability libraries, then
Lars' suggestion is the best method.

Hmmm... and Apache falls into that category.  Though I don't know off the top
of my head if suexec is built linked against the OS library.  Look at the stuff
in src/os/mpeix (?).  A setuid wrapper in src/os/mpeix would possibly force you
to modify existing MPE setuid code elsewhere in Apache.  Feel free to do this
(I have never claimed to "own" the Apache port), but be careful not to break
existing MPE functionality.
--
[log in to unmask]
Remainder of .sig suppressed to conserve scarce California electrons...

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2