#111 patch to read optionally password from file

open
nobody
None
5
2012-11-29
2006-06-06
Anonymous
No

Simple changes for rdesktop 1.4.1 to read from file
instead of reading stdin or passing via command-line.

not perfect, but a little better security.

128c128
< fprintf(stderr, " -p: password (- to prompt)\n");
---
> fprintf(stderr, " -p: password (- to prompt,
-filename to read)\n");
281a282,306
> if( password[0] == '-' && password[1] != 0 )
> {
> password[0]=0;
> int fn,x;
> if( ! ( fn=open(password+1,O_RDONLY) ) )
> {
> return False;
> }
> if( ! read(fn,password,size) )
> {
> return False;
> }
> password[size-1]=0;
> for(x=0; password[x]; ++x)
> {
> if( password[x] == '\r' ||
password[x] == '\n' )
> {
> password[x]=0;
> break;
> }
> }
> close(fn);
> return True;
> }
>
435c460
< if ((optarg[0] == '-')
&& (optarg[1] == 0))
---
> if ( optarg[0] == '-' )
436a462
>
STRNCPY(password, optarg, sizeof(password));

Discussion

  • Simon Guerrero

    Simon Guerrero - 2006-06-07

    Logged In: YES
    user_id=1368449

    I would have thought it was better to take the "-" off the
    start of the filename - this is confusing as the dash
    implies an argument (rather than a parameter to an
    argument), IMHO.

    Also, wouldn't it be an idea to have just a *little* bit of
    encryption to the stored password? :-)

    Simon

     
  • Peter Åstrand

    Peter Åstrand - 2006-06-21

    Logged In: YES
    user_id=344921

    What does this patch give us, compared to what we have
    today? You can read a password from a file simply by calling:

    cat passwordfile | rdesktop -p -

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks