ssh-host-config: patch fix debug option + broken for me on Vista (non-domain)

Shaddy Baddah
Wed Jan 18 03:34:00 GMT 2017


First please find attached a simple patch that fixes a problem I
encountered running ssh-host-config with the --debug option.

Pretty simple. Without redirecting the output of csih_stacktrace() to
stderr, then (3.5.4) Command Substitution of functions that call it will
run into problems. And the one that I encountered was this one: (){  csih_stacktrace "${@}"  $_csih_trace  local __umask=$(umask)  local rval  local tmpdir 
tmpdir=$(csih_writable_tmpdir) || return 1  umask 0077  /usr/bin/mktemp 
--tmpdir="${tmpdir}" "$@"

tmpdir will be filled with stacktrace output from the
csih_writable_tmpdir() call, and mktemp will fail.

Further, there is definitely a bug, at least for me, with running
ssh-host-config on Vista (32 bit, but that shouldn't matter) in a
non-domain environment.

The script obviously confuses the form of username construct to use at
various points. I encounter the following error:

*** Info: This script plans to use 'cyg_server'.
*** Info: 'cyg_server' will only be used by registered services.
*** Query: Create new privileged user account 'LIBRA-VW\cyg_server' 
(Cygwin name: 'libra-vw+cyg_server')? (yes/no) yes
*** Info: Please enter a password for new user libra-vw+cyg_server. 
Please be sure
*** Info: that this password matches the password rules given on your 
*** Info: Entering no password will exit the configuration.
*** Query: Please enter the password:
*** Query: Reenter:

*** Info: User 'libra-vw+cyg_server' has been created with password 
*** Info: If you change the password, please remember also to change the
*** Info: password for the installed services which use (or will soon use)
*** Info: the 'libra-vw+cyg_server' account.

passwd: unknown user libra-vw+cyg_server
*** Warning: Setting password expiry for user 'libra-vw+cyg_server' failed!
*** Warning: Please check that password never expires or set it to your 
No user or group 'libra-vw+cyg_server' known.
*** Warning: Assigning the appropriate privileges to user 
'libra-vw+cyg_server' failed!
*** ERROR: There was a serious problem creating a privileged user.
*** Warning: Expected privileged user 'libra-vw+cyg_server' does not exist.
*** Warning: Defaulting to 'SYSTEM'

*** Info: The sshd service has been installed under the LocalSystem
*** Info: account (also known as SYSTEM). To start the service now, call
*** Info: `net start sshd' or `cygrunsrv -S sshd'.  Otherwise, it
*** Info: will start automatically after the next reboot.

*** Warning: Host configuration exited with 1 errors or warnings!
*** Warning: Make sure that all problems reported are fixed,
*** Warning: then re-run ssh-host-config.

And I'm sure the problem is that this well-intended change to the script
fails on the assumption that LOGONSERVER is always populated. It isn't
for me on Vista.      # This test succeeds on 
domain member machines only, not on DCs.      if [ 
"\\\\${COMPUTERNAME,,*}" != "${LOGONSERVER,,*}" \        -a "${LOGONSERVER}" 
!= "\\\\MicrosoftAccount" ]      then     # Lowercase of USERDOMAIN 
csih_PRIVILEGED_USERNAME="${COMPUTERNAME,,*}+${username}"      fi    fi

I fixed this by modifying the test to check LOGONSERVER is not empty:

if [ -n "${LOGONSERVER}" -a "\\\\...

Can this be fixed in the next release?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-ssh-host-config-debug.diff
Type: text/x-patch
Size: 401 bytes
Desc: not available
URL: <>
-------------- next part --------------

Problem reports:
Unsubscribe info:

More information about the Cygwin mailing list