Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Jun 2005 08:19:53 -0700
From:      Ted Faber <faber@isi.edu>
To:        freebsd-hackers@freebsd.org
Subject:   ckgrp flags NIS groups as bad - patch included to fix
Message-ID:  <20050615151953.GB78881@pun.isi.edu>

next in thread | raw e-mail | index | archive | help

--NU0Ex4SbNnrxsi6C
Content-Type: multipart/mixed; boundary="1UWUbFP1cBYEclgG"
Content-Disposition: inline


--1UWUbFP1cBYEclgG
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

The change to /usr/sbin/chkgrp on Fri Jun 10 flags NIS groups as having
an invalid character in them - the leading +.  Attached is a patch to
explicitly allow that case.  If some helpful committer would like to
test and commit the patch, that would be great.  I think that the
testing needed is minimal.

If no one wants to put this in, I'll pr it.

Thanks.


--=20
Ted Faber
http://www.isi.edu/~faber           PGP: http://www.isi.edu/~faber/pubkeys.=
asc
Unexpected attachment on this mail? See http://www.isi.edu/~faber/FAQ.html#=
SIG

--1UWUbFP1cBYEclgG
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="chkgrp.patch"
Content-Transfer-Encoding: quoted-printable

--- 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++] =3D 0;
 	}
=20
-	for (cp =3D f[0] ; *cp ; cp++) {
+	/*=20
+	 * A group with the first character '+' is an NIS group.  Allow that
+	 * case explicitly.
+	 */
+	cp =3D f[0];
+	if (!isalnum(*cp) && *cp !=3D '.' && *cp !=3D '+' && *cp !=3D '_' &&=20
+		*cp !=3D '-') {
+	    warnx("%s: line %d: '%c' invalid character", gfn, n, *cp);
+	    e++;
+	}
+	cp++;
+
+	/*=20
+	 * Check second through last characters of the group name for bad
+	 * characters (cp is not re-initialized).
+	 */
+	for ( ; *cp ; cp++) {
 	    if (!isalnum(*cp) && *cp !=3D '.' && *cp !=3D '_' && *cp !=3D '-') {
 		warnx("%s: line %d: '%c' invalid character", gfn, n, *cp);
 		e++;

--1UWUbFP1cBYEclgG--

--NU0Ex4SbNnrxsi6C
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (FreeBSD)

iD8DBQFCsEcZaUz3f+Zf+XsRAh7qAJ0Z6DmoWY5L0tTRoGipbwni+5L2MACgsZpB
qh++3gq/78KhhlmNhvdbYEg=
=XWKx
-----END PGP SIGNATURE-----

--NU0Ex4SbNnrxsi6C--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050615151953.GB78881>