vtun.patch 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. diff -urN vtun/Makefile.in vtun-2.6/Makefile.in
  2. --- vtun/Makefile.in 2002-12-20 09:55:47.000000000 -0700
  3. +++ vtun-2.6/Makefile.in 2003-06-05 12:38:31.000000000 -0600
  4. @@ -28,7 +28,7 @@
  5. LEXFLAGS = -t
  6. INSTALL = @INSTALL@
  7. -INSTALL_OWNER = -o root -g 0
  8. +INSTALL_OWNER =
  9. prefix = @prefix@
  10. exec_prefix = @exec_prefix@
  11. @@ -86,15 +86,15 @@
  12. install_config:
  13. $(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(ETC_DIR)
  14. - if [ ! -f $(ETC_DIR)/vtund.conf ]; then \
  15. - $(INSTALL) -m 600 $(INSTALL_OWNER) vtund.conf $(DESTDIR)$(ETC_DIR); \
  16. - fi
  17. + $(INSTALL) -m 600 $(INSTALL_OWNER) vtund.conf $(DESTDIR)$(ETC_DIR);
  18. + $(INSTALL) -m 600 $(INSTALL_OWNER) scripts/vtund-start.conf $(DESTDIR)$(ETC_DIR);
  19. install: vtund install_config install_man
  20. - $(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(VAR_DIR)/run
  21. $(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(STAT_DIR)
  22. $(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(LOCK_DIR)
  23. $(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(SBIN_DIR)
  24. $(INSTALL) -m 755 $(INSTALL_OWNER) vtund $(DESTDIR)$(SBIN_DIR)
  25. + $(INSTALL) -m 755 $(INSTALL_OWNER) scripts/vtund.rc.debian \
  26. + $(DESTDIR)$(ETC_DIR)/init.d/S90vtun
  27. # DO NOT DELETE THIS LINE -- make depend depends on it.
  28. diff -urN vtun/scripts/vtund.rc.debian vtun-2.6/scripts/vtund.rc.debian
  29. --- vtun/scripts/vtund.rc.debian 2000-03-26 10:06:37.000000000 -0700
  30. +++ vtun-2.6/scripts/vtund.rc.debian 2003-06-05 12:38:46.000000000 -0600
  31. @@ -1,92 +1,48 @@
  32. -#! /usr/bin/perl -w
  33. +#! /bin/sh
  34. +#
  35. -### vtund-start
  36. -###
  37. -### script to start vtund as either a server or a client, according to
  38. -### the config file /etc/vtund-start.conf
  39. -###
  40. -### Copyright 1999 Craig Sanders <cas@taz.net.au>
  41. -###
  42. -### Written for the Debian GNU/Linux distribution. This script is free
  43. -### software licensed under the terms of the GNU General Public License.
  44. -
  45. -$DAEMON="/usr/sbin/vtund" ;
  46. -
  47. -$do_what = shift ;
  48. -$args="start|stop|reload|force-reload|restart" ;
  49. -if ( $do_what !~ /^($args)$/i ) {
  50. - print "Usage: /etc/init.d/vtun {$args}\n" ;
  51. - exit 0 ;
  52. -}
  53. -
  54. -$SSD="/sbin/start-stop-daemon" ;
  55. -$SSDARGS="--verbose --exec $DAEMON" ;
  56. -
  57. -$sconf="/etc/vtund-start.conf" ;
  58. -open(SCONF,"<$sconf") || die "couldn't open $sconf: $!\n" ;
  59. -while (<SCONF>) {
  60. - chomp ;
  61. - s/#.*//;
  62. - s/^ +| +$//;
  63. - next if (/^$/) ;
  64. -
  65. - @line = split ;
  66. - $host = shift(@line) ;
  67. - $server = shift(@line) ;
  68. - $args = "" ;
  69. - foreach (@line) { $args .= " $_" } ;
  70. -
  71. - $host='' if ($host =~ /--server--/i ) ;
  72. -
  73. - if ( $do_what eq 'start' ) {
  74. - &start($host,$server,$args) ;
  75. - } elsif ( $do_what eq 'stop' ) {
  76. - &stop($host,$server,$args) ;
  77. - } elsif ( $do_what eq 'restart' ) {
  78. - &stop($pidfile) ;
  79. - &start($host,$server,$args) ;
  80. - } elsif ( $do_what =~ /^(reload|force-reload)$/ ) {
  81. - &reload($host,$server) ;
  82. - }
  83. -}
  84. -close (SCONF);
  85. -
  86. -
  87. -sub start {
  88. - my($host,$server,$args) = @_ ;
  89. - print " Starting vtun " ;
  90. - if ($host eq '') {
  91. - print "server\n" ;
  92. - system "$SSD --start $SSDARGS -- $args -s -P $server" ;
  93. - } else {
  94. - print "client $host to $server\n" ;
  95. - $pidfile="/var/run/vtun.$host.$server" ;
  96. - system "$SSD --start $SSDARGS --pidfile $pidfile -- $args $host $server" ;
  97. - }
  98. -} ;
  99. -
  100. -sub stop {
  101. - my($host,$server,$args) = @_ ;
  102. - print " Stopping vtun " ;
  103. - if ($host eq '') {
  104. - print "server\n" ;
  105. - system "$SSD --stop $SSDARGS" ;
  106. - } else {
  107. - print "client $host to $server\n" ;
  108. - $pidfile="/var/run/vtun.$host.$server" ;
  109. - system "$SSD --stop $SSDARGS --pidfile $pidfile" ;
  110. - }
  111. -} ;
  112. -
  113. -sub reload {
  114. - my($host,$server) = @_ ;
  115. - print " Reloading vtun " ;
  116. - if ($host eq '') {
  117. - print "server\n" ;
  118. - system "$SSD --stop $SSDARGS --signal 1" ;
  119. - } else {
  120. - print "client $host to $server\n" ;
  121. - $pidfile="/var/run/vtun.$host.$server" ;
  122. - system "$SSD --stop $SSDARGS --signal 1 --pidfile $pidfile" ;
  123. - }
  124. -}
  125. +PATH=/bin:/usr/bin:/sbin:/usr/sbin
  126. +DAEMON=/usr/sbin/vtund
  127. +CONFFILE=/etc/vtund-start.conf
  128. +PIDPREFIX=/var/run/vtund
  129. +
  130. +test -f $DAEMON || exit 0
  131. +
  132. +case "$1" in
  133. + start)
  134. + # find all the defined tunnels
  135. + egrep -v '^[:space:]*(#.*)?$' $CONFFILE | while true;
  136. + do
  137. + read i
  138. + # no more lines available? done, then.
  139. + if [ $? != 0 ] ; then break; fi
  140. + SARGS=`echo $i|sed -ne 's/--server--\s*/-s -P /p'`;
  141. + if [ -n "$SARGS" ];
  142. + then
  143. + echo "Starting vtund server."
  144. + start-stop-daemon -S -x $DAEMON -- $SARGS;
  145. + else
  146. + # split args into host and rest
  147. + HOST=`echo $i|cut -f 1 -d " "`;
  148. + TARGET=`echo $i|cut -f 2 -d " "`;
  149. + echo "Starting vtund client $HOST to $TARGET.";
  150. + start-stop-daemon -S -x $DAEMON -- $i;
  151. + fi
  152. + done
  153. + ;;
  154. + stop)
  155. + echo "Stopping vtund.";
  156. + start-stop-daemon -K -x vtund;
  157. + ;;
  158. +
  159. + restart|reload|force-reload)
  160. + $0 stop
  161. + sleep 1;
  162. + $0 start
  163. + ;;
  164. + *)
  165. + echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
  166. + exit 1
  167. + ;;
  168. +esac
  169. +exit 0
  170. --- vtun-2.6/configure.dist 2004-03-11 10:39:10.000000000 -0600
  171. +++ vtun-2.6/configure 2004-03-11 10:45:52.000000000 -0600
  172. @@ -2112,7 +2112,7 @@
  173. echo $ac_n "checking "for blowfish.h"""... $ac_c" 1>&6
  174. echo "configure:2114: checking "for blowfish.h"" >&5
  175. ac_hdr_found=no
  176. - for p in $BLOWFISH_HDR_DIR /usr/include/ssl /usr/include/openssl /usr/include /usr/local/include /usr/local/ssl/include /usr/include/crypto; do
  177. + for p in $BLOWFISH_HDR_DIR $SSL_HDR_DIR /usr/include/ssl /usr/include/openssl /usr/include /usr/local/include /usr/local/ssl/include /usr/include/crypto; do
  178. if test -n "$p"; then
  179. dir="$p"
  180. else