Compare commits

..

9 commits

Author SHA1 Message Date
Gabriel L. Somlo
1aa46b803d patch to fix RHBZ 1319858, 1319861 2016-03-21 17:41:21 -04:00
Gabriel L. Somlo
14ccb2a61b enhanced service file (don't daemonize vtund) 2014-11-20 17:16:17 -05:00
Gabriel L. Somlo
d9d88a92e1 added /etc/sysconfig/vtun environment file; updated unit files 2014-11-15 23:30:11 -05:00
Gabriel L. Somlo
6a7f150c7a rebuild with PIE (#955286) 2013-05-01 21:34:18 -04:00
Gabriel L. Somlo
9b6e8e8fc1 add support for systemd (#661331) 2011-01-06 16:25:51 -05:00
Gabriel L. Somlo
db92f70dbf add support for systemd (#661331) 2011-01-06 16:19:09 -05:00
Fedora Release Engineering
3c0902311c dist-git conversion 2010-07-29 15:10:26 +00:00
Dennis Gilmore
88cba9f252 Initialize branch EL-6 for vtun 2010-05-08 02:27:52 +00:00
Bill Nottingham
e1d159662b Fix typo that causes a failure to update the common directory. (releng
#2781)
2009-11-26 01:16:10 +00:00
6 changed files with 231 additions and 1 deletions

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
vtun-3.0.1.tar.gz
/vtun-3.0.1.tar.gz
/vtun-3.0.3.tar.gz

View file

@ -1 +0,0 @@
Orphaned for 6+ weeks

1
sources Normal file
View file

@ -0,0 +1 @@
c342ffe77055d4248a38f0b380f28c1b vtun-3.0.1.tar.gz

33
vtun-client-sighup.patch Normal file
View file

@ -0,0 +1,33 @@
When sending a SIGHUP to a vtun client process which is unable to connect
to the remote server, it will attempt to reconnect without sleeping between
consecutive attempts. This results in a CPU usage spike, and a flood of
data sent to syslog.
This patch causes the first sleep after SIGHUP to be discarded, then allows
sleep to be used again in subsequent iterations.
diff -NarU5 a/client.c b/client.c
--- a/client.c 2006-12-11 02:55:06.000000000 -0500
+++ b/client.c 2016-03-21 14:41:09.014377581 -0400
@@ -129,10 +129,11 @@
vtun_syslog(LOG_INFO,"Connecting to %s", vtun.svr_name);
if( connect_t(s,(struct sockaddr *) &svr_addr, host->timeout) ){
vtun_syslog(LOG_INFO,"Connect to %s failed. %s(%d)", vtun.svr_name,
strerror(errno), errno);
+ client_term = 0;
} else {
if( auth_client(s, host) ){
vtun_syslog(LOG_INFO,"Session %s[%s] opened",host->host,vtun.svr_name);
host->rmt_fd = s;
@@ -141,10 +142,11 @@
client_term = tunnel(host);
vtun_syslog(LOG_INFO,"Session %s[%s] closed",host->host,vtun.svr_name);
} else {
vtun_syslog(LOG_INFO,"Connection denied by %s",vtun.svr_name);
+ client_term = 0;
}
}
close(s);
free_sopt(&host->sopt);
}

84
vtun.spec Normal file
View file

@ -0,0 +1,84 @@
Name: vtun
Version: 3.0.1
Release: 10%{?dist}
Summary: Virtual tunnel over TCP/IP networks
License: GPLv2+
Group: System Environment/Daemons
Url: http://vtun.sourceforge.net
Source0: http://prdownloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
Source1: vtund.init
Patch0: vtun-client-sighup.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: xinetd
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/service /sbin/chkconfig
Requires(postun): /sbin/service
BuildRequires: zlib-devel lzo-devel openssl-devel bison flex
%description
VTun provides a method for creating Virtual Tunnels over TCP/IP networks
and allows one to shape, compress, and encrypt traffic in those tunnels.
Supported types of tunnels are: PPP, IP, Ethernet and most other serial
protocols and programs.
VTun is easily and highly configurable: it can be used for various
network tasks like VPN, Mobile IP, Shaped Internet access, IP address
saving, etc. It is completely a user space implementation and does not
require modification to any kernel parts.
%prep
%setup -q
%patch0 -p1
%build
%configure
%{__make} %{?_smp_mflags}
%install
%{__rm} -rf %{buildroot}
%{__install} -D -m 0755 -p %{SOURCE1} %{buildroot}/%{_initrddir}/vtund
%{__install} -D -m 0644 -p scripts/vtund.xinetd %{buildroot}/%{_sysconfdir}/xinetd.d/vtun
%{__sed} -i 's:/usr/local:%{_prefix}:' %{buildroot}/%{_sysconfdir}/xinetd.d/vtun
%{__make} install DESTDIR=%{buildroot} INSTALL_OWNER= INSTALL="/usr/bin/install -p"
%clean
%{__rm} -rf %{buildroot}
%post
if [ $1 -eq 1 ]; then
/sbin/chkconfig --add vtund || :
fi
%preun
if [ $1 -eq 0 ]; then
/sbin/service vtund stop >/dev/null 2>&1 || :
/sbin/chkconfig --del vtund || :
fi
%postun
if [ $1 -eq 1 ]; then
/sbin/service vtund condrestart >/dev/null 2>&1 || :
fi
%files
%defattr(-,root,root,-)
%doc ChangeLog Credits FAQ README README.LZO README.Setup README.Shaper TODO vtund.conf
%config(noreplace) %{_sysconfdir}/vtund.conf
%config(noreplace) %{_sysconfdir}/xinetd.d/vtun
%{_initrddir}/vtund
%{_sbindir}/vtund
%dir %{_localstatedir}/log/vtund
%dir %{_localstatedir}/lock/vtund
%{_mandir}/man5/vtund.conf.5*
%{_mandir}/man8/vtun.8*
%{_mandir}/man8/vtund.8*
%changelog
* Mon Mar 21 2016 Gabriel Somlo <somlo at cmu.edu> 3.0.1-10
- patch to fix RHBZ 1319858, 1319860
- bump release past (el6 & Fedora specific) attempts to add systemd support
* Mon Nov 17 2008 Gabriel Somlo <somlo at cmu.edu> 3.0.1-3
- scriptlets fixes
* Fri Nov 14 2008 Gabriel Somlo <somlo at cmu.edu> 3.0.1-2
- spec file fixes: defattr, -p flag to install program
* Mon Oct 20 2008 Gabriel Somlo <somlo at cmu.edu> 3.0.1-1
- initial fedora package

110
vtund.init Normal file
View file

@ -0,0 +1,110 @@
#!/bin/sh
#
# vtund Startup script for the virtual tunnel daemon
#
# chkconfig: - 55 45
# description: Virtual Tunnel Daemon provides the facility to create \
# virtual tunnels over TCP/IP networks and allows for \
# shaping, compression, and encryption of tunneled traffic.
### BEGIN INIT INFO
# Provides:
# Required-Start:
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start:
# Default-Stop:
# Short-Description:
# Description:
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
exec="/usr/sbin/vtund"
prog="vtund"
config="/etc/vtund.conf"
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
lockfile=/var/lock/subsys/$prog
start() {
[ -x $exec ] || exit 5
[ -f $config ] || exit 6
echo -n $"Starting $prog: "
daemon $exec -s
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $prog: "
killproc $prog
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
stop
start
}
reload() {
echo -n $"Reloading config for $prog: "
killproc $prog -HUP
retval=$?
echo
return $retval
}
force_reload() {
restart
}
rh_status() {
# run checks to determine if the service is running or use generic status
status $prog
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
esac
exit $?