1.1 --- a/libfsserver/lib/files/ext2_file_opener.cc Sun Aug 01 22:48:12 2021 +0200
1.2 +++ b/libfsserver/lib/files/ext2_file_opener.cc Mon Aug 02 19:39:10 2021 +0200
1.3 @@ -26,6 +26,26 @@
1.4 #include "ext2_file_accessor.h"
1.5 #include "ext2_file_opener.h"
1.6
1.7 +Ext2FileOpener::~Ext2FileOpener()
1.8 +{
1.9 +}
1.10 +
1.11 +/* Test if a directory is being accessed. */
1.12 +
1.13 +bool Ext2FileOpener::accessing_directory(const char *path, flags_t flags, fileid_t fileid)
1.14 +{
1.15 + (void) path; (void) flags;
1.16 + return _ops->is_directory((ext2_ino_t) fileid);
1.17 +}
1.18 +
1.19 +/* Test if a file is being accessed. */
1.20 +
1.21 +bool Ext2FileOpener::accessing_file(const char *path, flags_t flags, fileid_t fileid)
1.22 +{
1.23 + (void) path; (void) flags;
1.24 + return _ops->is_file((ext2_ino_t) fileid);
1.25 +}
1.26 +
1.27 /* Return a file identifier for the given 'path'. */
1.28
1.29 long Ext2FileOpener::get_fileid(const char *path, flags_t flags, fileid_t *fileid)
1.30 @@ -46,7 +66,7 @@
1.31
1.32 /* Create a missing file if possible. */
1.33
1.34 - if (flags & O_CREAT)
1.35 + if ((flags & O_CREAT) && (flags & ~O_DIRECTORY))
1.36 {
1.37 /* Determine whether only the leafname is left of the path, with
1.38 the inode number referring to the parent directory. */