delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/03/06/06:11:48

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=0.1 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED
X-Spam-Check-By: sourceware.org
Message-ID: <5137244E.5030809@ehnberg.net>
Date: Wed, 06 Mar 2013 13:11:10 +0200
From: Johan Ehnberg <johan AT ehnberg DOT net>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130221 Thunderbird/17.0.3
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: ssh-host-config produces Win32 error 1057 on systems with non-ASCII computer names
References: <513719BE DOT 4030004 AT ehnberg DOT net> <20130306103939 DOT GF14373 AT calimero DOT vinschen DOT de>
In-Reply-To: <20130306103939.GF14373@calimero.vinschen.de>
X-Spam-Scanned: Scanned at neoisis.net
X-Spam-Score: -4.3
X-Spam-Score-Int: -42
X-IsSubscribed: yes
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

On 2013-03-06 12:39, Corinna Vinschen wrote:
> On Mar  6 12:26, Johan Ehnberg wrote:
>> Dears,
>>
>> I am running a fresh install of the latest stable cygwin on a fresh
>> install of vanilla Windows 7 64-bit Finnish, with computer name
>> "Käyttäjä-PC". When I run 'ssh-host-config -y' the service
>> installation phase fails on the Finnish equivalent of "cygrunsrv:
>> Error installing a service: CreateService:  Win32 error 1057: The
>> account name is invalid or does not exist, or the password is
>> invalid for the account name specified."
>>
>> Changing the computer name to just "PC", rebooting and retrying
>> works around the problem. Localized output from Windows in cygwin
>> with non-ASCII characters still looks awful by default though :)
>>
>> Running 'ssh-host-config -y -d' succeeds in installing the service
>> with warnings, and as cyg_server is not taking over incoming privsep
>> logins it still does not work. A wild guess is that the non-ASCII
>> computer name somehow affects the user creation or granting
>> privileges.
>>
>> As a side note, non-ASCII user names work well and are not affected
>> by this. As long as proper code pages are consistently used,
>> non-ASCII user names are a challenge to be handled primarily between
>> different systems consoles and file formats.
>>
>> I thought I'd throw this out there as could not find earlier
>> messages about this. At least someone googling can find the
>> workaround. Non-ASCII host/computer names are often not well handled
>> elsewhere anyway, so there are more reasons than this to avoid them.
>
> This is the fault of the cygrunsrv tool, which still uses the
> ANSI variants of the Win32 API.  The default codeset under Cygwin
> is UTF-8, but that doesn't match your Windows ANSI codepage 1252,
> so that's what probably goes wrong.
>
> Cygrunsrv has to be changed to use the UNICODE variants of the
> Windows Service API to get that working.
>
>
> Corinna
>

Thank you for the prompt answer, it seems to be just on the spot.

For future reference, the default codepage for this Windows variant, as 
reported by chcp, is 850. Using codepage 1252 works mostly, but will 
garble up cmd with some characters and may cause trouble in batch 
scripts with non-ASCII characters. Interestingly, Notepad does not 
support codepage 850 but uses codepage 1252 on the same system. This can 
fool the user and mess up scripts after edits.

On the other hand, I have understood that Windows is also known for not 
running Unicode batch scripts properly - changing cygrunsrv alone may 
not yet solve this for automated batch script installations?

Johan

--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019