Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/miscfs/genfs Fix EPERM vs EACCES on chtimes (thanks @han...



details:   https://anonhg.NetBSD.org/src/rev/5cc934c253a1
branches:  trunk
changeset: 972229:5cc934c253a1
user:      christos <christos%NetBSD.org@localhost>
date:      Wed May 20 17:06:15 2020 +0000

description:
Fix EPERM vs EACCES on chtimes (thanks @hannken)

diffstat:

 sys/miscfs/genfs/genfs_vnops.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r a70e1f07d29f -r 5cc934c253a1 sys/miscfs/genfs/genfs_vnops.c
--- a/sys/miscfs/genfs/genfs_vnops.c    Wed May 20 17:04:58 2020 +0000
+++ b/sys/miscfs/genfs/genfs_vnops.c    Wed May 20 17:06:15 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: genfs_vnops.c,v 1.206 2020/05/18 19:55:42 christos Exp $       */
+/*     $NetBSD: genfs_vnops.c,v 1.207 2020/05/20 17:06:15 christos Exp $       */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfs_vnops.c,v 1.206 2020/05/18 19:55:42 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_vnops.c,v 1.207 2020/05/20 17:06:15 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1320,7 +1320,7 @@
         * server time.
         */
        if ((error = VOP_ACCESSX(vp, VWRITE_ATTRIBUTES, cred)) != 0)
-               return (error);
+               return (vaflags & VA_UTIMES_NULL) == 0 ? EPERM : EACCES;
 
        /* Must be owner, or... */
        if (kauth_cred_geteuid(cred) == owner_uid)



Home | Main Index | Thread Index | Old Index