home *** CD-ROM | disk | FTP | other *** search
- Submitted-by: gwyn@smoke.brl.mil (Doug Gwyn)
-
- In article <10of3aINN37a@ftp.UU.NET> henry@zoo.toronto.edu (Henry Spencer) writes:
- >The alternative is an implementation that fails in certain situations,
- >such as a setuid program running in a protected directory. (It may not
- >be able to read the directory, even if you can.) The one advantage of
- >a system("pwd") implementation is that you can make /bin/pwd setuid-root
- >to avoid this problem. Whether it's worth it is debatable.
-
- On my copy of SunOS 4.1.1, the "pwd" utility is not installed set-UID 0,
- and I'm pretty sure that was the way Sun set it up. Should it be? That
- seems to depend on whether or not you think it should always return the
- answer even if an attempt was made to hide the information.
-
- Anyway, as I see it the real problem with SIGCHLD, wait(), etc. is that
- the UNIX interface for this is not at all what one would really want.
- For example, you ought to be able to wait() for just the specified PID
- rather than ANY old child. The traditional way around that is to fork
- one extra level so the deepest wait() cannot pick up the wrong child,
- but that's pretty gross too. Recently wait4() and waitpid() have been
- added to provide direct support for this, but there is a lot of old code
- in existence that uses wait() or wait3().
-
- The System V additional semantics for SIGCLD (its effect on wait()) are
- a kludge on top of an already kludgy subsystem that causes additional
- grief when porting existing applications. And nearly every use of
- SIGCHLD I've seen has been problematic in that it is quite difficult to
- correctly coordinate the "top" (main application) and "bottom" (signal
- handler) halves of the program when the SIGCHLD handler modifies process
- status data that the top end is examining; concurrency interlock of some
- sort is needed in such designs. Consequently I generally recommend
- against using SIGCHLD.
-
- As I recall the Plan 9 description, it has a more rational notion of
- parent-child communication (for example, fork() returning a file
- descriptor over which the child exit status string can be transmitted),
- and perhaps work should be done to study such implementations with an
- eye to borrowing from them to supplement existing UNIX facilities (and
- hopefully eventually supersede them).
-
-
- Volume-Number: Volume 28, Number 16
-
-