forked from mirrors/tftp-hpa-google
Display configuration information when using the -V option...
This commit is contained in:
parent
5ec55f35e9
commit
7edb3d5b92
5 changed files with 45 additions and 14 deletions
23
config.h
23
config.h
|
@ -187,8 +187,29 @@ typedef unsigned long u_long;
|
||||||
#define EOPTNEG 8
|
#define EOPTNEG 8
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* tftp-hpa version */
|
/* tftp-hpa version and configuration strings */
|
||||||
|
|
||||||
#include "version.h"
|
#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
|
#endif
|
||||||
|
|
|
@ -192,8 +192,8 @@ main(int argc, char *argv[])
|
||||||
verbose = 1;
|
verbose = 1;
|
||||||
break;
|
break;
|
||||||
case 'V':
|
case 'V':
|
||||||
/* Print version to stdout and exit */
|
/* Print version and configuration to stdout and exit */
|
||||||
printf("%s\n", VERSION);
|
printf("%s\n", TFTP_CONFIG_STR);
|
||||||
exit(0);
|
exit(0);
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "Usage: %s [-v] [host]\n", argv[0]);
|
fprintf(stderr, "Usage: %s [-v] [host]\n", argv[0]);
|
||||||
|
|
|
@ -59,7 +59,8 @@ command below.)
|
||||||
Default to verbose mode.
|
Default to verbose mode.
|
||||||
.TP
|
.TP
|
||||||
.B \-V
|
.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
|
.SH COMMANDS
|
||||||
Once
|
Once
|
||||||
.B tftp
|
.B tftp
|
||||||
|
|
|
@ -107,7 +107,9 @@ default is 900 (15 minutes.)
|
||||||
Specify the use of filename remapping. The
|
Specify the use of filename remapping. The
|
||||||
.I remap-file
|
.I remap-file
|
||||||
is a file containing the remapping rules. See the section on filename
|
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
|
.TP
|
||||||
.B \-v
|
.B \-v
|
||||||
Increase the logging verbosity of
|
Increase the logging verbosity of
|
||||||
|
@ -119,7 +121,8 @@ Indicate that a specific RFC 2347 TFTP option should never be
|
||||||
accepted.
|
accepted.
|
||||||
.TP
|
.TP
|
||||||
.B \-V
|
.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"
|
.SH "RFC 2347 OPTION NEGOTIATION"
|
||||||
This version of
|
This version of
|
||||||
.B tftpd
|
.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,
|
may be written only if they already exist and are publicly writable,
|
||||||
unless the
|
unless the
|
||||||
.B \-c
|
.B \-c
|
||||||
option is specified.
|
option is specified. Note that this extends the concept of ``public''
|
||||||
Note that this extends the concept of ``public'' to include all users
|
to include all users on all hosts that can be reached through the
|
||||||
on all hosts that can be reached through the network; this may not be
|
network; this may not be appropriate on all systems, and its
|
||||||
appropriate on all systems, and its implications should be considered
|
implications should be considered before enabling TFTP service.
|
||||||
before enabling TFTP service. Typically, some kind of firewall or
|
Typically, some kind of firewall or packet-filter solution should be
|
||||||
packet-filter solution should be employed.
|
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
|
.PP
|
||||||
The server should be set to have the user ID with the lowest possible
|
The server should be set to have the user ID with the lowest possible
|
||||||
privilege; please see the
|
privilege; please see the
|
||||||
|
@ -277,5 +285,6 @@ added patches by Markus Gutschke and Gero Kulhman.
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
.BR tftp (1),
|
.BR tftp (1),
|
||||||
.BR egrep (1),
|
.BR egrep (1),
|
||||||
|
.BR hosts_access (5),
|
||||||
.BR regex (7),
|
.BR regex (7),
|
||||||
.BR inetd (8).
|
.BR inetd (8).
|
||||||
|
|
|
@ -259,8 +259,8 @@ main(int argc, char **argv)
|
||||||
verbosity++;
|
verbosity++;
|
||||||
break;
|
break;
|
||||||
case 'V':
|
case 'V':
|
||||||
/* Print version to stdout and exit */
|
/* Print configuration to stdout and exit */
|
||||||
printf("%s\n", VERSION);
|
printf("%s\n", TFTPD_CONFIG_STR);
|
||||||
exit(0);
|
exit(0);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue