monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] --non-interactive: run in non-interactive


From: William Uther
Subject: Re: [Monotone-devel] --non-interactive: run in non-interactive
Date: Thu, 31 Jan 2008 10:34:32 +1100


On 31/01/2008, at 9:58 AM, Zbigniew Zagórski wrote:

I'm hacking silently at mtteam again I hit the wall of "safe commit".

Safe means that I'm sure that monotone will not ask anything from
stdin/tty user but fail miserably with some error message. Thus it's
guarantee that it will never hang up.

That makes perfect sense.

  string lua_phrase;
-  if (!force_from_user && lua.hook_get_passphrase(keyid, lua_phrase))
+  if (!force_from_user && app.lua.hook_get_passphrase(keyid,
+       lua_phrase))
    {
      phrase = utf8(lua_phrase);
      N(phrase != utf8(""),
        F("got empty passphrase from get_passphrase() hook"));
    }
+  else if( app.opts.non_interactive )
+    {
+      F("reading passphrase from terminal forbidden by explicit "
+        "option");
+    }
  else
    {
      char pass1[constants::maxpasswd];


Why not just make sure the user has a lua hook with a passphrase in it. Perhaps
something like this (untested):

cat > newhook.lua <<EOF

function get_passphrase_bogus(keypair_id)
    return "this is probably not the passphrase"
end

if (get_passphrase == nil) then
    get_passphrase  = get_passphrase_bogus
end

EOF

You could then add this with the --rcfile option and you'd be set.

PS. I know that commit from automate would be the best way but we
can't wait for it (sadly, it's too big task for me to do it now ).
mtteam is in almost usable state and the only blocking issue is
commit. We'll gladly switch to 'automate commit' when it will be done.

Yes - that would be a nice automate command. I'm not sure it would really change much here though. You'd still need a way of getting the passphrase
for the key.

The other option would be to encourage people to use ssh-agent. Perhaps automating that process for them would help: Export their keys in the right form, check if the SSH_AUTH_SOCK environment variable is set, and if it is then see if the key is loaded and if not, load it in for the user (prompting for the password yourself).

Cheers,

Will       :-}






reply via email to

[Prev in Thread] Current Thread [Next in Thread]