Date: Thu, 16 Jun 2005 08:37:16 -0700 (PDT) From: Ted Faber <faber@isi.edu> To: FreeBSD-gnats-submit@FreeBSD.org Cc: Ted Faber <faber@isi.edu> Subject: bin/82325: chkgrp flags NIS domains as containing illegal chars (patch incl) Message-ID: <200506161537.j5GFbGEA096450@pun.isi.edu> Resent-Message-ID: <200506161540.j5GFeCkc090629@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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@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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200506161537.j5GFbGEA096450>