]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
lib/vfscore: Remove VAPPEND mode
authorMarc Rittinghaus <marc.rittinghaus@unikraft.io>
Mon, 24 Apr 2023 14:13:06 +0000 (16:13 +0200)
committerUnikraft <monkey@unikraft.io>
Tue, 2 May 2023 20:19:25 +0000 (20:19 +0000)
vfscore defines a VAPPEND mode bit which is only used in
sys_utimensat() and which erroneously overlaps with VEXEC permission
for the group. While VAPPEND is a useful feature, it needs a proper
definition and support in all vfscore APIs. We thus remove the
broken definition for now.

Signed-off-by: Marc Rittinghaus <marc.rittinghaus@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Rares Miculescu <miculescur@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #865

lib/vfscore/include/vfscore/vnode.h
lib/vfscore/syscalls.c

index 967d6cc128c6595b8c261644035789c9bfef0dfe..70fe7ba50dbc60e622815d210a64cd02d9acffaa 100644 (file)
@@ -137,7 +137,6 @@ struct vattr {
 /*
  *  Modes.
  */
-#define VAPPEND 00010
 #define        VREAD   00004           /* read, write, execute permissions */
 #define        VWRITE  00002
 #define        VEXEC   00001
index 43b3df2d4743ef9a12f4a103d89e51896bf6f87b..2b2511c40db4d5dfa30436c86cf767036a5f9892 100644 (file)
@@ -1462,11 +1462,6 @@ sys_utimensat(int dirfd, const char *pathname, const struct timespec times[2], i
                if (vn_access(dp->d_vnode, VWRITE)) {
                        return EACCES;
                }
-               if (times &&
-                       (times[0].tv_nsec != UTIME_NOW || times[1].tv_nsec != UTIME_NOW) &&
-                       (times[0].tv_nsec != UTIME_OMIT || times[1].tv_nsec != UTIME_OMIT) &&
-                       (!(dp->d_vnode->v_mode & ~VAPPEND)))
-                       return EPERM;
                error = vn_settimes(dp->d_vnode, timespec_times);
        }