add upstream fixes for 1.7.2
[openwrt.git] / package / openswan / patches / 110-scripts.patch
1 Index: openswan-2.4.8/programs/loggerfix
2 ===================================================================
3 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
4 +++ openswan-2.4.8/programs/loggerfix 2007-06-04 13:22:50.209222320 +0200
5 @@ -0,0 +1,5 @@
6 +#!/bin/sh
7 +# use filename instead of /dev/null to log, but dont log to flash or ram
8 +# pref. log to nfs mount
9 +echo "$*" >> /dev/null
10 +exit 0
11 Index: openswan-2.4.8/programs/look/look.in
12 ===================================================================
13 --- openswan-2.4.8.orig/programs/look/look.in 2007-06-04 13:22:49.874273240 +0200
14 +++ openswan-2.4.8/programs/look/look.in 2007-06-04 13:22:50.209222320 +0200
15 @@ -84,7 +84,7 @@
16 then
17 pat="$pat|$defaultroutephys\$|$defaultroutevirt\$"
18 else
19 - for i in `echo "$IPSECinterfaces" | sed 's/=/ /'`
20 + for i in `echo "$IPSECinterfaces" | tr '=' ' '`
21 do
22 pat="$pat|$i\$"
23 done
24 Index: openswan-2.4.8/programs/_plutorun/_plutorun.in
25 ===================================================================
26 --- openswan-2.4.8.orig/programs/_plutorun/_plutorun.in 2007-06-04 13:22:49.880272328 +0200
27 +++ openswan-2.4.8/programs/_plutorun/_plutorun.in 2007-06-04 13:22:50.209222320 +0200
28 @@ -147,7 +147,7 @@
29 exit 1
30 fi
31 else
32 - if test ! -w "`dirname $stderrlog`"
33 + if test ! -w "`echo $stderrlog | sed -r 's/(^.*\/)(.*$)/\1/'`"
34 then
35 echo Cannot write to directory to create \"$stderrlog\".
36 exit 1
37 Index: openswan-2.4.8/programs/_realsetup/_realsetup.in
38 ===================================================================
39 --- openswan-2.4.8.orig/programs/_realsetup/_realsetup.in 2007-06-04 13:22:49.888271112 +0200
40 +++ openswan-2.4.8/programs/_realsetup/_realsetup.in 2007-06-04 13:22:50.210222168 +0200
41 @@ -232,7 +232,7 @@
42
43 # misc pre-Pluto setup
44
45 - perform test -d `dirname $subsyslock` "&&" touch $subsyslock
46 + perform test -d `echo $subsyslock | sed -r 's/(^.*\/)(.*$)/\1/'` "&&" touch $subsyslock "&&" rm -f $subsyslock
47
48 if test " $IPSECforwardcontrol" = " yes"
49 then
50 Index: openswan-2.4.8/programs/send-pr/send-pr.in
51 ===================================================================
52 --- openswan-2.4.8.orig/programs/send-pr/send-pr.in 2007-06-04 13:22:49.894270200 +0200
53 +++ openswan-2.4.8/programs/send-pr/send-pr.in 2007-06-04 13:22:50.210222168 +0200
54 @@ -402,7 +402,7 @@
55 else
56 if [ "$fieldname" != "Category" ]
57 then
58 - values=`${BINDIR}/query-pr --valid-values $fieldname | sed ':a;N;$!ba;s/\n/ /g' | sed 's/ *$//g;s/ / | /g;s/^/[ /;s/$/ ]/;'`
59 + values=`${BINDIR}/query-pr --valid-values $fieldname | tr '\n' ' ' | sed 's/ *$//g;s/ / | /g;s/^/[ /;s/$/ ]/;'`
60 valslen=`echo "$values" | wc -c`
61 else
62 values="choose from a category listed above"
63 @@ -414,7 +414,7 @@
64 else
65 desc="<${values} (one line)>";
66 fi
67 - dpat=`echo "$desc" | sed 's/[][*+^$|\()&/]/./g'`
68 + dpat=`echo "$desc" | tr '\]\[*+^$|\()&/' '............'`
69 echo "/^>${fieldname}:/ s/${dpat}//" >> $FIXFIL
70 fi
71 echo "${fmtname}${desc}" >> $file
72 @@ -425,7 +425,7 @@
73 desc=" $default_val";
74 else
75 desc=" <`${BINDIR}/query-pr --field-description $fieldname` (multiple lines)>";
76 - dpat=`echo "$desc" | sed 's/[][*+^$|\()&/]/./g'`
77 + dpat=`echo "$desc" | tr '\]\[*+^$|\()&/' '............'`
78 echo "s/^${dpat}//" >> $FIXFIL
79 fi
80 echo "${fmtname}" >> $file;
81 @@ -437,7 +437,7 @@
82 desc="${default_val}"
83 else
84 desc="<`${BINDIR}/query-pr --field-description $fieldname` (one line)>"
85 - dpat=`echo "$desc" | sed 's/[][*+^$|\()&/]/./g'`
86 + dpat=`echo "$desc" | tr '\]\[*+^$|\()&/' '............'`
87 echo "/^>${fieldname}:/ s/${dpat}//" >> $FIXFIL
88 fi
89 echo "${fmtname}${desc}" >> $file
90 Index: openswan-2.4.8/programs/setup/setup.in
91 ===================================================================
92 --- openswan-2.4.8.orig/programs/setup/setup.in 2007-06-04 13:22:49.902268984 +0200
93 +++ openswan-2.4.8/programs/setup/setup.in 2007-06-04 13:22:50.210222168 +0200
94 @@ -117,12 +117,21 @@
95 # do it
96 case "$1" in
97 start|--start|stop|--stop|_autostop|_autostart)
98 - if test " `id -u`" != " 0"
99 + if [ "x${USER}" != "xroot" ]
100 then
101 echo "permission denied (must be superuser)" |
102 logger -s -p $IPSECsyslog -t ipsec_setup 2>&1
103 exit 1
104 fi
105 + # make sure all required directories exist
106 + if [ ! -d /var/run/pluto ]
107 + then
108 + mkdir -p /var/run/pluto
109 + fi
110 + if [ ! -d /var/lock/subsys ]
111 + then
112 + mkdir -p /var/lock/subsys
113 + fi
114 tmp=/var/run/pluto/ipsec_setup.st
115 outtmp=/var/run/pluto/ipsec_setup.out
116 (
117 Index: openswan-2.4.8/programs/showhostkey/showhostkey.in
118 ===================================================================
119 --- openswan-2.4.8.orig/programs/showhostkey/showhostkey.in 2007-06-04 13:22:49.908268072 +0200
120 +++ openswan-2.4.8/programs/showhostkey/showhostkey.in 2007-06-04 13:22:50.214221560 +0200
121 @@ -63,7 +63,7 @@
122 exit 1
123 fi
124
125 -host="`hostname --fqdn`"
126 +host="`cat /proc/sys/kernel/hostname`"
127
128 awk ' BEGIN {
129 inkey = 0
130 @@ -81,7 +81,7 @@
131 os = "[ \t]*"
132 x = "[^ \t]+"
133 oc = "(#.*)?"
134 - suffix = ":" os "[rR][sS][aA]" os "{" os oc "$"
135 + suffix = ":" os "[rR][sS][aA]" os "[{]" os oc "$"
136 if (id == "") {
137 pat = "^" suffix
138 printid = "default"
139 Index: openswan-2.4.8/programs/starter/klips.c
140 ===================================================================
141 --- openswan-2.4.8.orig/programs/starter/klips.c 2007-06-04 13:22:49.914267160 +0200
142 +++ openswan-2.4.8/programs/starter/klips.c 2007-06-04 13:22:50.214221560 +0200
143 @@ -83,7 +83,7 @@
144 if (stat(PROC_MODULES,&stb)==0) {
145 unsetenv("MODPATH");
146 unsetenv("MODULECONF");
147 - system("depmod -a >/dev/null 2>&1 && modprobe ipsec");
148 + system("depmod -a >/dev/null 2>&1 && insmod ipsec");
149 }
150 if (stat(PROC_IPSECVERSION,&stb)==0) {
151 _klips_module_loaded = 1;
152 Index: openswan-2.4.8/programs/starter/netkey.c
153 ===================================================================
154 --- openswan-2.4.8.orig/programs/starter/netkey.c 2007-06-04 13:22:49.920266248 +0200
155 +++ openswan-2.4.8/programs/starter/netkey.c 2007-06-04 13:22:50.214221560 +0200
156 @@ -75,7 +75,7 @@
157 if (stat(PROC_MODULES,&stb)==0) {
158 unsetenv("MODPATH");
159 unsetenv("MODULECONF");
160 - system("depmod -a >/dev/null 2>&1 && modprobe xfrm4_tunnel esp4 ah4 af_key");
161 + system("depmod -a >/dev/null 2>&1 && insmod xfrm4_tunnel esp4 ah4 af_key");
162 }
163 if (stat(PROC_NETKEY,&stb)==0) {
164 _netkey_module_loaded = 1;
165 Index: openswan-2.4.8/programs/_startklips/_startklips.in
166 ===================================================================
167 --- openswan-2.4.8.orig/programs/_startklips/_startklips.in 2007-06-04 13:22:49.928265032 +0200
168 +++ openswan-2.4.8/programs/_startklips/_startklips.in 2007-06-04 13:22:50.215221408 +0200
169 @@ -272,16 +272,16 @@
170 echo "FATAL ERROR: Both KLIPS and NETKEY IPsec code is present in kernel"
171 exit
172 fi
173 -if test ! -f $ipsecversion && test ! -f $netkey && modprobe -qn ipsec
174 +if test ! -f $ipsecversion && test ! -f $netkey
175 then
176 # statically compiled KLIPS/NETKEY not found; but there seems to be an ipsec module
177 - modprobe ipsec 2> /dev/null
178 + insmod -q ipsec 2> /dev/null
179 fi
180
181 -if test ! -f $ipsecversion && test ! -f $netkey && modprobe -qn af_key
182 +if test ! -f $ipsecversion && test ! -f $netkey
183 then
184 # netkey should work then
185 - modprobe af_key 2> /dev/null
186 + insmod -q af_key 2> /dev/null
187 fi
188 if test ! -f $ipsecversion && test ! -f $netkey
189 then
190 @@ -294,27 +294,27 @@
191 # modules shared between klips and netkey
192 if test -f $modules
193 then
194 - # we modprobe hw_random so ipsec verify can complain about not using it
195 - modprobe -q hw_random 2> /dev/null
196 + # we insmod hw_random so ipsec verify can complain about not using it
197 + insmod -q hw_random 2> /dev/null
198 # padlock must load before aes module
199 - modprobe -q padlock 2> /dev/null
200 + insmod -q padlock 2> /dev/null
201 # load the most common ciphers/algo's
202 - modprobe -q sha256 2> /dev/null
203 - modprobe -q sha1 2> /dev/null
204 - modprobe -q md5 2> /dev/null
205 - modprobe -q des 2> /dev/null
206 - modprobe -q aes 2> /dev/null
207 + insmod -q sha256 2> /dev/null
208 + insmod -q sha1 2> /dev/null
209 + insmod -q md5 2> /dev/null
210 + insmod -q des 2> /dev/null
211 + insmod -q aes 2> /dev/null
212
213 if test -f $netkey
214 then
215 klips=false
216 - modprobe -q ah4 2> /dev/null
217 - modprobe -q esp4 2> /dev/null
218 - modprobe -q ipcomp 2> /dev/null
219 + insmod -q ah4 2> /dev/null
220 + insmod -q esp4 2> /dev/null
221 + insmod -q ipcomp 2> /dev/null
222 # xfrm4_tunnel is needed by ipip and ipcomp
223 - modprobe -q xfrm4_tunnel 2> /dev/null
224 + insmod -q xfrm4_tunnel 2> /dev/null
225 # xfrm_user contains netlink support for IPsec
226 - modprobe -q xfrm_user 2> /dev/null
227 + insmod -q xfrm_user 2> /dev/null
228 fi
229
230 if test ! -f $ipsecversion && $klips
231 @@ -327,7 +327,7 @@
232 fi
233 unset MODPATH MODULECONF # no user overrides!
234 depmod -a >/dev/null 2>&1
235 - modprobe -v ipsec
236 + insmod -v ipsec
237 if test ! -f $ipsecversion
238 then
239 echo "kernel appears to lack IPsec support (neither CONFIG_KLIPS or CONFIG_NET_KEY are set)"
This page took 0.046489 seconds and 5 git commands to generate.