~ubuntu-branches/ubuntu/saucy/xinetd/saucy

« back to all changes in this revision

Viewing changes to debian/patches/0002-xconv.pl-updates.patch

  • Committer: Bazaar Package Importer
  • Author(s): Pierre Habouzit
  • Date: 2008-03-26 17:46:54 UTC
  • mfrom: (3.1.4 hardy)
  • Revision ID: james.westby@ubuntu.com-20080326174654-s1oh9go9sali6nd7
Tags: 1:2.3.14-7
Update init.d to test if ipv6 support is built in the kernel before
activating it by default (Closes: 472755).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 230b222e62166df16f21aff3859dafab3cd3cae7 Mon Sep 17 00:00:00 2001
 
2
From: Pierre Habouzit <madcoder@debian.org>
 
3
Date: Mon, 26 Nov 2007 16:01:43 +0100
 
4
Subject: [PATCH] xconv.pl updates
 
5
 
 
6
---
 
7
 xinetd/xconv.pl |   37 ++++++++++++++++++++++++++++++++++++-
 
8
 1 files changed, 36 insertions(+), 1 deletions(-)
 
9
 
 
10
diff --git a/xinetd/xconv.pl b/xinetd/xconv.pl
 
11
index cc58868..6c0a71d 100755
 
12
--- a/xinetd/xconv.pl
 
13
+++ b/xinetd/xconv.pl
 
14
@@ -16,8 +16,16 @@ print_defaults;
 
15
 
 
16
 while( <STDIN> ) {
 
17
 
 
18
+       $disable = 0;                                   # Default to 'enable'
 
19
+
 
20
        chomp;
 
21
 
 
22
+       # Check for disable before we check for comments
 
23
+       if (m/^\#<off>\#/i) {
 
24
+               s/^.*?\s//;
 
25
+               $disable = 1;
 
26
+       }
 
27
+
 
28
        # Remove comment lines
 
29
        if( grep /^#/, $_ ) {
 
30
                next;
 
31
@@ -37,9 +45,12 @@ while( <STDIN> ) {
 
32
 
 
33
        print "service $command[0]\n";
 
34
        print "{\n";
 
35
-       print "\tflags       = NAMEINARGS\n";
 
36
        print "\tsocket_type = $command[1]\n";
 
37
        print "\tprotocol    = $command[2]\n";
 
38
+       if( $command[0] =~ /^\d+$/ ) {
 
39
+               print "\tport        = $command[0]\n";
 
40
+               print "\ttype        = UNLISTED\n";
 
41
+       }
 
42
        if( grep /no/, $command[3] ) {
 
43
                print "\twait        = no\n";
 
44
        } else {
 
45
@@ -50,9 +61,28 @@ while( <STDIN> ) {
 
46
        if( defined $user[1] ) {
 
47
                print "\tgroup       = $user[1]\n";
 
48
        }
 
49
+       # Amanda is a special case, it needs this, see
 
50
+       # http://www.amanda.org/docs/install.html and 
 
51
+       # Bug report #167367
 
52
+       if ( $command[6] =~ /(amandad|amindexd|amidxtaped)/ ) {
 
53
+               print "\tgroups      = yes\n";
 
54
+       }
 
55
        if( grep /internal/, $command[5] ) {
 
56
                print "\ttype        = INTERNAL\n";
 
57
                print "\tid          = $command[0]-$command[1]\n";
 
58
+       } elsif ( $command[5] =~ /\/usr\/sbin\/tcpd/ ){
 
59
+       # Tcp wrapping is already implemented in xinetd
 
60
+               print "\tserver      = $command[6]\n";
 
61
+               if ( defined $command[7] ) {
 
62
+                       print "\tserver_args = ";
 
63
+                       $i = 7;
 
64
+                       while( defined $command[$i] ) {
 
65
+                               print "$command[$i] ";
 
66
+                               $i++;
 
67
+                       }
 
68
+                       print "\n";
 
69
+               }
 
70
+       
 
71
        } else {
 
72
                print "\tserver      = $command[5]\n";
 
73
                print "\tserver_args = ";
 
74
@@ -65,6 +95,11 @@ while( <STDIN> ) {
 
75
 
 
76
                print "\n";
 
77
        }
 
78
+
 
79
+       if ($disable) {
 
80
+               print "\tdisable     = yes\n";
 
81
+       }
 
82
+
 
83
        print "}\n";
 
84
        print "\n";
 
85
 }
 
86
-- 
 
87
1.5.3.6.2040.g15e6
 
88