From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4591 invoked by alias); 7 Nov 2014 18:05:07 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 4581 invoked by uid 89); 7 Nov 2014 18:05:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: vms173021pub.verizon.net Received: from vms173021pub.verizon.net (HELO vms173021pub.verizon.net) (206.46.173.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 07 Nov 2014 18:05:05 +0000 Received: from PHUMBLETLAP01W ([50.200.185.42]) by vms173021.mailsrvcs.net (Oracle Communications Messaging Server 7.0.5.32.0 64bit (built Jul 16 2014)) with ESMTPA id <0NEO0046CKW1IQ30@vms173021.mailsrvcs.net> for cygwin@cygwin.com; Fri, 07 Nov 2014 12:04:50 -0600 (CST) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=GLe/yVJP c=1 sm=1 tr=0 a=++QE0vWJ+/OcbE0B+pKMCw==:117 a=qpBMU8TwT7QA:10 a=o83nqyVRAAAA:8 a=oR5dmqMzAAAA:8 a=-9mUelKeXuEA:10 a=DAwyPP_o2Byb1YXLmDAA:9 a=Zr7miEi8wWIA:10 a=cKsnjEOsciEA:10 a=tdPNcO0outDDvE5JKcIA:9 a=QEXdDO2ut3YA:10 a=g923L2GS_aeYgUanU2wA:9 From: "Pierre A. Humblet" To: References: <20141106155247.GA32104@calimero.vinschen.de> <20141106185102.GL28195@calimero.vinschen.de> In-reply-to: Subject: RE: TEST RELEASE: Cygwin 1.7.33-0.7 Date: Fri, 07 Nov 2014 18:05:00 -0000 Message-id: <044301cffab5$52eca9e0$f8c5fda0$@ieee.org> MIME-version: 1.0 Content-type: multipart/mixed; boundary="----=_NextPart_000_0444_01CFFA8B.6A1FA290" X-SW-Source: 2014-11/txt/msg00140.txt.bz2 ------=_NextPart_000_0444_01CFFA8B.6A1FA290 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Content-length: 1956 > -----Original Message----- > From: Pierre A. Humblet=20 > Sent: Thursday, November 06, 2014 16:09 >=20 > > -----Original Message----- > > From: Corinna Vinschen > > Sent: Thursday, November 06, 2014 13:51 > > > > On Nov 6 13:38, Kelley Cook wrote: > > > On Thu, Nov 6, 2014 at 10:52 AM, Corinna Vinschen wrote: > > > > Hi Cygwin friends and users, > > > > > > > > > > > > I just released a 7th TEST version of the next upcoming Cygwin > > > > release, 1.7.33-0.7. > > > > > > > > > > I discovered that /usr/bin/cron-config which is part of the cron > > > package will need to be updated as it attempts to parse /etc/group . > > > > Right, it should use getent instead. Pierre? >=20 > Right, and ditto for exim config and postinstall How much time do I have? >=20 > Now cron-config checks if a username appears multiple times in passwd. > Typically one instance is a domain id and the other one is a local id. > That causes havoc with cron > It happens fairly frequently; there was even such a "bug report" recently. >=20 > How does getent handle that case? Is it detectable from a config file? =20 Corinna I just realized that deleting the /etc/passwd file in existing domain syste= ms may change usernames, which will break cron and other programs that use = files named after usernames. Also the (local) privileged username will chan= ge. For now I have made the following changes to cron-config: calling getent checking if /etc/passwd exists dealing with the extended names for privileged users (they may contain a = +, don't use EREs)=20=20 Do you intend to keep mkpasswd/mkgroup ? I still don't have a 64 bit system, but it's coming this year. It will take= me some time to prepare a new cron package and get familiar with the new p= ackage upload procedure.=20 I am attaching a cron-config diff. Feel free to update the 32 and 64 bit cr= on packages if you want that done quickly. cronbug does not seem to require any changes. Pierre ------=_NextPart_000_0444_01CFFA8B.6A1FA290 Content-Type: application/octet-stream; name="cron-config.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="cron-config.diff" Content-length: 8906 --- cron-config.orig 2014-11-06 15:15:35.037348900 -0500=0A= +++ cron-config 2014-11-07 12:52:53.970746100 -0500=0A= @@ -138,114 +138,41 @@ get_NT() {=0A= return 0=0A= } # =3D=3D=3D End of get_NT() =3D=3D=3D #=0A= =20=0A= -# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= -# Routine: warning_for_etc_file=0A= -# Display a warning message for the user about overwriting the specified= =0A= -# file in /etc.=0A= -# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= -warning_for_etc_file() {=0A= - echo=0A= - echo "WARNING: The command above overwrites any existing /etc/$1."=0A= - echo "You may want to preserve /etc/$1 before generating a new,"=0A= - echo "one, and then compare your saved /etc/$1 file with the"=0A= - echo "newly-generated one in case you need to restore other"=0A= - echo "entries."=0A= - echo=0A= -} # =3D=3D=3D warning_for_etc_file() =3D=3D=3D #=0A= -=0A= =20=0A= # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= # Routine: get_system_and_admins_gids=0A= -# Get the ADMINs ids from /etc/group and /etc/passwd=0A= +# Get the ADMINs ids from group and passwd=0A= # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= get_system_and_admins_ids() {=0A= ret=3D0=0A= - for fname in /etc/passwd /etc/group; do=0A= - if ls -ld "${fname}" | grep -Eq '^-r..r..r..'; then=0A= - true=0A= - else=0A= - echo "The file $fname is not readable by all."=0A= - echo "Please run 'chmod +r $fname'."=0A= - echo=0A= - ret=3D1=0A= - fi=0A= - done=0A= -=0A= - [ ! -r /etc/passwd -o ! -r /etc/group ] && return 1;=0A= + ADMINSGID=3D$(getent group S-1-5-32-544 | sed -e 's/[^:]*:[^:]*:\([0-9= ]*\):.*$/\1/')=0A= + SYSTEMGID=3D$(getent group S-1-5-18 | sed -e 's/[^:]*:[^:]*:\([0-9]*\)= :.*$/\1/')=0A= + ADMINSUID=3D$(getent passwd S-1-5-32-544 | sed -e 's/[^:]*:[^:]*:\([0-= 9]*\):.*$/\1/')=0A= + SYSTEMUID=3D$(getent passwd S-1-5-18 | sed -e 's/[^:]*:[^:]*:\([0-9]*\= ):.*$/\1/')=0A= =20=0A= - ADMINSGID=3D$(sed -ne '/^[^:]*:S-1-5-32-544:.*:/{s/[^:]*:[^:]*:\([0-9]= *\):.*$/\1/p;q}' /etc/group)=0A= - SYSTEMGID=3D$(sed -ne '/^[^:]*:S-1-5-18:.*:/{s/[^:]*:[^:]*:\([0-9]*\):= .*$/\1/p;q}' /etc/group)=0A= if [ -z "$ADMINSGID" -o -z "$SYSTEMGID" ]; then=0A= - echo "It appears that you do not have correct entries for the"=0A= - echo "ADMINISTRATORS and/or SYSTEM sids in /etc/group."=0A= - echo=0A= - echo "Use the 'mkgroup' utility to generate them"=0A= - echo " mkgroup -l > /etc/group"=0A= - warning_for_etc_file group=0A= + echo "Entries for the ADMINISTRATORS and/or SYSTEM sids are not found in= group."=0A= ret=3D1;=0A= fi=0A= =20=0A= - ADMINSUID=3D$(sed -ne '/^[^:]*:[^:]*:[0-9]*:[0-9]*:[^:]*,S-1-5-32-544:= .*:/{s/[^:]*:[^:]*:\([0-9]*\):.*$/\1/p;q}' /etc/passwd)=0A= - SYSTEMUID=3D$(sed -ne '/^[^:]*:[^:]*:[0-9]*:[0-9]*:[^:]*,S-1-5-18:.*:/= {s/[^:]*:[^:]*:\([0-9]*\):.*$/\1/p;q}' /etc/passwd)=0A= if [ -z "$ADMINSUID" -o -z "$SYSTEMUID" ]; then=0A= - echo "It appears that you do not have correct entries for the"=0A= - echo "ADMINISTRATORS and/or SYSTEM sids in /etc/passwd."=0A= - echo=0A= - echo "Use the 'mkpasswd' utility to generate it"=0A= - echo " mkpasswd -l > /etc/passwd."=0A= - warning_for_etc_file passwd=0A= + echo "Entries for the ADMINISTRATORS and/or SYSTEM sids are not found in= passwd."=0A= ret=3D1;=0A= fi=0A= return "${ret}"=0A= } # =3D=3D=3D get_system_and_admins_ids() =3D=3D=3D #=0A= =20=0A= -# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= -# Routine: check_passwd_and_group=0A= -# Check to see whether the user's password ID and group exist in the=0A= -# system /etc/passwd and /etc/group files, respectively.=0A= -# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= -check_passwd_and_group() {=0A= - ret=3D0=0A= - if [ "$(id -gn)" =3D "mkpasswd" ]; then=0A= - echo "It appears that you do not have an entry for your user ID"=0A= - echo "in /etc/passwd."=0A= - echo=0A= - echo "If so, use the 'mkpasswd' utility to generate an"=0A= - echo "entry for your User ID in the password file:"=0A= - echo " mkpasswd -l -u User_ID >> /etc/passwd"=0A= - echo "or"=0A= - echo " mkpasswd -d -u User_ID >> /etc/passwd."=0A= - echo=0A= - ret=3D1=0A= - fi=0A= -=0A= - if [ "$(id -gn)" =3D mkgroup ]; then=0A= - echo "It appears that you do not have an entry for your group ID"=0A= - echo "in /etc/group. If this check is incorrect, then re-run"=0A= - echo "this script with the '-f' command-line option."=0A= - echo=0A= - echo "Otherwise, use the 'mkgroup' utility to generate an"=0A= - echo "entry for your group ID in the password file:"=0A= - echo " mkgroup -l -g Group_id >> /etc/group"=0A= - echo "or"=0A= - echo " mkgroup -d -g Group_id >> /etc/group."=0A= - echo=0A= - ret=3D1=0A= - fi=0A= - return "${ret}"=0A= -} # =3D=3D=3D End of check_passwd_and_group() =3D=3D=3D #=0A= =20=0A= # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= # Routine: check_user=0A= -# Check to see that the specified user exists once in /etc/passwd=20=0A= +# Check that the specified user does no exists more than once in /etc/pass= wd=20=0A= # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= check_user() {=0A= - count=3D$(grep -ic "^$1:" /etc/passwd)=0A= - if [ $count =3D 0 ]; then=0A= - echo "ERROR: User $1 does not appear in /etc/passwd."=0A= - echo=0A= - return 1;=0A= +=20=20=0A= + if [ ! -e /etc/passwd ]; then=0A= + return 0;=0A= fi=0A= + count=3D$(grep -ic "^$1:" /etc/passwd)=0A= if [ $count -gt 1 ]; then=0A= echo "WARNING: User $1 appears $count times in /etc/passwd."=0A= echo "This may confuse the system."=0A= @@ -489,7 +416,6 @@ cron_diagnose() {=0A= fi=0A= =20=0A= get_system_and_admins_ids || return 1=0A= - check_passwd_and_group || return 1=0A= =20=0A= if [ "$username" =3D "$USER" ]=0A= then=0A= @@ -659,15 +585,22 @@ create_user() {=0A= fi=0A= fi=0A= pwd_entry=3D"$(mkpasswd -l -u "${username}" | sed -e 's?\(^[^:]*:[^:]*= :[^:]*:[^:]*:[^:]*:\).*?\1/var/empty:/bin/false?')"=0A= - grep -Eiq "^${username}:" "${SYSCONFDIR}/passwd" && username_in_passwd= =3Dyes &&=0A= - grep -Fiq "${pwd_entry}" "${SYSCONFDIR}"/passwd && entry_in_passwd= =3Dyes=0A= - if [ "${entry_in_passwd}" !=3D "yes" ]; then=0A= - if [ "${username_in_passwd}" =3D "yes" ]; then=0A= - temp=3D"${TEMP_DIR}/passwd.$$.tmp"=0A= - grep -Ev "^${username}:" "${SYSCONFDIR}/passwd" > "${temp}" &&=0A= - mv -f "${temp}" "${SYSCONFDIR}/passwd" || return 1=0A= - fi=0A= - echo "${pwd_entry}" >> "${SYSCONFDIR}/passwd" || ret=3D1=0A= + fullusername=3D$(echo "$pwd_entry" | sed -e 's/^\([^:]*\):.*$/\1/')=20= =0A= + if [ ! -e "${SYSCONFDIR}/passwd" ]; then=0A= + echo "${pwd_entry}" > "${SYSCONFDIR}/passwd" || ret=3D1=0A= + chown "${ADMINSUID}" "${SYSCONFDIR}/passwd"=0A= + chmod 644 "${SYSCONFDIR}/passwd"=0A= + else=0A= + grep -iq "^${fullusername}:" "${SYSCONFDIR}/passwd" && username_in_pa= sswd=3Dyes &&=0A= + grep -Fiq "${pwd_entry}" "${SYSCONFDIR}"/passwd && entry_in_passwd= =3Dyes=0A= + if [ "${entry_in_passwd}" !=3D "yes" ]; then=0A= + if [ "${username_in_passwd}" =3D "yes" ]; then=0A= + temp=3D"${TEMP_DIR}/passwd.$$.tmp"=0A= + grep -iv "^${fullusername}:" "${SYSCONFDIR}/passwd" > "${temp}" &= &=0A= + mv -f "${temp}" "${SYSCONFDIR}/passwd" || return 1=0A= + fi=0A= + echo "${pwd_entry}" >> "${SYSCONFDIR}/passwd" || ret=3D1=0A= + fi=0A= fi=0A= return "${ret}"=0A= }=0A= =0A= ------=_NextPart_000_0444_01CFFA8B.6A1FA290 Content-Type: text/plain; charset=us-ascii Content-length: 218 -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple ------=_NextPart_000_0444_01CFFA8B.6A1FA290--