Xref: utzoo comp.bugs.4bsd:1713 comp.lang.c:35753 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!munnari.oz.au!goanna!ok From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) Newsgroups: comp.bugs.4bsd,comp.lang.c Subject: Re: Complexity of reallocating storage (was users command crap) Message-ID: <4702@goanna.cs.rmit.oz.au> Date: 4 Feb 91 04:58:36 GMT References: <21548@yunexus.YorkU.CA> <5883:Feb102:05:4991@kramden.acf.nyu.edu> <14994:Feb207:10:4791@kramden.acf.nyu.edu> Followup-To: comp.bugs.4bsd Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 21 In article <14994:Feb207:10:4791@kramden.acf.nyu.edu>, brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes: > > if (chdir(newsuid) == -1) { > > (void) mkdir(newsuid,0700); > This cannot fail unless some renegade sysadmin changes the mode of the > session directory while pty is running. Er, what about the disc running out of I-nodes? Or going over quota? Or a file server dropping dead? > > (void) chdir(newsuid); > > } > Cannot fail. Can fail if the preceding mkdir() failed -- see above. There is *always* another way for things to go wrong. -- The Marxists have merely _interpreted_ Marxism in various ways; the point, however, is to _change_ it. -- R. Hochhuth.