From: Franc Grootjen (sparky@cs.kun.nl)
Date: 05/10/93


From: sparky@cs.kun.nl (Franc Grootjen)
Subject: serious NFS bug
Date: Mon, 10 May 1993 10:09:25 GMT

Hi!
While using RCS, I discovered a bug in the NFS code.
The following program reproduces it:
====================================================

#include <sys/errno.h>
#include <sys/stat.h>
main()
{
#define READONLY (S_IRUSR|S_IRGRP|S_IROTH) /* r--r--r-- */
  if(creat("burp",READONLY)<0)
    perror("creat");
}

====================================================
This program will create a file called `burp'. On a local disk it
functions properly, but on a NFS mounted disk it will return EACCESS
and will complain with `creat: Permission denied'.
There is _no_ obvious reason for it (the program is not executed by
root)
and the directory is writable. Moreover, in spite of the errormessage,
the
file _is_ created.
Because RCS uses file-creation to ensure atomic access, this bug
prevents anyone to make use of NFS mounted RCS files.
Maybe somebody can spot the bug...
Franc