projects
/
packages
/
xinetd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d6198f7
)
xconv.pl updates
author
Pierre Habouzit
<madcoder@debian.org>
Mon, 26 Nov 2007 15:01:43 +0000
(16:01 +0100)
committer
Pierre Habouzit
<madcoder@debian.org>
Mon, 26 Nov 2007 17:57:55 +0000
(18:57 +0100)
xinetd/xconv.pl
patch
|
blob
|
history
diff --git
a/xinetd/xconv.pl
b/xinetd/xconv.pl
index
cc58868
..
6c0a71d
100755
(executable)
--- a/
xinetd/xconv.pl
+++ b/
xinetd/xconv.pl
@@
-16,8
+16,16
@@
print_defaults;
while( <STDIN> ) {
while( <STDIN> ) {
+ $disable = 0; # Default to 'enable'
+
chomp;
chomp;
+ # Check for disable before we check for comments
+ if (m/^\#<off>\#/i) {
+ s/^.*?\s//;
+ $disable = 1;
+ }
+
# Remove comment lines
if( grep /^#/, $_ ) {
next;
# Remove comment lines
if( grep /^#/, $_ ) {
next;
@@
-37,9
+45,12
@@
while( <STDIN> ) {
print "service $command[0]\n";
print "{\n";
print "service $command[0]\n";
print "{\n";
- print "\tflags = NAMEINARGS\n";
print "\tsocket_type = $command[1]\n";
print "\tprotocol = $command[2]\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( grep /no/, $command[3] ) {
print "\twait = no\n";
} else {
@@
-50,9
+61,28
@@
while( <STDIN> ) {
if( defined $user[1] ) {
print "\tgroup = $user[1]\n";
}
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";
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 = ";
} else {
print "\tserver = $command[5]\n";
print "\tserver_args = ";
@@
-65,6
+95,11
@@
while( <STDIN> ) {
print "\n";
}
print "\n";
}
+
+ if ($disable) {
+ print "\tdisable = yes\n";
+ }
+
print "}\n";
print "\n";
}
print "}\n";
print "\n";
}