[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-inetutils] [PATCH] rexec client
From: |
Alfred M. Szmidt |
Subject: |
Re: [bug-inetutils] [PATCH] rexec client |
Date: |
Wed, 29 Jul 2009 00:48:08 -0400 |
Nice work Giuseppe!
I saw inetutils has a rexec server but it is missing a rexec
client, so I wrote one.
Do you have papers on file for inetutils? Do you have commit access
to the CVS repo?
If you don't, then we need to sort that out, if you do and the below
fixes are done, and that this has been tested a bit, please go ahead
and commit.
address@hidden rexec invocation
address@hidden @command{talk}: a remote execution program
address@hidden talk
+
address@hidden is a program that executes a program on another host.
+
address@hidden Invoking
Don't use a sectioning here, the chaper is already the invocation
node, so there is no need to split it up further. You can look for
inspiration from for example the ftp chapter.
There is no documentation of what arguments rexec as such takes,
something like:
@example
ftp address@hidden@dots{}] address@hidden address@hidden
@end example
Options like --password take an argument, so that too must be noted.
rexec should also be mentioned in NEWS.
+ set_program_name (argv[0]);
+
+ iu_argp_init ("rexec", program_authors);
+
+ arguments.user = NULL;
+ arguments.password = NULL;
+ arguments.host = NULL;
+ arguments.command = NULL;
+ arguments.err_port = 0;
+ arguments.use_err = 1;
+ arguments.port = 512;
+
+ argp_parse (&argp, argc, argv, ARGP_IN_ORDER, 0, &arguments);
+
+ if (arguments.user == NULL)
+ error (EXIT_FAILURE, 0, "user not specified");
+
+ if (arguments.password == NULL)
+ error (EXIT_FAILURE, 0, "password not specified");
+
+ if (arguments.host == NULL)
+ error (EXIT_FAILURE, 0, "host not specified");
+
+ if (arguments.command == NULL)
+ error (EXIT_FAILURE, 0, "command not specified");
If these are required options, then they should be documented as such,
somewhere. Currently rexec will not run at all unless all of them are
specified (since argp_parse will not assign arg.user to non-NULL
unless you specify --user=FOO on the command line).
+void
+do_rexec (struct arguments *arguments)
...
+ host = gethostbyname (arguments->host);
+ if (host == NULL)
+ error (EXIT_FAILURE, errno, "cannot find host");
This error will look strange, something like,
error (EXIT_FAILURE, errno, "%s: cannot connect to host", host);
would be better. The same applies for any other such case.
In general, there should be no space between:
foo = 123;
if (foo)
{
...
construct.