Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/mtree skip comment lines on password and group data...



details:   https://anonhg.NetBSD.org/src/rev/f0a86c6f3b03
branches:  trunk
changeset: 790522:f0a86c6f3b03
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Oct 16 17:27:42 2013 +0000

description:
skip comment lines on password and group databases (Brooks Davis)

diffstat:

 usr.sbin/mtree/getid.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (38 lines):

diff -r a0f9a4333da0 -r f0a86c6f3b03 usr.sbin/mtree/getid.c
--- a/usr.sbin/mtree/getid.c    Wed Oct 16 17:26:14 2013 +0000
+++ b/usr.sbin/mtree/getid.c    Wed Oct 16 17:27:42 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getid.c,v 1.7 2008/04/28 20:24:17 martin Exp $ */
+/*     $NetBSD: getid.c,v 1.8 2013/10/16 17:27:42 christos Exp $       */
 /*     from: NetBSD: getpwent.c,v 1.48 2000/10/03 03:22:26 enami Exp */
 /*     from: NetBSD: getgrent.c,v 1.41 2002/01/12 23:51:30 lukem Exp */
 
@@ -65,7 +65,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: getid.c,v 1.7 2008/04/28 20:24:17 martin Exp $");
+__RCSID("$NetBSD: getid.c,v 1.8 2013/10/16 17:27:42 christos Exp $");
 
 #include <sys/param.h>
 
@@ -230,6 +230,9 @@
                                ;
                        continue;
                }
+               /* skip comments */
+               if (pwline[0] == '#')
+                       continue;
                if (grmatchline(search, gid, name))
                        return 1;
        }
@@ -371,6 +374,9 @@
                                ;
                        continue;
                }
+               /* skip comments */
+               if (pwline[0] == '#')
+                       continue;
                if (pwmatchline(search, uid, name))
                        return 1;
        }



Home | Main Index | Thread Index | Old Index