X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-10.3 required=5.0 tests=AWL,BAYES_00,KHOP_PGP_SIGNED,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Message-ID: <4FC76383.4030607@redhat.com> Date: Thu, 31 May 2012 06:26:43 -0600 From: Eric Blake User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: [cron-config] Possible issue with administrators group ? References: In-Reply-To: OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigE415AF1AF430DF4FECD33B3B" X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com --------------enigE415AF1AF430DF4FECD33B3B Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 05/31/2012 05:18 AM, AZ 9901 wrote: > 2012/5/29 AZ 9901 : >> Hello, >> >> I am looking at the /bin/cron-config script. >> >> Line 627, we can find : >> elif net localgroup "${_admingroup}" | grep -Eiq "^${username}.?$"; then >> >> Why .? at the end of the regexp ? "^${username}.?$" Because 'net' outputs in DOS mode, with carriage returns at the end. >> >> We could have problems if for example we already have "user1" in >> administrators group, and cron user is "user2". >> "user2" would then not be added to the administrators group. Wouldn't that rather be "we could have problems if we already have 'user1', the output does not have carriage returns, and we are trying to add 'user12'"? > Any clue about this regexp ? Since the trailing '.?' exists to strip carriage returns, would it be any more robust to write this as: net localgroup "${_admingroup}" | d2u | grep -Eiq "^${username}$" --=20 Eric Blake eblake AT redhat DOT com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigE415AF1AF430DF4FECD33B3B Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJPx2ODAAoJEKeha0olJ0NqpA8H/R/hKT9Loq/G+R5FgyZqis+i N1OLg/YRF3XhkG61IBaG6v7tviDEgFbA1s9eL0PLpFvopjalbXZUun0EHO4G0TJh Z+FNer6JXNNGS1Tpl8dDxM1IpH0CPYksKT9QmSjbDtld9VZlsuiPYWNFFofhsqTk FvU55xfK2NhPrQAacAaii0HBR2TOf4guvbjSclrxWmxYW8TgqDYdHYQqRHiz37j4 cw+Cg2BBNtixvrAnE11t6+Ds5kg8J1zksKntJnO36R3hfS+uNR58le8CyV2cqg57 HgIf9jsGZZgpYqZ2wZHjEEOaKmd2g6i+HaYzxLdsUnAgBSSVtNQQJIBwcLbDdl0= =KR9J -----END PGP SIGNATURE----- --------------enigE415AF1AF430DF4FECD33B3B--