|
|
ab0df7 |
Xinetd parses and applies its configuration line by line. If a user wants to
|
|
|
ab0df7 |
specify NAMEINARGS as a flag, it has to be *before* specifying 'server_args'.
|
|
|
ab0df7 |
|
|
|
ab0df7 |
Author: Jan Synacek <jsynacek@redhat.com>
|
|
|
ab0df7 |
Resolves: #1037565
|
|
|
ab0df7 |
|
|
|
ab0df7 |
--- a/xinetd/parse.c 2013-11-21 10:51:25.025436376 +0100
|
|
|
ab0df7 |
+++ b/xinetd/parse.c 2013-11-21 14:45:44.374121057 +0100
|
|
|
ab0df7 |
@@ -633,7 +633,28 @@ static status_e identify_attribute( entr
|
|
|
ab0df7 |
|
|
|
ab0df7 |
if ( (*ap->a_parser)( attr_values, scp, op ) == OK )
|
|
|
ab0df7 |
{ /* This is the normal path. */
|
|
|
ab0df7 |
- SC_SPECIFY( scp, ap->a_id ) ;
|
|
|
ab0df7 |
+ /* If flags contain NAMEINARGS and server_args is already set, disable the service.
|
|
|
ab0df7 |
+ Server args are already set incorrectly. */
|
|
|
ab0df7 |
+ if ( strcmp( ap->a_name, "flags" ) == 0 &&
|
|
|
ab0df7 |
+ SC_SERVER_ARGV( scp ) )
|
|
|
ab0df7 |
+ {
|
|
|
ab0df7 |
+ int i = 0, n = pset_count( attr_values ) ;
|
|
|
ab0df7 |
+ for ( ; i < n ; i++ ) {
|
|
|
ab0df7 |
+ char *v = (char *)pset_pointer( attr_values, i ) ;
|
|
|
ab0df7 |
+ if ( strcmp( v, "NAMEINARGS" ) == 0 )
|
|
|
ab0df7 |
+ break ;
|
|
|
ab0df7 |
+ }
|
|
|
ab0df7 |
+
|
|
|
ab0df7 |
+ if ( i != n ) {
|
|
|
ab0df7 |
+ parsemsg( LOG_ERR, func,
|
|
|
ab0df7 |
+ "NAMEINARGS flag is set after server_args - DISABLING SERVICE" ) ;
|
|
|
ab0df7 |
+ SC_DISABLE( scp ) ;
|
|
|
ab0df7 |
+ }
|
|
|
ab0df7 |
+ }
|
|
|
ab0df7 |
+ else
|
|
|
ab0df7 |
+ {
|
|
|
ab0df7 |
+ SC_SPECIFY( scp, ap->a_id ) ;
|
|
|
ab0df7 |
+ }
|
|
|
ab0df7 |
}
|
|
|
ab0df7 |
else if ( entry_type == SERVICE_ENTRY )
|
|
|
ab0df7 |
{
|
|
|
ab0df7 |
--- a/xinetd/xinetd.conf.man 2013-12-03 10:06:35.717977075 +0100
|
|
|
ab0df7 |
+++ b/xinetd/xinetd.conf.man 2013-12-03 10:41:14.779089430 +0100
|
|
|
ab0df7 |
@@ -106,7 +106,8 @@
|
|
|
ab0df7 |
This will cause the first argument in "server_args" to be argv[0] when
|
|
|
ab0df7 |
executing the server, as specified in "server". This allows you to use
|
|
|
ab0df7 |
tcpd by putting tcpd in "server" and the name of the server in "server_args"
|
|
|
ab0df7 |
-like in normal inetd.
|
|
|
ab0df7 |
+like in normal inetd. This flag has to be specified before "server_args",
|
|
|
ab0df7 |
+otherwise is not taken into account.
|
|
|
ab0df7 |
.TP
|
|
|
ab0df7 |
.B NODELAY
|
|
|
ab0df7 |
If the service is a tcp service and the NODELAY flag is set, then the
|