summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>1998-10-28 00:03:49 +0000
committerBrian Somers <brian@FreeBSD.org>1998-10-28 00:03:49 +0000
commit42373eb6be0c2bf681b516268fd4476f33992a41 (patch)
tree88a6cd233b6d86f88abc3ec37b3f445a6df3ceee /lib
parent3851a58038329a225bc95c210ba17bf869248173 (diff)
Notes
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/getgrent.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/libc/gen/getgrent.c b/lib/libc/gen/getgrent.c
index 41fe41ebd96d..0a37cf9e411e 100644
--- a/lib/libc/gen/getgrent.c
+++ b/lib/libc/gen/getgrent.c
@@ -61,6 +61,8 @@ static char *members[MAXGRP];
#define MAXLINELENGTH 1024
static char line[MAXLINELENGTH];
+#define GROUP_IGNORE_COMMENTS 1 /* allow comments in /etc/group */
+
struct group *
getgrent()
{
@@ -236,6 +238,15 @@ grscan(search, gid, name)
;
continue;
}
+
+#ifdef GROUP_IGNORE_COMMENTS
+ for (cp = line; *cp != '\0'; cp++)
+ if (*cp != ' ' && *cp != '\t')
+ break;
+ if (*cp == '#' || *cp == '\0')
+ continue;
+#endif
+
if ((_gr_group.gr_name = strsep(&bp, ":\n")) == NULL) {
/* this may be benign - eg. empty line at end of file */
/* syslog(LOG_ALERT, "/etc/group is corrupt: group field is empty"); */