Module Name:    src
Committed By:   njoly
Date:           Thu Mar 15 12:49:36 UTC 2012

Modified Files:
        src/lib/libpuffs: creds.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/lib/libpuffs/creds.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libpuffs/creds.c
diff -u src/lib/libpuffs/creds.c:1.15 src/lib/libpuffs/creds.c:1.16
--- src/lib/libpuffs/creds.c:1.15	Fri Nov 20 14:23:54 2009
+++ src/lib/libpuffs/creds.c	Thu Mar 15 12:49:36 2012
@@ -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 @@ puffs_access_times(uid_t uid, gid_t gid,
 	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);
 }

Reply via email to