cvs commit: src/usr.sbin/chkgrp chkgrp.8 chkgrp.c

Bob Willcox bob at immure.com
Thu Aug 4 12:23:22 GMT 2005


On Thu, May 26, 2005 at 10:57:04AM +0000, Ollivier Robert wrote:
> roberto     2005-05-26 10:57:04 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     usr.sbin/chkgrp      chkgrp.8 chkgrp.c 
>   Log:
>   - Add further functionality to check for invalid characters
>   - Remove keyword 'continue' for more indepth error reporting
>     on each line
>   - WARNS 6 Clean
>   
>   Submitted by:   Liam J. Foy <liamfoy at dragonflybsd.org>
>   MFC after:          1 week
>   
>   Revision  Changes    Path
>   1.15      +6 -5      src/usr.sbin/chkgrp/chkgrp.8
>   1.9       +24 -6     src/usr.sbin/chkgrp/chkgrp.c

This change causes NIS /etc/group entries (+ in column one) to be
flagged in error. There is a PR (bin/82325) open on this with a proposed
fix, but here is a simpler (almost) one-line version that I'm using:

Index: chkgrp.c
===================================================================
RCS file: /usr/cvs/FreeBSD/src/usr.sbin/chkgrp/chkgrp.c,v
retrieving revision 1.9
diff -u -r1.9 chkgrp.c
--- chkgrp.c	26 May 2005 10:57:03 -0000	1.9
+++ chkgrp.c	4 Aug 2005 12:11:03 -0000
@@ -106,7 +106,8 @@
 	}
 
 	for (cp = f[0] ; *cp ; cp++) {
-	    if (!isalnum(*cp) && *cp != '.' && *cp != '_' && *cp != '-') {
+	    if (!isalnum(*cp) && *cp != '.' && *cp != '_' && *cp != '-' &&
+		    (cp > f[0] || *cp != '+')) {
 		warnx("%s: line %d: '%c' invalid character", gfn, n, *cp);
 		e++;
 	    }

Maybe someone has the time to commit a fix for this??

Thanks,
Bob

-- 
Bob Willcox                The early bird who catches the worm works for someone
bob at immure.com             who comes in late and owns the worm farm.
Austin, TX                         -- Travis McGee


More information about the cvs-src mailing list