Changeset 11517


Ignore:
Timestamp:
Dec 12, 2010, 3:26:06 PM (6 years ago)
Author:
charles
Message:

(trunk daemon) #3763 "transmission-remote should be able to read auth info from an environment variable" -- added. patch by fejesjoco.

Location:
trunk/daemon
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/daemon/remote.c

    r11318 r11517  
    256256    { 'M', "no-portmap",             "Disable portmapping", "M",  0, NULL },
    257257    { 'n', "auth",                   "Set username and password", "n",  1, "<user:pw>" },
     258    { 810, "authenv",                "Set authentication info from the TRAUTH environment variable (user:pw)", "ne", 0, NULL },
    258259    { 'N', "netrc",                  "Set authentication info from a .netrc file", "N",  1, "<file>" },
    259260    { 'o', "dht",                    "Enable distributed hash tables (DHT)", "o", 0, NULL },
     
    351352        case 'b': /* debug */
    352353        case 'n': /* auth */
     354        case 810: /* authenv */
    353355        case 'N': /* netrc */
    354356        case 't': /* set current torrent */
     
    18201822                    break;
    18211823
     1824                case 810: /* authenv */
     1825                    {
     1826                        char *authenv = getenv("TRAUTH");
     1827                        if( !authenv ) {
     1828                            fprintf( stderr, "The TRAUTH environment variable is not set\n" );
     1829                            exit( 0 );
     1830                        }
     1831                        auth = tr_strdup( authenv );
     1832                    }
     1833                    break;
     1834
    18221835                case 'N': /* netrc */
    18231836                    netrc = tr_strdup( optarg );
  • trunk/daemon/transmission-remote.1

    r11515 r11517  
    3434.Op Fl m | M
    3535.Op Fl n Ar user:pass
     36.Op Fl ne
    3637.Op Fl N Ar netrc
    3738.Op Fl o | O
     
    172173.Ar password
    173174for authentication
     175.It Fl ne Fl -authenv
     176Set the authentication information from the
     177.Ar TRAUTH
     178environment variable which must be formatted as
     179.Ar username:password.
    174180.It Fl N Fl -netrc Ar filename
    175181Set the authentication information from a
Note: See TracChangeset for help on using the changeset viewer.