Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple git instances launched by repo compete for SSH key passphrase user input #178

Open
GoogleCodeExporter opened this issue Jul 3, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

Affected Version: VERSION = (1, 21)

STEPS TO REPRODUCE:
1) Use SSH keys protected with a passphrase;
2) repo init --no-repo-verify -u [email protected]:foo/bar.git

repo quite obviously launches more than a single instance of git, and each 
instance attempts to attach to STDIN in order to wait for the user to enter 
passphrase:

-----
Enter passphrase for key '/home/eligovm/.ssh/id_rsa': Enter passphrase for key 
'/home/eligovm/.ssh/id_rsa':
-----

at which point race condition for user input ensues.


EXPECTED ACTION: instances of git DO NOT run in parallel, allowing the user to 
enter key passphrase for each instance separately, without interference from 
the other.


Original issue reported on code.google.com by [email protected] on 6 Aug 2014 at 9:29

@GoogleCodeExporter
Copy link
Author

OK, I found that the problem lies in the fact that "['ssh', '-M', '-N', '-o', 
'ControlPath" is not given the opportuinty to obtain the passphrase.

I changed the code in git_config.py around line 457::

    try:
      Trace(': %s', ' '.join(command))
      print(command)
      p = subprocess.Popen(command)
      time.sleep(10) <<<<<<<<<<<<<<<<<<<<<< added this

Then I have enough time to enter the passphrase, and after that everything 
works automatically.

Original comment by [email protected] on 6 Aug 2014 at 9:49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant