From faber@pun.isi.edu  Thu Jun 16 15:37:17 2005
Return-Path: <faber@pun.isi.edu>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 2D53916A41C
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 16 Jun 2005 15:37:17 +0000 (GMT)
	(envelope-from faber@pun.isi.edu)
Received: from pun.isi.edu (pun.isi.edu [128.9.160.150])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 15B7C43D1D
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 16 Jun 2005 15:37:17 +0000 (GMT)
	(envelope-from faber@pun.isi.edu)
Received: from pun.isi.edu (localhost [127.0.0.1])
	by pun.isi.edu (8.13.3/8.13.1) with ESMTP id j5GFbGjw096451;
	Thu, 16 Jun 2005 08:37:16 -0700 (PDT)
	(envelope-from faber@pun.isi.edu)
Received: (from faber@localhost)
	by pun.isi.edu (8.13.3/8.13.1/Submit) id j5GFbGEA096450;
	Thu, 16 Jun 2005 08:37:16 -0700 (PDT)
	(envelope-from faber)
Message-Id: <200506161537.j5GFbGEA096450@pun.isi.edu>
Date: Thu, 16 Jun 2005 08:37:16 -0700 (PDT)
From: Ted Faber <faber@isi.edu>
Reply-To: Ted Faber <faber@isi.edu>
To: FreeBSD-gnats-submit@freebsd.org
Cc: Ted Faber <faber@isi.edu>
Subject: chkgrp flags NIS domains as containing illegal chars (patch incl)
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         82325
>Category:       bin
>Synopsis:       [patch] chkgrp flags NIS domains as containing illegal chars
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 16 15:40:12 GMT 2005
>Closed-Date:    Thu Aug 04 12:50:16 GMT 2005
>Last-Modified:  Wed Aug 31 21:10:17 GMT 2005
>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:

From: Marc Olzheim <marcolz@ilse.net>
To: bug-followup@FreeBSD.org, faber@isi.edu
Cc:  
Subject: Re: bin/82325: [patch] chkgrp flags NIS domains as containing illegal chars
Date: Wed, 27 Jul 2005 10:18:57 +0200

 The same problem still exists on 6.0-BETA1 and 7-CURRENT
State-Changed-From-To: open->closed 
State-Changed-By: roberto 
State-Changed-When: Thu Aug 4 12:49:39 GMT 2005 
State-Changed-Why:  
Fixed in a slightly different way in revision 1.10.  Thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=82325 

From: Lowell Gilbert <freebsd-bugs-local@be-well.ilk.org>
To: bug-followup@freebsd.org,roberto@freebsd.org
Cc:  
Subject: Re: bin/82325: [patch] chkgrp flags NIS domains as containing illegal chars
Date: 31 Aug 2005 17:06:18 -0400

 Please MFC to RELENG_5, as 1.9 had been MFC'd as well.
>Unformatted:
