NFS open/creat hack

A hack to work around non-POSIX NFS <-> FUSE behavior where it turns
an open(O_EXCL|O_CREAT,0444) into multiple calls that results in
EACCES.
This commit is contained in:
Antonio SJ Musumeci 2020-07-16 15:31:50 -04:00
parent 5a0568495b
commit 93218a343a
12 changed files with 280 additions and 18 deletions

View file

@ -25,14 +25,14 @@
#include "fs_base_stat.hpp"
#include "fs_base_unlink.hpp"
#include <string>
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <string>
using std::string;
static
@ -63,7 +63,12 @@ namespace fs
bool
is_eligible(const int flags_)
{
return ((flags_ & O_RDWR) || (flags_ & O_WRONLY));
int accmode;
accmode = (flags_ & O_ACCMODE);
return ((accmode == O_RDWR) ||
(accmode == O_WRONLY));
}
bool