[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-81-g32ef54
From: |
Mats Erik Andersson |
Subject: |
[SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-81-g32ef549 |
Date: |
Tue, 24 Apr 2012 20:13:43 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".
The branch, master has been updated
via 32ef5496304612223b50cffcd4c639544201b4e7 (commit)
from 6129edc81cd2dba78628a0297c39c25b0ffb3956 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=32ef5496304612223b50cffcd4c639544201b4e7
commit 32ef5496304612223b50cffcd4c639544201b4e7
Author: Mats Erik Andersson <address@hidden>
Date: Tue Apr 24 22:13:26 2012 +0200
rexec: Password from stdin.
diff --git a/ChangeLog b/ChangeLog
index 1f1faaf..5dec85a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2012-04-24 Mats Erik Andersson <address@hidden>
+
+ rexec: Read password from stdin.
+
+ * src/rexec.c (main): New variables PASSWORD and N.
+ If `arguments.password' is a single dash, read a line
+ from standard in and assign it to `arguments.password'.
+ * doc/inetutils.texi (rexec invocation): Mention new
+ treatment of `-p/--password'.
+
2012-04-22 Mats Erik Andersson <address@hidden>
rexecd: Implement syslog support.
diff --git a/doc/inetutils.texi b/doc/inetutils.texi
index 180d4ca..dc1b6a1 100644
--- a/doc/inetutils.texi
+++ b/doc/inetutils.texi
@@ -1970,7 +1970,13 @@ If specified, an error stream will not be created.
@itemx address@hidden
@opindex -p
@opindex --password
-Specify the password for logging-in.
+Specify the password for logging-in. The special value
+consisting of a single dash @samp{-} will make @command{rexec}
+read a single line from stdin. This input is then used
+as password and is passed as such to the remote server.
+Thus it is possible to hide vital access information
+slightly better than the full disclosure implicit in
+the text of a command line option.
@item -P
@itemx address@hidden
diff --git a/src/rexec.c b/src/rexec.c
index 5b35238..cee880f 100644
--- a/src/rexec.c
+++ b/src/rexec.c
@@ -135,7 +135,8 @@ int
main (int argc, char **argv)
{
struct arguments arguments;
- int failed = 0;
+ char password[64];
+ int n, failed = 0;
set_program_name (argv[0]);
iu_argp_init ("rexec", program_authors);
@@ -178,6 +179,27 @@ main (int argc, char **argv)
if (failed > 0)
exit (EXIT_FAILURE);
+ if (strcmp ("-", arguments.password) == 0)
+ {
+ password[0] = '\0';
+
+ alarm (15);
+ fgets (password, sizeof (password), stdin);
+ alarm (0);
+
+ n = strlen (password);
+ if ((n > 0) && (password[n - 1] == '\n'))
+ {
+ password[n - 1] = '\0';
+ --n;
+ }
+
+ if (n == 0)
+ error (EXIT_FAILURE, 0, "empty password");
+ else
+ arguments.password = password;
+ }
+
do_rexec (&arguments);
exit (remote_err);
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 10 ++++++++++
doc/inetutils.texi | 8 +++++++-
src/rexec.c | 24 +++++++++++++++++++++++-
3 files changed, 40 insertions(+), 2 deletions(-)
hooks/post-receive
--
GNU Inetutils
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-81-g32ef549,
Mats Erik Andersson <=