public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: Inconsistent "Unable to extract /usr/bin/ssh-agent.exe" message and disappearing files
       [not found] <1c2b4ee9-59bb-5768-8af7-3284cad4ac13@dubbekarl.dk>
@ 2017-04-01 12:35 ` Andrey Repin
  2017-04-04 12:10   ` Jan Normann Nielsen
  0 siblings, 1 reply; 2+ messages in thread
From: Andrey Repin @ 2017-04-01 12:35 UTC (permalink / raw)
  To: Jan Normann Nielsen, cygwin

[-- Attachment #1: Type: text/plain, Size: 4134 bytes --]

Greetings, Jan Normann Nielsen!

> Hello

> After using Cygwin for a couple of years, suddenly today a lot of files 
> in my Cygwin folder were missing, most notably cygwin.bat and 
> bin/ssh-agent.exe. I have no idea what has happened, the files were 
> there yesterday. I don't remember if I did an update after yesterday's 
> use, but I certainly don't remember any errors occurring if I did. I 
> tried reinstalling the openssh package, but it refused to do so. 
> Unfortunately I didn't write down the error message but I suspect it was 
> the same as the one occurring below.

Assuming you run setup with elevated privileges… Sounds much like an
"antivirus" acting up.

> Instead, I decided to start from scratch. After assuring that I had the 
> latest setup-x64.exe, I renamed my old cygwin64 folder and tried 
> installing a default installation + opensssh on my C: drive. At the 
> install of the openssh package, the installer stopped with the message:

> "Unable to extract /usr/bin/ssh-agent.exe The file is in use or some 
> other error occurred. Please stop all Cygwin processes and select 
> "Retry", or select "Continue" to go on anyway (the file will be updated 
> after a reboot)." I chose "Continue" and rebooted. The installer 
> reported no errors but this one. First of all, I don't understand the 
> error message, because there doesn't seem to be a /usr/bin folder to 
> install this file to, and from what I can see, the installer tries to 
> install in /bin because it leaves a file "ssh-agent.exe.new" in that 
> folder before rebooting. There is no ssh-agent.exe file in that folder 
> which was empty at the start of the installation so I don't understand 
> why it's not just created instead of forcing me to do a reboot. I choose 
> "Continue", and the file did get renamed after a reboot, but Cygwin.bat, 
> Cygwin.ico, Cygwin-Terminal.ico were missing from my installation. They 
> didn't seem to be created indicating that the installer actually had 
> more problems it didn't tell me about.

> Strangely enough, if I choose to install Cygwin from scratch in the same 
> way except that I choose to install on my secondary (D:) drive, the 
> installer doesn't produce the error. But I really don't want Cygwin on 
> my D: drive. So I went back to installing on the C: drive again with the 
> same error. Then on D: again without producing the problem. I have gone 
> back and fourth at least 5 timers, but the last time I also got the 
> error installing on my D: drive. There is no consistency on the (except 
> for the drive) identical installation attempts.


> So I decided to keep Cygwin on my D: drive for the time being after a 
> (seemingly) succesful install. I ran Cygwin.bat which created my 
> skeleton files and gave me a bash prompt. Then I edited Cygwin.bat and 
> put "ssh-agent.exe " in front of the bash command like I had in my old 
> installation to aid in handling my SSH keys. I then ran Cygwin.bat which 
> made the window pop up for a split second, then it closed again and made 
> Cygwin.bat disappear along with bin/ssh-agent.exe. How did that change 
> in Cygwin.bat delete (at least) two files? If I now try to recreate 
> Cygwin.bat from a backup or save it from my Windows text editor, I get 
> either a repeating message from Explorer telling me that I need 
> administrator rights (which I have) to copy the file, or my editor tells 
> me "Access denied" when trying to save. So the Cygwin installation is 
> now broken and I can't repair it. I can delete it and start from scratch 
> again.

Normally(tm) I just run pageant and ssh-pageant at user login.

> I can't explain this behavior in any way except maybe a problem with the 
> file system or some strange bug in Cygwin. Both drives use NTFS and I've 
> run chkdsk on C: telling me there are no problems.

> Can anyone explain to me what's happening? I'm running on Windows 10 
> with all available updates (tested yesterday).


-- 
With best regards,
Andrey Repin
Saturday, April 1, 2017 15:26:01

Sorry for my terrible english...

[-- Attachment #2: ssh-pageant.sh --]
[-- Type: application/octet-stream, Size: 817 bytes --]

#!/bin/sh

test -r "$HOME/.ssh_agent" && {
  . "$HOME/.ssh_agent"
  if kill -0 "$SSH_PAGEANT_PID" 2> /dev/null; then
    if test -r $SSH_AUTH_SOCK; then
      # Agent is alive, try to restart.
      # Fail if restart fails. (I.e. if agent is running elevated for some reason.)
      ssh-pageant.exe -qk || exit 1
    else
      # Socket not readable, we aren't running as a different user, are we?
      # Assume already dead agent.
      :;
    fi
  fi
  # Reap dead agent's socket
  rm "$SSH_AUTH_SOCK" 2> /dev/null
  rm "$HOME/.ssh_agent"
}

eval set -- $(getopt 'k' "$@")
test "$1" = "-k" && exit

socket="$(mktemp -u /var/run/ssh-XXXXXXXX)"
eval $(ssh-pageant.exe -qsa "$socket" | tee "$HOME/.ssh_agent")

# Remove empty settings file (agent failed to start).
test -s "$HOME/.ssh_agent" || rm "$HOME/.ssh_agent"

[-- Attachment #3: Type: text/plain, Size: 219 bytes --]


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Inconsistent "Unable to extract /usr/bin/ssh-agent.exe" message and disappearing files
  2017-04-01 12:35 ` Inconsistent "Unable to extract /usr/bin/ssh-agent.exe" message and disappearing files Andrey Repin
@ 2017-04-04 12:10   ` Jan Normann Nielsen
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Normann Nielsen @ 2017-04-04 12:10 UTC (permalink / raw)
  To: cygwin

Den 01-04-2017 kl. 14:34 skrev Andrey Repin:
>
>> After using Cygwin for a couple of years, suddenly today a lot of files
>> in my Cygwin folder were missing, most notably cygwin.bat and
>> bin/ssh-agent.exe. I have no idea what has happened, the files were
>> there yesterday. I don't remember if I did an update after yesterday's
>> use, but I certainly don't remember any errors occurring if I did. I
>> tried reinstalling the openssh package, but it refused to do so.
>> Unfortunately I didn't write down the error message but I suspect it was
>> the same as the one occurring below.
> Assuming you run setup with elevated privilegesÂ… Sounds much like an
> "antivirus" acting up.
Indeed it was my Avast Antivirus detecting an "IDP.Generic" threat. I've 
reported it as a false positive to their website and hopefully this will 
make the problem disappear for me and others in the near future. Thanks 
for the assistance. :-)

Best wishes,
Jan

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-04 12:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1c2b4ee9-59bb-5768-8af7-3284cad4ac13@dubbekarl.dk>
2017-04-01 12:35 ` Inconsistent "Unable to extract /usr/bin/ssh-agent.exe" message and disappearing files Andrey Repin
2017-04-04 12:10   ` Jan Normann Nielsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).