Source-Changes-HG archive

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

[src/trunk]: src/lib/libutil Don't bother calling secure_path() is kernel == ...



details:   https://anonhg.NetBSD.org/src/rev/8449bde85a29
branches:  trunk
changeset: 536273:8449bde85a29
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Sep 12 14:42:15 2002 +0000

description:
Don't bother calling secure_path() is kernel == _PATH_UNIX. If you are going
to default to it and use it anyway, why do the security check?

diffstat:

 lib/libutil/getbootfile.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r c141f59eb819 -r 8449bde85a29 lib/libutil/getbootfile.c
--- a/lib/libutil/getbootfile.c Thu Sep 12 14:28:33 2002 +0000
+++ b/lib/libutil/getbootfile.c Thu Sep 12 14:42:15 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getbootfile.c,v 1.1 2001/04/06 14:31:14 wiz Exp $      */
+/*     $NetBSD: getbootfile.c,v 1.2 2002/09/12 14:42:15 christos Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: getbootfile.c,v 1.1 2001/04/06 14:31:14 wiz Exp $");
+__RCSID("$NetBSD: getbootfile.c,v 1.2 2002/09/12 14:42:15 christos Exp $");
 #endif
 
 #include <sys/param.h>
@@ -78,7 +78,8 @@
                }
 
                /* check if we got a valid and 'secure' filename */
-               if (secure_path(kernel) != 0) {
+               if (strcmp(kernel, _PATH_UNIX) != 0 && 
+                   secure_path(kernel) != 0) {
                        /* doesn't seems so, fall back to default */
                        kernel = _PATH_UNIX;
                }



Home | Main Index | Thread Index | Old Index