home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.24 / text0059.txt < prev    next >
Encoding:
Text File  |  1991-09-03  |  7.1 KB  |  153 lines

  1. Submitted-by: brnstnd@KRAMDEN.ACF.NYU.EDU (Dan Bernstein)
  2.  
  3. In the referenced article, Chuck points out that POSIX invented sessions
  4. because they wanted to fix job control. I'm quite aware of this: when I
  5. was complaining about sessions a while back Marc Teitelbaum showed me
  6. what the discussion had been like. There's just one problem.
  7.  
  8. In POSIX, job control is an option. Sessions aren't. I defy any POSIX
  9. supporter to defend this.
  10.  
  11. (My guess, btw, is that the committee was thinking about tty security,
  12. and thought that by adding POSIX sessions they could solve the problems.
  13. Indeed, published claims by Convex, Sun, and even CERT would lead most
  14. people to believe that this is true. It's not. POSIX sessions don't help
  15. tty security one bit.)
  16.  
  17. Even without sessions in the way, POSIX job control is not backwards
  18. compatible. It's missing some BSD features and it added some others.
  19. (For instance, a BSD program can be in the foreground on one terminal
  20. and the background on another. Under POSIX a process is either in the
  21. foreground or in the background [with respect to its controlling
  22. terminal], and access to other ttys simply doesn't have job control.
  23. This ``feature'' broke emacs and screen, among other programs.)
  24.  
  25. In response to my complaint that POSIX invents one thing after another,
  26. Chuck finishes his example of job control with this:
  27.  
  28. karish@mindcraft.com (Chuck Karish) writes:
  29. > They chose invention as the lesser of two
  30. > evils rather than standardize on something that was wrong.
  31.  
  32. Oh, I agree that the BSD job control model was wrong. I agree that
  33. standardizing on a model with many huge flaws is stupid. By what stretch
  34. of the imagination does this mean that standardizing on another model,
  35. which not only has its own flaws but is compatible with nothing and
  36. ridiculously complex, is any less stupid?
  37.  
  38. Your unstated assumption is that POSIX had to settle on *something*.
  39. That's crazy. You don't go making standards this way. It is far, far
  40. better to leave something completely unstandardized than to invent a
  41. standard out of thin air.
  42.  
  43. Readers of comp.unix.wizards will have seen my new, extremely simple job
  44. control model, inspired by a comment from Chris Torek. The model solves
  45. all the problems that POSIX invented sessions to solve. It doesn't need
  46. cttys or sessions. The programming interface consists of exactly three
  47. function calls for manipulating process groups, yet it's enough to
  48. implement a job-control shell. It doesn't interfere with BSD or POSIX
  49. job control, so vendors can implement it safely.
  50.  
  51. Five people responded to that article. Three liked the model. One asked
  52. how he could do certain operations; there were solutions in each case,
  53. but he did convince me that it would probably be easier if one of the
  54. calls were extended or a new call were available.
  55.  
  56. The last observed acidly that I'd never get NIST to change its mind
  57. about a FIPS. Job control will never change again.
  58.  
  59. She was right. I like to think that if POSIX hadn't tried to standardize
  60. job control, some vendors would have implemented my model, some programs
  61. would have been written to use it, and eventually the sheer simplicity
  62. of the interface would win most vendors and programmers over within five
  63. or ten years. But POSIX did standardize job control. They took BSD job
  64. control, mangled it, patched it so that the flaws were well concealed,
  65. and made it into a standard that won't change in the foreseeable future.
  66. Even worse, although they sensibly decided to make job control a mere
  67. option, they made the patches mandatory. NIST drove the last nail when
  68. it required the option as well.
  69.  
  70. I doubt that anything will change now. Vendors climb the POSIX peak and
  71. think their users will be happy. They don't want to experiment---who can
  72. improve on a standard? I can rewrite job control programs to use my
  73. model, but without a platform I won't be able to convince anyone else to
  74. follow my lead. Even Berkeley---once the home of UNIX innovation---cares
  75. more about POSIX compliance than about trying to make life simpler for
  76. programmers.
  77.  
  78. And you, Chuck, tell me that this is how it should be.
  79.  
  80. > To elaborate on the security and efficiency issues, I fail to
  81. > see that either getconf or /inst/bin has any impact on the
  82. > administrator's ability to maintain reasonable system security.
  83.  
  84. As others have pointed out, it is rather difficult to introduce getconf
  85. into a system so that it actually increases security. You have to change
  86. system() so that it always uses sh. You have to make getconf---or at
  87. least the path part of it---a shell builtin. Programs which want to use
  88. this convention for a secure PATH then have to spawn an extra process.
  89.  
  90. In contrast, to introduce /inst/bin into a system is easy. Just make the
  91. directory and add the links. Programs which want to use this convention
  92. for a secure PATH can simply call /inst/bin/tee and so on. Even better,
  93. if you do want to go to all the effort of recompiling programs and
  94. changing libraries, you can change the default login path to /inst/bin,
  95. and all your old programs will use the path automatically. On some
  96. systems you don't even have to recompile---you can just add a line to
  97. /etc/cshrc and /etc/profile.
  98.  
  99. > As others have pointed out, the efficiency of using /inst/bin
  100. > depends on the implementation.
  101.  
  102. Ah, but at least it's getting faster, as more and more vendors adopt
  103. symlinks. For comparison, the efficiency of getconf doesn't really
  104. depend on the implementation. It's slow everywhere.
  105.  
  106. > I consider it to be a poor
  107. > candidate for standardization.
  108.  
  109. Oh, I do too. I consider every solution to this problem to be a poor
  110. candidate for standardization, because (drum roll):
  111.  
  112.     The Market Hath Not Chosen A Solution.
  113.     The Market Hath Hardly Even Considered The Problem.
  114.  
  115. Can you name a single vendor which has a solution to the problem of a
  116. secure path for installed utilities? I'm listening.
  117.  
  118. > >In this particular case, existing programs can be used with /inst/bin
  119. > >without even changing the source code. All you have to do is change the
  120. > >default system PATH. Adding getconf to a program means that the program
  121. > >will no longer work on the vast majority of systems. That's what I mean
  122. > >by unportable.
  123. > There's a simple fix that makes such scripts work:  install
  124. > getconf.
  125.  
  126. But that requires work on the part of *everyone* who wants to use the
  127. script! Surely you admit that this is not a good thing when it can be
  128. avoided.
  129.  
  130. > The issue of script portability is something of a red herring,
  131. > because it has never been possible to write really portable
  132. > scripts.
  133.  
  134. Uh, say what? People *do* write scripts all the time which work on lots
  135. of systems; Configure is a supreme example, but nearly every script is
  136. portable to similar machines.
  137.  
  138. > getconf, sysconf(), pathconf() and fpathconf() exist to make it
  139. > possible to allow programs to make full use of system
  140. > capabilities without being re-compiled for differently-
  141. > configured members of a binary-compatible family and without
  142. > being crippled down to a lowest common denominator.
  143.  
  144. Here's your unstated assumption again: that the standard *has* to
  145. provide some way to do anything that systems code might want to do.
  146. Why? Why is this sort of invention better than letting the market come
  147. to a consensus on each feature first?
  148.  
  149. ---Dan
  150.  
  151. Volume-Number: Volume 24, Number 60
  152.  
  153.