Changeset 01e558


Ignore:
Timestamp:
09/19/09 10:09:12 (3 years ago)
Author:
Erik Ekman <yarrick@…>
Branches:
master
Children:
0cdd53
Parents:
807469
git-author:
Erik Ekman <yarrick@…> (09/19/09 10:09:12)
git-committer:
Erik Ekman <erik@…> (02/04/12 20:34:03)
Message:

#77, get password from env variable

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    ra3757a r01e558  
    2222        - Added -F option to write pidfile, based on patch from 
    2323                misc at mandriva.org. Fixes #70. 
     24        - Allow password to be set via environment variable, fixes #77. 
     25                Based on patch by logix. 
    2426 
    25272009-06-01: 0.5.2 "WifiFree" 
  • man/iodine.8

    r1137ac r01e558  
    255255These issues should be solved now, with automatic fragmentation of downstream  
    256256packets. There should be no need to set the MTU explicitly on the server. 
     257.SH ENVIRONMENT 
     258.SS IODINE_PASS 
     259If the environment variable 
     260.B IODINE_PASS 
     261is set, iodine will use the value it is set to as password instead of asking 
     262for one. The  
     263.B -P 
     264option still has preference. 
     265.SS IODINED_PASS 
     266If the environment variable 
     267.B IODINED_PASS 
     268is set, iodined will use the value it is set to as password instead of asking 
     269for one. The 
     270.B -P 
     271option still has preference. 
     272.El 
    257273.SH BUGS 
    258274File bugs at http://dev.kryo.se/iodine/ 
  • src/iodine.c

    r807469 r01e558  
    4848static char *__progname; 
    4949#endif 
     50 
     51#define PASSWORD_ENV_VAR "IODINE_PASS" 
    5052 
    5153static void 
     
    261263        } 
    262264         
    263         if (strlen(password) == 0)  
    264                 read_password(password, sizeof(password)); 
     265        if (strlen(password) == 0) { 
     266                if (NULL != getenv(PASSWORD_ENV_VAR)) 
     267                        snprintf(password, sizeof(password), "%s", getenv(PASSWORD_ENV_VAR)); 
     268                else 
     269                        read_password(password, sizeof(password)); 
     270        } 
    265271         
    266272        client_set_password(password); 
  • src/iodined.c

    r7efdd0 r01e558  
    6565WSADATA wsa_data; 
    6666#endif 
     67 
     68#define PASSWORD_ENV_VAR "IODINED_PASS" 
    6769 
    6870static int running = 1; 
     
    13451347        } 
    13461348         
    1347         if (strlen(password) == 0) 
    1348                 read_password(password, sizeof(password)); 
     1349        if (strlen(password) == 0) { 
     1350                if (NULL != getenv(PASSWORD_ENV_VAR)) 
     1351                        snprintf(password, sizeof(password), "%s", getenv(PASSWORD_ENV_VAR)); 
     1352                else 
     1353                        read_password(password, sizeof(password)); 
     1354        } 
    13491355 
    13501356        if ((tun_fd = open_tun(device)) == -1) { 
Note: See TracChangeset for help on using the changeset viewer.