while( <STDIN> ) {
+ $disable = 0; # Default to 'enable'
+
chomp;
+ # Check for disable before we check for comments
+ if (m/^\#<off>\#/i) {
+ s/^.*?\s//;
+ $disable = 1;
+ }
+
# Remove comment lines
if( grep /^#/, $_ ) {
next;
print "service $command[0]\n";
print "{\n";
- print "\tflags = NAMEINARGS\n";
print "\tsocket_type = $command[1]\n";
print "\tprotocol = $command[2]\n";
+ if( $command[0] =~ /^\d+$/ ) {
+ print "\tport = $command[0]\n";
+ print "\ttype = UNLISTED\n";
+ }
if( grep /no/, $command[3] ) {
print "\twait = no\n";
} else {
if( defined $user[1] ) {
print "\tgroup = $user[1]\n";
}
+ # Amanda is a special case, it needs this, see
+ # http://www.amanda.org/docs/install.html and
+ # Bug report #167367
+ if ( $command[6] =~ /(amandad|amindexd|amidxtaped)/ ) {
+ print "\tgroups = yes\n";
+ }
if( grep /internal/, $command[5] ) {
print "\ttype = INTERNAL\n";
print "\tid = $command[0]-$command[1]\n";
+ } elsif ( $command[5] =~ /\/usr\/sbin\/tcpd/ ){
+ # Tcp wrapping is already implemented in xinetd
+ print "\tserver = $command[6]\n";
+ if ( defined $command[7] ) {
+ print "\tserver_args = ";
+ $i = 7;
+ while( defined $command[$i] ) {
+ print "$command[$i] ";
+ $i++;
+ }
+ print "\n";
+ }
+
} else {
print "\tserver = $command[5]\n";
print "\tserver_args = ";
print "\n";
}
+
+ if ($disable) {
+ print "\tdisable = yes\n";
+ }
+
print "}\n";
print "\n";
}