Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Workaround (and only that) for 1.11 for AFS problem afflicting bash

69 views
Skip to first unread message

Karl_Kl...@cs.cmu.edu

unread,
Jan 13, 1992, 3:31:28 PM1/13/92
to
Bash 1.11, pmax, Mach 2.5, including AFS 3.1.

The latest release of AFS around here has caused some grief to the
bash adherents. It seems that bash is all alone in its use of modern
open(2) options (unlike the aging cruft of sh and csh), and as a
result manages to tickle an AFS bug regarding restricted-access
directories: One cannot append to a file one creates in such a
directory, regardless of not having specified O_EXCL in the open(2);
any time that O_CREAT is specified and the file exists, open(2)
protests and returns -1/EACCES. Icktooey. The following is a HACK
and a WORKAROUND to take care of this problem, simply by forcing
removal of the O_CREAT from the incoming flags and retrying the
open(2). This is an AFS-specific hack, it is unneeded and probably a
bug to do this in situations where AFS isn't in use (although it seems
harmless enough to local [real disc] filesystems).

The specific example in mind is a mail-delivery scheme which drops
incoming mail into an AFS dir with access rights "liw." Although
files can be created in such a directory, one can only open and write
them once, even though "w" is part of the rights spec, which ought to
allow one to rewrite them (and specifically append via >>, which is
what fails).

The AFS bug has been reported as well, I'm told.

Credit to Terri Watson <e...@cs.cmu.edu> for having run into this bug
headlong under 1.08 (over Christmas break, of course, when lots of
mail failed to deliver), which we chased for an hour or so last week
until we isolated the problem to AFS O_CREAT trouble.

--karl

*** execute_cmd.c~ Mon Jan 13 12:32:19 1992
--- execute_cmd.c Mon Jan 13 12:31:42 1992
***************
*** 2133,2138 ****
--- 2133,2142 ----
}

fd = open (redirectee_word, redirect->flags, 0666);
+ #if AFS_CREAT_BUG
+ if (fd < 0 && errno == EACCES)
+ fd = open (redirectee_word, (redirect->flags & ~O_CREAT), 0666);
+ #endif
free (redirectee_word);

if (fd < 0 )

0 new messages