bin/82325: chkgrp flags NIS domains as containing illegal chars
(patch incl)
Ted Faber
faber at isi.edu
Thu Jun 16 15:40:13 GMT 2005
>Number: 82325
>Category: bin
>Synopsis: chkgrp flags NIS domains as containing illegal chars (patch incl)
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Thu Jun 16 15:40:12 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Ted Faber
>Release: FreeBSD 6.0-CURRENT i386
>Organization:
USC/ISI
>Environment:
System: FreeBSD pun.isi.edu 6.0-CURRENT FreeBSD 6.0-CURRENT #7: Tue May 31 10:01:48 PDT 2005 root at pun.isi.edu:/usr/obj/usr/src/sys/PUN i386
>Description:
A group that like +div7 which is teh div7 group imported by NIS
triggers a message like:
chkgrp: /etc/group: line 285: '+' invalid character
>How-To-Repeat:
Run chkgrp on such a groups file
>Fix:
patch:
--- chkgrp.c.orig Wed Jun 15 08:04:27 2005
+++ chkgrp.c Wed Jun 15 08:13:07 2005
@@ -105,7 +105,23 @@
line[i++] = 0;
}
- for (cp = f[0] ; *cp ; cp++) {
+ /*
+ * A group with the first character '+' is an NIS group. Allow that
+ * case explicitly.
+ */
+ cp = f[0];
+ if (!isalnum(*cp) && *cp != '.' && *cp != '+' && *cp != '_' &&
+ *cp != '-') {
+ warnx("%s: line %d: '%c' invalid character", gfn, n, *cp);
+ e++;
+ }
+ cp++;
+
+ /*
+ * Check second through last characters of the group name for bad
+ * characters (cp is not re-initialized).
+ */
+ for ( ; *cp ; cp++) {
if (!isalnum(*cp) && *cp != '.' && *cp != '_' && *cp != '-') {
warnx("%s: line %d: '%c' invalid character", gfn, n, *cp);
e++;
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list