Re: [fossil-users] Automating a clone - any other way than the URL to pass in password?

2014-07-06 Thread Stephan Beal
On Sat, Jul 5, 2014 at 7:19 PM, Matt Welland estifo...@gmail.com wrote:

 I'd also like to automatically say Y to the question of storing the
 password and I don't see any way to do that either.


For apps which take their input from stdin (like fossil) it's normally
possibly to do that like:

echo Y | ... the app

or:

yes | the app

The first one seems to work for me:

[odroid@host:~/tmp]$ echo Y | fossil clone
http://xxx...@fossil.wanderinghorse.net/repos/cwal/index.cgi foo.fsl
Round-trips: 2   Artifacts sent: 0  received: 5055
Clone finished with 600 bytes sent, 4324286 bytes received
...


-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do. -- Bigby Wolf
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Automating a clone - any other way than the URL to pass in password?

2014-07-06 Thread j. van den hoff
On Sat, 05 Jul 2014 19:19:54 +0200, Matt Welland estifo...@gmail.com  
wrote:


I'd like to automate a clone but I think I'd prefer the password not be  
in

the URL. The concern is that the password in the URL might be visible in
the webserver logs.

First, is this a legit concern? Second, how best to do this? AFAICT there
is no switch for fossil to take the password in on stdin.

I'd also like to automatically say Y to the question of storing the
password and I don't see any way to do that either.


something like this shell script

#---
#!/usr/bin/env expect

set timeout 60
spawn  fossil clone https://user@url_of_repo myclone.fossil

while 1 {
   expect {
  {password for}  {send password_goes_here\r}
  {remember password} {send y\r}
  eof {break}
   }
}
#---

should work (provided you have `expect' installed and provided the file  
`myclone.fossil' does not yet exist)
although you still would have to put the password in clear text in the  
script (which hardly is desirable...).
I only tested it with a small repo on a fast connection. no idea whether  
the chosen timeout value is always sufficient.


j.

ps: question to ML: it seems that doing the above via a shell here  
document (just redirecting user input to the `fossil clone' queries
to the script via `EOF' and putting password and `Y' on the next lines)  
is not recognized by fossil. why not?







--
Using Opera's revolutionary email client: http://www.opera.com/mail/
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Automating a clone - any other way than the URL to pass in password?

2014-07-06 Thread Stephan Beal
On Sun, Jul 6, 2014 at 12:05 PM, j. van den hoff veedeeh...@googlemail.com
wrote:

 ps: question to ML: it seems that doing the above via a shell here
 document (just redirecting user input to the `fossil clone' queries
 to the script via `EOF' and putting password and `Y' on the next lines)
 is not recognized by fossil. why not?


Looking at the code (getpass() in user.c)... i'm not sure. It uses
getc(stdin) to reach char by char, but doesn't seem to do anything unusual
with the stream. Ah... that's the Windows/Android impl. On unix it uses
getpass(3) (unistd.h), which might do something weird to prohibit piping in
input.

NAME
   getpass - get a password

SYNOPSIS
   #include unistd.h

   char *getpass( const char *prompt);
...
DESCRIPTION
   This  function  is  obsolete.   Do not use it.  If you want to read
input without terminal echoing enabled, see the
   description of the ECHO flag in termios(3).


-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do. -- Bigby Wolf
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Automating a clone - any other way than the URL to pass in password?

2014-07-06 Thread Ron Wilson
On Sun, Jul 6, 2014 at 6:12 AM, Stephan Beal sgb...@googlemail.com wrote:

 Looking at the code (getpass() in user.c)... i'm not sure. It uses
 getc(stdin) to reach char by char, but doesn't seem to do anything unusual
 with the stream. Ah... that's the Windows/Android impl. On unix it uses
 getpass(3) (unistd.h), which might do something weird to prohibit piping in
 input.


As I recall, getpass(3) opens its own file descriptor to the controlling
terminal, configures it with some reasonable, non-echo settings, then
reads the user's password.

Expect gets around this by using a pseudo terminal. the child side of the
fork assigns the slave side of the pseudo terminal to STDIN, STDOUT and
STDERR, then execs the command (or the shell to run the command). Then
expect monitors and controls the command via the control side of the pseudo
terminal.

FYI, xterm (and other Unix/Linux/etc command line windows) work the same
way.
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Automating a clone - any other way than the URL to pass in password?

2014-07-06 Thread Matt Welland
Thanks for the replies.

On Linux I'll just use the url password and do:

echo y|fossil clone 

I'm sure Google knows the equivalent magic invocation for windows.
 On Jul 5, 2014 10:19 AM, Matt Welland estifo...@gmail.com wrote:

 I'd like to automate a clone but I think I'd prefer the password not be in
 the URL. The concern is that the password in the URL might be visible in
 the webserver logs.

 First, is this a legit concern? Second, how best to do this? AFAICT there
 is no switch for fossil to take the password in on stdin.

 I'd also like to automatically say Y to the question of storing the
 password and I don't see any way to do that either.

 --
 Matt
 -=-
 90% of the nations wealth is held by 2% of the people. Bummer to be in the
 majority...

___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Automating a clone - any other way than the URL to pass in password?

2014-07-05 Thread Joerg Sonnenberger
On Sat, Jul 05, 2014 at 10:19:54AM -0700, Matt Welland wrote:
 I'd like to automate a clone but I think I'd prefer the password not be in
 the URL. The concern is that the password in the URL might be visible in
 the webserver logs.

Passwords are not passed in the request via URL, but as part of the HTTP
header. That one is normally not logged.

Joerg
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users