Display configuration information when using the -V option...

This commit is contained in:
hpa 2001-11-14 04:16:23 +00:00
parent 5ec55f35e9
commit 7edb3d5b92
5 changed files with 45 additions and 14 deletions

View file

@ -187,8 +187,29 @@ typedef unsigned long u_long;
#define EOPTNEG 8
#endif
/* tftp-hpa version */
/* tftp-hpa version and configuration strings */
#include "version.h"
#ifdef WITH_READLINE
#define WITH_READLINE_STR ", with readline"
#else
#define WITH_READLINE_STR ", without readline"
#endif
#ifdef WITH_REGEX
#define WITH_REGEX_STR ", with remap"
#else
#define WITH_REGEX_STR ", without remap"
#endif
#ifdef HAVE_LIBWRAP
#define HAVE_LIBWRAP_STR ", with tcpwrappers"
#else
#define HAVE_LIBWRAP_STR ", without tcpwrappers"
#endif
#define TFTP_CONFIG_STR VERSION WITH_READLINE_STR
#define TFTPD_CONFIG_STR VERSION WITH_REGEX_STR HAVE_LIBWRAP_STR
#endif

View file

@ -192,8 +192,8 @@ main(int argc, char *argv[])
verbose = 1;
break;
case 'V':
/* Print version to stdout and exit */
printf("%s\n", VERSION);
/* Print version and configuration to stdout and exit */
printf("%s\n", TFTP_CONFIG_STR);
exit(0);
default:
fprintf(stderr, "Usage: %s [-v] [host]\n", argv[0]);

View file

@ -59,7 +59,8 @@ command below.)
Default to verbose mode.
.TP
.B \-V
Print the version number to standard output, then exit gracefully.
Print the version number and configuration to standard output, then
exit gracefully.
.SH COMMANDS
Once
.B tftp

View file

@ -107,7 +107,9 @@ default is 900 (15 minutes.)
Specify the use of filename remapping. The
.I remap-file
is a file containing the remapping rules. See the section on filename
remapping below.
remapping below. This option may not be compiled in, see
.B "tftpd \-V"
to verify whether or not it is available.
.TP
.B \-v
Increase the logging verbosity of
@ -119,7 +121,8 @@ Indicate that a specific RFC 2347 TFTP option should never be
accepted.
.TP
.B \-V
Print the version number to standard output, then exit gracefully.
Print the version number and configuration to standard output, then
exit gracefully.
.SH "RFC 2347 OPTION NEGOTIATION"
This version of
.B tftpd
@ -213,12 +216,17 @@ will allow only publicly readable files (o+r) to be accessed. Files
may be written only if they already exist and are publicly writable,
unless the
.B \-c
option is specified.
Note that this extends the concept of ``public'' to include all users
on all hosts that can be reached through the network; this may not be
appropriate on all systems, and its implications should be considered
before enabling TFTP service. Typically, some kind of firewall or
packet-filter solution should be employed.
option is specified. Note that this extends the concept of ``public''
to include all users on all hosts that can be reached through the
network; this may not be appropriate on all systems, and its
implications should be considered before enabling TFTP service.
Typically, some kind of firewall or packet-filter solution should be
employed. If appropriately compiled (see the output of
.BR "tftpd \-V" )
.B tftpd
will query the
.BR hosts_access (5)
database for access control information. This may be slow.
.PP
The server should be set to have the user ID with the lowest possible
privilege; please see the
@ -277,5 +285,6 @@ added patches by Markus Gutschke and Gero Kulhman.
.SH "SEE ALSO"
.BR tftp (1),
.BR egrep (1),
.BR hosts_access (5),
.BR regex (7),
.BR inetd (8).

View file

@ -259,8 +259,8 @@ main(int argc, char **argv)
verbosity++;
break;
case 'V':
/* Print version to stdout and exit */
printf("%s\n", VERSION);
/* Print configuration to stdout and exit */
printf("%s\n", TFTPD_CONFIG_STR);
exit(0);
break;
default: