This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
Re: cygport improvements: upload, fish, src_prep_fini_hook
- From: Andrew Schulman <schulman dot andrew at epa dot gov>
- To: cygwin-apps at cygwin dot com
- Date: Fri, 09 Jan 2015 05:35:07 -0500
- Subject: Re: cygport improvements: upload, fish, src_prep_fini_hook
- Authentication-results: sourceware.org; auth=none
- References: <544D0CC5 dot 9030600 at cygwin dot com> <nu2s4al5tup14gfvge083ri8u9j6t62c7m at 4ax dot com> <nu2s4al5tup14gfvge083ri8u9j6t62c7m-e09XROE/p8c at public dot gmane dot org> <547F5B88 dot 3020403 at cygwin dot com> <dgd89ahb9de6auehdqhdtpgubd5ohue185 at 4ax dot com> <dgd89ahb9de6auehdqhdtpgubd5ohue185-e09XROE/p8c at public dot gmane dot org> <54AA46F3 dot 9090303 at cygwin dot com> <sbpkaa5h5ruhcv42rv9jqpe4bhn0lkrt3s at 4ax dot com> <sbpkaa5h5ruhcv42rv9jqpe4bhn0lkrt3s-e09XROE/p8c at public dot gmane dot org> <20150107155622 dot GA25322 at calimero dot vinschen dot de>
> > It's vexing that it's so hard to find a solution to such a simple problem:
> > prompt the user for a password if and only if one is needed.
>
> Indeed. Here's another crazy idea.
>
> - Look if ssh-agent is running (SSH_AGENT_PID non-empty?)
> - If not, start ssh-agent and ssh-add. This asks for the passphrase,
> if any.
> - run sftp
> - If the script started ssh-agent, run eval $(ssh-agent -k)
Yeah, I think that is actually a pretty good idea. Thanks.
Another case is if the user sets SSH_KEY to use a specific key, and they already
have an ssh-agent running, but it doesn't include that key. Then the key will
have to be added and then removed again afterward, or maybe a different
ssh-agent started. I'll have to think about that.
All that is a bit of work, but it uses all supported methods, and no screen
scraping, so I think it's worth doing.
Andrew