Source-Changes-HG archive

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

[src/trunk]: src/lib/libpuffs Use puffs_access() return value in the VA_UTIME...



details:   https://anonhg.NetBSD.org/src/rev/330fd0bc85b5
branches:  trunk
changeset: 778075:330fd0bc85b5
user:      njoly <njoly%NetBSD.org@localhost>
date:      Thu Mar 15 12:49:36 2012 +0000

description:
Use puffs_access() return value in the VA_UTIMES_NULL case.

diffstat:

 lib/libpuffs/creds.c |  13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diffs (34 lines):

diff -r 0a174072d3b0 -r 330fd0bc85b5 lib/libpuffs/creds.c
--- a/lib/libpuffs/creds.c      Thu Mar 15 12:42:28 2012 +0000
+++ b/lib/libpuffs/creds.c      Thu Mar 15 12:49:36 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: creds.c,v 1.15 2009/11/20 14:23:54 pooka Exp $ */
+/*     $NetBSD: creds.c,v 1.16 2012/03/15 12:49:36 njoly Exp $ */
 
 /*
  * Copyright (c) 2006  Antti Kantee.  All Rights Reserved.
@@ -29,7 +29,7 @@
 
 #include <sys/cdefs.h>
 #if !defined(lint)
-__RCSID("$NetBSD: creds.c,v 1.15 2009/11/20 14:23:54 pooka Exp $");
+__RCSID("$NetBSD: creds.c,v 1.16 2012/03/15 12:49:36 njoly Exp $");
 #endif /* !lint */
 
 /*
@@ -250,10 +250,11 @@
        const struct puffs_cred *pcr)
 {
 
-       if (!puffs_cred_isuid(pcr, uid) && !puffs_cred_isjuggernaut(pcr)
-           && (va_utimes_null == 0
-             || puffs_access(VNON, mode, uid, gid, PUFFS_VWRITE, pcr) != 0))
+       if (puffs_cred_isuid(pcr, uid) || puffs_cred_isjuggernaut(pcr))
+               return 0;
+
+       if (va_utimes_null == 0)
                return EPERM;
 
-       return 0;
+       return puffs_access(VNON, mode, uid, gid, PUFFS_VWRITE, pcr);
 }



Home | Main Index | Thread Index | Old Index