Source-Changes-HG archive

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

[src/trunk]: src/lib/libutil Make login_cap routines resilient to non-existan...



details:   https://anonhg.NetBSD.org/src/rev/9fb6aec60d5d
branches:  trunk
changeset: 480452:9fb6aec60d5d
user:      mjl <mjl%NetBSD.org@localhost>
date:      Thu Jan 13 06:48:14 2000 +0000

description:
Make login_cap routines resilient to non-existant conf file, and
secure_path() less noisy.

diffstat:

 lib/libutil/login_cap.c  |  12 ++++++------
 lib/libutil/securepath.c |   4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diffs (72 lines):

diff -r 7e3cd225a791 -r 9fb6aec60d5d lib/libutil/login_cap.c
--- a/lib/libutil/login_cap.c   Thu Jan 13 06:33:29 2000 +0000
+++ b/lib/libutil/login_cap.c   Thu Jan 13 06:48:14 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: login_cap.c,v 1.1 2000/01/12 05:02:10 mjl Exp $ */
+/* $NetBSD: login_cap.c,v 1.2 2000/01/13 06:48:14 mjl Exp $ */
 
 /*-
  * Copyright (c) 1995,1997 Berkeley Software Design, Inc. All rights reserved.
@@ -135,7 +135,7 @@
 
        errno = 0;
 
-       if (!lc->lc_cap)
+       if (!lc || !lc->lc_cap)
                return (def);
 
        switch (status = cgetstr(lc->lc_cap, cap, &res)) {
@@ -167,7 +167,7 @@
        quad_t q, r;
 
        errno = 0;
-       if (!lc->lc_cap)
+       if (!lc || !lc->lc_cap)
                return (def);
 
        switch (status = cgetstr(lc->lc_cap, cap, &res)) {
@@ -247,7 +247,7 @@
        quad_t q;
 
        errno = 0;
-       if (!lc->lc_cap)
+       if (!lc || !lc->lc_cap)
                return (def);
 
        switch (status = cgetstr(lc->lc_cap, cap, &res)) {
@@ -296,7 +296,7 @@
 
        errno = 0;
 
-       if (!lc->lc_cap)
+       if (!lc || !lc->lc_cap)
                return (def);
 
        switch (status = cgetstr(lc->lc_cap, cap, &res)) {
@@ -334,7 +334,7 @@
        char *cap;
        u_int def;
 {
-       if (!lc->lc_cap)
+       if (!lc || !lc->lc_cap)
                return (def);
 
        return (cgetcap(lc->lc_cap, cap, ':') != NULL);
diff -r 7e3cd225a791 -r 9fb6aec60d5d lib/libutil/securepath.c
--- a/lib/libutil/securepath.c  Thu Jan 13 06:33:29 2000 +0000
+++ b/lib/libutil/securepath.c  Thu Jan 13 06:48:14 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: securepath.c,v 1.1 2000/01/12 05:02:10 mjl Exp $ */
+/* $NetBSD: securepath.c,v 1.2 2000/01/13 06:48:14 mjl Exp $ */
 
 /*-
  * Copyright (c) 1995,1997 Berkeley Software Design, Inc. All rights reserved.
@@ -51,7 +51,7 @@
         * other than root, quit.
         */
        if (lstat(path, &sb) < 0) {
-               syslog(LOG_ERR, "cannot stat %s: %m", path);
+               /* syslog(LOG_ERR, "cannot stat %s: %m", path); */
                return (-1);
        } else if (!S_ISREG(sb.st_mode)) {
                syslog(LOG_ERR, "%s: not a regular file", path);



Home | Main Index | Thread Index | Old Index