www.delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
DomainKey-Signature: | a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id |
:list-unsubscribe:list-subscribe:list-archive:list-post | |
:list-help:sender:from:to:subject:references:date:in-reply-to | |
:message-id:mime-version:content-type; q=dns; s=default; b=an95C | |
QotcH8me6HuVRPFAZPgM2OLf9PYCfvyyHvAlESf7HAO+ZrIMh5TgqnPcl7Dc7woK | |
gL2NsUHeQgFlwmGsxJ+0V/VsfhbswOKaB+rloQT0wrLubT6mGujY/eppgkDwV8Hw | |
OXsGtIUo5QzoxfMPKuc+tfjj1kuyS+/zGiY3cg= | |
DKIM-Signature: | v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id |
:list-unsubscribe:list-subscribe:list-archive:list-post | |
:list-help:sender:from:to:subject:references:date:in-reply-to | |
:message-id:mime-version:content-type; s=default; bh=356BK2Z43CE | |
3tVAr9GzK/ZkZJ60=; b=CPOkwFixHpZZsZ8qO/3jonZ2opnZye0eYqw/PkpuriX | |
LaQsVOQm45jR1uMvRvgLP+YJHlmCJOKJmkXfjd4eV1ChVV7wx0hhU+4lQ7bQjf62 | |
gMS8LpTCPLb8GEHFg+4Se8RSsANiVycOGLTphaHY0zFbyAeROPuCzYUIF1avlCjQ | |
= | |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
Authentication-Results: | sourceware.org; auth=none |
X-Virus-Found: | No |
X-Spam-SWARE-Status: | No, score=-1.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 |
X-HELO: | mail-in-07.arcor-online.net |
X-DKIM: | Sendmail DKIM Filter v2.8.2 mail-in-15.arcor-online.net 3knHgG6plDzF9vx |
From: | Achim Gratz <Stromeko AT nexgo DOT de> |
To: | cygwin AT cygwin DOT com |
Subject: | Re: ssh-host-config script sends /etc/passwd thru awk |
References: | <4C148215-468D-469D-8060-B2010DF5E9A9 AT etr-usa DOT com> <20150217230230 DOT GH8493 AT calimero DOT vinschen DOT de> <62DA4A6B-8BA1-4676-B88F-42F6A3707AAD AT etr-usa DOT com> <20150218100809 DOT GK8493 AT calimero DOT vinschen DOT de> |
Date: | Wed, 18 Feb 2015 13:00:23 +0100 |
In-Reply-To: | <20150218100809.GK8493@calimero.vinschen.de> (Corinna Vinschen's message of "Wed, 18 Feb 2015 11:08:09 +0100") |
Message-ID: | <87k2zf1lbc.fsf@Rainer.invalid> |
User-Agent: | Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
MIME-Version: | 1.0 |
Corinna Vinschen writes: > It's a bit confusing to talk about the Cygwin version when this is > only about openssh and the csih package. I'm really busy with other > stuff right now. I quickly scanned the ssh-*-config scripts again > and they never write a passwd entry so, if anything, it's a problem > in the csih helper script. Does anybody want to inspect > /usr/share/csih/cygwin-service-installation-helper.sh for this? How about this (untested)? --8<---------------cut here---------------start------------->8--- --- /usr/share/csih/cygwin-service-installation-helper.sh.orig 2015-01-08 16:30:30.000000000 +0100 +++ /usr/share/csih/cygwin-service-installation-helper.sh 2015-02-18 12:47:18.487096800 +0100 @@ -88,6 +88,7 @@ # csih_make_dir # csih_get_system_and_admins_ids # csih_check_passwd_and_group +# csih_old_cygwin # csih_use_file_etc # csih_check_user # csih_check_dir_perms @@ -2017,7 +2018,7 @@ if [ -z "$csih_ADMINSUID" -o -z "$csih_SYSTEMUID" ] then csih_warning "It appears that you do not have an entry for the local" - csih_warning "ADMINISTRATORS (group) and/or SYSTEM sids in /etc/passwd." + csih_warning "ADMINISTRATORS (group) and/or SYSTEM sids." csih_warning "" csih_warning "Use the 'mkpasswd' utility to generate it or allow \"db\"" csih_warning "search of passwd accounts in /etc/nsswitch.conf" @@ -2042,37 +2043,54 @@ csih_stacktrace "${@}" $_csih_trace local ret=0 - # Check for mkpasswd only valid up to Cygwin 1.7.32 */ - if [ "$(/usr/bin/id -gn)" = "mkpasswd" ] - then - csih_warning "It appears that you do not have an entry for your user ID" - csih_warning "in /etc/passwd." - csih_warning "" - csih_warning "If so, use the 'mkpasswd' utility to generate an" - csih_warning "entry for your User ID in the password file:" - csih_warning " mkpasswd -l -u User_ID >> /etc/passwd" - csih_warning "or" - csih_warning " mkpasswd -d -u User_ID >> /etc/passwd." - csih_warning "" - _csih_warning_for_etc_file passwd - ret=1 - fi - - # Check for mkgroup only valid up to Cygwin 1.7.32 */ - if [ "$(/usr/bin/id -gn)" = mkgroup ] - then - csih_warning "It appears that you do not have an entry for your group ID" - csih_warning "in /etc/group. If this check is incorrect, then re-run" - csih_warning "this script with the '-f' command-line option." - csih_warning "" - csih_warning "Otherwise, use the 'mkgroup' utility to generate an" - csih_warning "entry for your group ID in the password file:" - csih_warning " mkgroup -l -g Group_id >> /etc/group" - csih_warning "or" - csih_warning " mkgroup -d -g Group_id >> /etc/group." - csih_warning "" - _csih_warning_for_etc_file group - ret=1 + # Check for mkpasswd/mkgroup only valid up to Cygwin 1.7.33 + if csih_old_cygwin + if [ "$(/usr/bin/id -un)" = "mkpasswd" ] + then + csih_warning "It appears that you do not have an entry for your user ID" + csih_warning "in /etc/passwd." + csih_warning "" + csih_warning "If so, use the 'mkpasswd' utility to generate an" + csih_warning "entry for your User ID in the password file:" + csih_warning " mkpasswd -l -u User_ID >> /etc/passwd" + csih_warning "or" + csih_warning " mkpasswd -d -u User_ID >> /etc/passwd." + csih_warning "" + _csih_warning_for_etc_file passwd + ret=1 + fi + if [ "$(/usr/bin/id -gn)" = mkgroup ] + then + csih_warning "It appears that you do not have an entry for your group ID" + csih_warning "in /etc/group. If this check is incorrect, then re-run" + csih_warning "this script with the '-f' command-line option." + csih_warning "" + csih_warning "Otherwise, use the 'mkgroup' utility to generate an" + csih_warning "entry for your group ID in the password file:" + csih_warning " mkgroup -l -g Group_id >> /etc/group" + csih_warning "or" + csih_warning " mkgroup -d -g Group_id >> /etc/group." + csih_warning "" + _csih_warning_for_etc_file group + ret=1 + fi + else + if ! getent passwd $(/usr/bin/id -un) >/dev/null 2>&1 + then + csih_warning "It appears that you do not have an entry for your user ID" + csih_warning "in the user account database." + csih_warning "" + csih_warning "Please check the settings in /etc/nsswitch.conf." + ret=1 + fi + if ! getent group $(/usr/bin/id -gn) >/dev/null 2>&1 + then + csih_warning "It appears that you do not have an entry for your user ID" + csih_warning "in the group account database." + csih_warning "" + csih_warning "Please check the settings in /etc/nsswitch.conf." + ret=1 + fi fi return "${ret}" } # === End of csih_check_passwd_and_group() === # @@ -2493,6 +2511,29 @@ readonly -f _csih_setup # ====================================================================== +# Routine: csih_old_cygwin +# Check Cygwin version, account databases are avaiable since 1.7.34 +# On Cygwin versions <= 1.7.33 return 0 +# On Cygwin versions > 1.7.33 return 1 +# ====================================================================== +csih_old_cygwin() +{ + local old_cygwin + + /usr/bin/uname -r | + /usr/bin/awk -F. '{ + if ( $1 < 1 || \ + ($1 == 1 && $2 < 7) || \ + ($1 == 1 && $2 == 7 && strtonum($3) <= 33)) + exit 0; + exit 1; + }' + old_cygwin=$? + return ${old_cygwin} +} # === End of csih_old_cygwin() === # +readonly -f csih_old_cygwin + +# ====================================================================== # Routine: csih_use_file_etc passwd|group # Check if /etc/passwd or /etc/group file is in use. # On Cygwin versions < 1.7.33, files are always used. @@ -2517,18 +2558,12 @@ then csih_error 'Script error: csih_use_file_etc requires argument "passwd" or "group".' fi - /usr/bin/uname -r | - /usr/bin/awk -F. '{ - if ($1 < 1 || \ - ($1 == 1 && $2 < 7) || \ - ($1 == 1 && $2 == 7 && strtonum($3) <= 33)) - exit 0; - exit 1; - }' - use_file=$? + csih_old_cygwin ; use_file=$? if [ ${use_file} -ne 0 -a -f /etc/nsswitch.conf ] then - grep -Eq "^${file}:[^#]*\<db\>" /etc/nsswitch.conf || use_file=0 + grep -Eq "^${file}:" /etc/nsswitch.conf && + grep -Eq "^${file}:[^#]*\<db\>" /etc/nsswitch.conf || + use_file=0 fi return ${use_file} } # === End of csih_use_file_etc() === # --8<---------------cut here---------------end--------------->8--- Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ Wavetables for the Terratec KOMPLEXER: http://Synth.Stromeko.net/Downloads.html#KomplexerWaves -- 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
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |