-k now points to an environment variable containing the password

This commit is contained in:
Nico Golde 2012-06-16 17:00:31 +02:00
parent 2bcd27c9e8
commit c68beccf59
3 changed files with 10 additions and 6 deletions

View File

@ -1,3 +1,8 @@
1.7 (20XX-XX-XX)
- -k now specifies an environment variable that contains the
server key. This behaviour has been changed in order to not
expose the password in the process list.
1.6 (2011-01-31): 1.6 (2011-01-31):
- fix regression introduced for handling unknown commands - fix regression introduced for handling unknown commands

9
ii.1
View File

@ -26,7 +26,7 @@ and ii creates a new channel directory with in and out file.
.RB [ \-p .RB [ \-p
.IR port ] .IR port ]
.RB [ \-k .RB [ \-k
.IR password ] .IR environment variable ]
.RB [ \-i .RB [ \-i
.IR prefix ] .IR prefix ]
.RB [ \-n .RB [ \-n
@ -42,10 +42,9 @@ lets you override the default servername (irc.freenode.net)
.BI \-p " port" .BI \-p " port"
lets you override the default port (6667) lets you override the default port (6667)
.TP .TP
.BI \-k " password" .BI \-k " environment variable"
lets you use a password to authenticate your nick on the server lets you specify an environment variable that contains your IRC password, e.g. IIPASS="foobar" ii -k FOOBAR.
(be aware of the problem that this is visible in the process list, if you This is done in order to prevent other users from eavesdropping the server password via the process list.
don't want this use a query to submit your password)
.TP .TP
.BI \-i " prefix" .BI \-i " prefix"
lets you override the default irc path (~/irc) lets you override the default irc path (~/irc)

2
ii.c
View File

@ -477,7 +477,7 @@ int main(int argc, char *argv[]) {
case 's': host = argv[++i]; break; case 's': host = argv[++i]; break;
case 'p': port = strtol(argv[++i], NULL, 10); break; case 'p': port = strtol(argv[++i], NULL, 10); break;
case 'n': snprintf(nick,sizeof(nick),"%s", argv[++i]); break; case 'n': snprintf(nick,sizeof(nick),"%s", argv[++i]); break;
case 'k': key = argv[++i]; break; case 'k': key = getenv(argv[++i]); break;
case 'f': fullname = argv[++i]; break; case 'f': fullname = argv[++i]; break;
default: usage(); break; default: usage(); break;
} }