Menu

#19 needs interactive auth

open
nobody
None
5
2002-03-22
2002-03-22
Ed Falk
No

when connecting to my nntp service, the service
will return a 480 error code (auth required). From
browsing the source, it seems to me that trn tries
to respond based on information found in .nntpauth.
This is problematic for three reasons:

1) Format of .nntpauth is not documented and is not
obvious (i.e. I couldn't get it to work.)

2) User may be using trn with more than one server, in
which case a single .nntpauth file will not work.

3) Users don't like to leave their passwords lying
around in plaintext.

I think it would be far better for trn to query
the user interactively for username and password.
Maybe trn could offer to remember these values, but
the user should always be asked.

Discussion

  • Ed Falk

    Ed Falk - 2002-03-22

    Logged In: YES
    user_id=167561

    Oh, here's how I modified the source to make it work for
    me. These changes were made to util.c. There's probably
    a better way to achieve this, but it works for me.

    #ifdef SUPPORT_NNTP
    char*
    get_auth_user()
    {
    if( datasrc->auth_user == NULL ) {
    char ubuffer[80], *ptr ;
    fprintf(stderr, "enter remote user id: ") ;
    echo() ;
    fgets(ubuffer, sizeof(ubuffer), stdin) ;
    noecho() ;
    if( (ptr = strchr(ubuffer, '\n')) != NULL )
    *ptr = '\0' ;
    datasrc->auth_user = savestr(ubuffer) ;
    }

    printf("return user=%x\n", datasrc->auth_user) ;
    return datasrc->auth_user;
    }
    #endif

    #ifdef SUPPORT_NNTP
    char*
    get_auth_pass()
    {
    if( datasrc->auth_pass == NULL ) {
    datasrc->auth_pass = savestr(getpass("enter password:
    ")) ;
    }

    return datasrc->auth_pass;
    }
    #endif

     
  • Ed Falk

    Ed Falk - 2002-03-29

    diffs for util.c

     
  • Ed Falk

    Ed Falk - 2002-03-29

    Logged In: YES
    user_id=167561

    See the attached file fragment for some more changes
    I made. This version remembers the username most recently
    used for a given host.

     

Log in to post a comment.

MongoDB Logo MongoDB