Changeset 30264


Ignore:
Timestamp:
2012-02-05T17:14:00+01:00 (6 years ago)
Author:
jow
Message:

[packages_10.03.2] sslh: merge r27624, r27625, r28331, r28338, r29091, r29428, r29429

Location:
branches/packages_10.03.2/net/sslh
Files:
1 deleted
3 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/packages_10.03.2/net/sslh/Makefile

    r19506 r30264  
    11#  
    2 # Copyright (C) 2009-2010 OpenWrt.org 
     2# Copyright (C) 2009-2011 OpenWrt.org 
    33# 
    44# This is free software, licensed under the GNU General Public License v2. 
     
    99 
    1010PKG_NAME:=sslh 
    11 PKG_VERSION:=1.7a 
     11PKG_VERSION:=1.10 
    1212PKG_RELEASE:=1 
    1313 
    1414PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 
    1515PKG_SOURCE_URL:=http://rutschle.net/tech/ 
    16 PKG_MD5SUM:=ee124654412198a5e11fe28acf10634d 
     16PKG_MD5SUM:=bc34e9a4770d634633e70589c72708cc 
    1717 
    1818include $(INCLUDE_DIR)/package.mk 
     
    2121  SECTION:=net 
    2222  CATEGORY:=Network 
     23  SUBMENU:=Routing and Redirection 
    2324  TITLE:=SSL/SSH multiplexer 
    2425  URL:=http://rutschle.net/tech/sslh.shtml 
     26  MAINTAINER:=Matthias Buecher <mail@maddes.net> 
     27endef 
     28 
     29define Package/sslh/conffiles 
     30/etc/config/sslh 
    2531endef 
    2632 
     
    3541define Package/sslh/install 
    3642        $(INSTALL_DIR) $(1)/usr/sbin 
    37         $(INSTALL_BIN) $(PKG_BUILD_DIR)/sslh $(1)/usr/sbin/ 
     43        $(INSTALL_BIN) $(PKG_BUILD_DIR)/sslh-fork $(1)/usr/sbin/sslh 
    3844        $(INSTALL_DIR) $(1)/etc/init.d/ 
    3945        $(INSTALL_BIN) files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME) 
  • branches/packages_10.03.2/net/sslh/files/sslh.config

    r16851 r30264  
    55        option 'enable' '1' 
    66        # listen defaults to '0.0.0.0:443' (all interfaces) 
     7        # multiple -p arguments may be supplied using a uci list 
    78        # -p <listenaddr>:<listenport> 
    89        option 'listen' '' 
    910        # ssh defaults to 'localhost:22' 
    10         # -s <sshhost>:<sshport> 
     11        # --ssh <sshhost>:<sshport> 
    1112        option 'ssh' '' 
    12         # ssl defaults to 'localhost:442' 
    13         # -l <sslhost>:<sslport> 
     13        # ssl defaults to 'localhost:443' 
     14        # --ssl <sslhost>:<sslport> 
    1415        option 'ssl' '' 
     16        # openvpn defaults to 'localhost:1194' 
     17        # --openvpn <openvpnhost>:<openvpnport> 
     18        option 'openvpn' '' 
     19        # tinc defaults to 'localhost:655' 
     20        # --tinc <tinchost>:<tincport> 
     21        option 'tinc' '' 
     22        # xmpp defaults to 'localhost:5222' 
     23        # --xmpp <xmpphost>:<xmppport> 
     24        option 'xmpp' '' 
    1525        # timeout (for ssh, then ssl is assumed) defaults to 2 
    1626        # -t 
  • branches/packages_10.03.2/net/sslh/files/sslh.init

    r19506 r30264  
    11#!/bin/sh /etc/rc.common 
    2 # Copyright (C) 2009-2010 OpenWrt.org 
     2# Copyright (C) 2009-2011 OpenWrt.org 
    33 
    4 NAME=sslh 
    5 PROG=/usr/sbin/sslh 
    64START=95 
    7 PIDCOUNT=0 
    8 EXTRA_COMMANDS="killclients" 
    9 EXTRA_HELP="    killclients Kill ${NAME} processes except servers and yourself" 
    105 
    11 sslh_start() 
    12 { 
     6# XXX: pid-files are useless because sslh forks after creating them 
     7SERVICE_USE_PID= 
     8 
     9start_instance() { 
    1310        local section="$1" 
    1411 
    1512        # check if section is enabled (default) 
    1613        local enabled 
    17         config_get_bool enabled "${section}" enable 1 
    18         [ "${enabled}" -eq 0 ] && return 1 
     14        config_get_bool enabled "${section}" 'enabled' '0' 
     15        [ ${enabled} -gt 0 ] || return 1 
    1916 
    20         # increase pid file count to handle multiple instances correctly 
    21         PIDCOUNT="$(( ${PIDCOUNT} + 1 ))" 
    22  
    23         # prepare parameters (initialise with pid file) 
    24         local args="-P /var/run/${NAME}.${PIDCOUNT}.pid" 
     17        local args="" 
    2518        local val 
    2619        # A) listen parameter 
    27         config_get val "${section}" listen 
    28         [ -n "${val}" ] && append args "-p ${val}" 
     20        config_get vals "${section}" listen 
     21        [ -n "${vals}" ] && for val in $vals; do append args "-p ${val}"; done 
    2922        # B) ssh parameter 
    3023        config_get val "${section}" ssh 
    31         [ -n "${val}" ] && append args "-s ${val}" 
     24        [ -n "${val}" ] && append args "--ssh ${val}" 
    3225        # C) ssl parameter 
    3326        config_get val "${section}" ssl 
    34         [ -n "${val}" ] && append args "-l ${val}" 
    35         # D) timeout (for ssh, then ssl is assumed) 
     27        [ -n "${val}" ] && append args "--ssl ${val}" 
     28        # D) openvpn parameter 
     29        config_get val "${section}" openvpn 
     30        [ -n "${val}" ] && append args "--openvpn ${val}" 
     31        # E) tinc parameter 
     32        config_get val "${section}" tinc 
     33        [ -n "${val}" ] && append args "--tinc ${val}" 
     34        # F) xmpp parameter 
     35        config_get val "${section}" xmpp 
     36        [ -n "${val}" ] && append args "--xmpp ${val}" 
     37        # G) timeout (before a connection is considered to be SSH) 
    3638        config_get val "${section}" timeout 
    3739        [ -n "${val}" ] && append args "-t ${val}" 
    38         # E) verbose parameter 
     40        # H) verbose parameter 
    3941        local verbosed 
    4042        config_get_bool verbosed "${section}" verbose 0 
    4143        [ "${verbosed}" -ne 0 ] && append args "-v" 
    4244 
    43         # execute program and return its exit code 
    44         [ "${verbosed}" -ne 0 ] && echo "${initscript}: section ${section} started via ${PROG} ${args}" 
    45         ${PROG} ${args} 
    46         return $? 
     45        # XXX: allow more that one instance to run simultaneously 
     46        SERVICE_MATCH_NAME=1 SERVICE_NAME="sslh-dummy-$$" \ 
     47        service_start /usr/sbin/sslh ${args} 
    4748} 
    4849 
    49 start() 
    50 { 
    51         config_load "${NAME}" 
    52         config_foreach sslh_start sslh 
     50start() { 
     51        config_load 'sslh' 
     52        config_foreach start_instance 'sslh' 
    5353} 
    5454 
    55 stop() 
    56 { 
    57         local pidfile 
    58         local rc=0 
    59  
    60         # killing all server processes 
    61         for pidfile in `ls /var/run/${NAME}.*.pid` 
    62          do 
    63                 start-stop-daemon -q -K -s KILL -p "${pidfile}" -n "${NAME}" 
    64                 [ $? -ne 0 ] && rc=1 
    65                 rm -f "${pidfile}" 
    66         done 
    67         [ -z "${pidfile}" ] && echo "${initscript}: no pid files, if you get problems with start then try killclients" 
    68         [ ${rc} -ne 0 ] && echo "${initscript}: inconsistency in pid files, if you get problems with start then try killclients" 
     55stop() { 
     56        service_stop /usr/sbin/sslh 
    6957} 
    70  
    71 killclients() 
    72 { 
    73         local ignore='' 
    74         local server 
    75         local pid 
    76         local connection 
    77         local proto 
    78         local address 
    79  
    80         # if this script is run from inside a client session, then ignore that session 
    81         pid="$$" 
    82         while [ "${pid}" -ne 0 ] 
    83          do 
    84                 # get parent process id 
    85                 pid=`cut -d ' ' -f 4 "/proc/${pid}/stat"` 
    86                 [ "${pid}" -eq 0 ] && break 
    87  
    88                 # check if pid is connected to a client connection 
    89                 # a) get established connection for pid 
    90                 connection=`netstat -tupn 2>/dev/null | sed "s/[ ]\+/ /g" | grep -e "ESTABLISHED ${pid}/"` 
    91                 [ -z "${connection}" ] && continue 
    92                 #    get connection details for foreign address 
    93                 proto=`echo ${connection} | cut -d ' ' -f 1` 
    94                 address=`echo ${connection} | cut -d ' ' -f 5` 
    95  
    96                 # b) get pid for foreign address, only possible if foreign address is from this machine itself 
    97                 connection=`netstat -tupn 2>/dev/null | sed "s/[ ]\+/ /g" | grep -e "^${proto}.*${address}.*ESTABLISHED.*/${NAME}"` 
    98                 [ -z "${connection}" ] && continue 
    99                 #    check that the local address (field 4) corresponds to the foreign address of the previous connection 
    100                 server=`echo ${connection} | cut -d ' ' -f 4` 
    101                 [ "${server}" != "${address}" ] && continue 
    102                 #    get pid from connection 
    103                 server=`echo ${connection} | cut -d ' ' -f 7 | cut -d '/' -f 1` 
    104  
    105                 # check if client connection 
    106                 grep -F -q -e "${PROG}" "/proc/${server}/cmdline" && { 
    107                         append ignore "${server}" 
    108                         break 
    109                 } 
    110         done 
    111  
    112         # get all server pids that should be ignored 
    113         for server in `cat /var/run/${NAME}.*.pid` 
    114          do 
    115                 append ignore "${server}" 
    116         done 
    117  
    118         # get all running pids and kill client connections 
    119         local skip 
    120         for pid in `pidof "${NAME}"` 
    121          do 
    122                 # check if correct program, otherwise process next pid 
    123                 grep -F -q -e "${PROG}" "/proc/${pid}/cmdline" || { 
    124                         continue 
    125                 } 
    126  
    127                 # check if pid should be ignored (servers, ourself) 
    128                 skip=0 
    129                 for server in ${ignore} 
    130                  do 
    131                         if [ "${pid}" == "${server}" ] 
    132                          then 
    133                                 skip=1 
    134                                 break 
    135                         fi 
    136                 done 
    137                 [ "${skip}" -ne 0 ] && continue 
    138  
    139                 # kill process 
    140                 echo "${initscript}: Killing ${pid}..." 
    141                 kill -KILL ${pid} 
    142         done 
    143 } 
  • branches/packages_10.03.2/net/sslh/patches/001-no_sslh_select.patch

    r28331 r30264  
    11--- a/Makefile 
    22+++ b/Makefile 
    3 @@ -27,16 +27,12 @@ 
     3@@ -32,16 +32,12 @@ all: sslh $(MAN) echosrv 
    44        $(CC) $(CFLAGS) -D'VERSION=$(VERSION)' -c $< 
    55  
     
    1010 sslh-fork: $(OBJS) sslh-fork.o Makefile common.h 
    1111        $(CC) $(CFLAGS) -D'VERSION=$(VERSION)' -o sslh-fork sslh-fork.o $(OBJS) $(LIBS) 
    12         strip sslh-fork 
     12        #strip sslh-fork 
    1313  
    1414-sslh-select: $(OBJS) sslh-select.o Makefile common.h  
    1515-       $(CC) $(CFLAGS) -D'VERSION=$(VERSION)' -o sslh-select sslh-select.o $(OBJS) $(LIBS) 
    16 -       strip sslh-select 
     16-       #strip sslh-select 
    1717- 
     18 echosrv: $(OBJS) echosrv.o 
     19        $(CC) $(CFLAGS) -o echosrv echosrv.o common.o $(LIBS) 
    1820  
    19  $(MAN): sslh.pod Makefile 
    20         pod2man --section=8 --release=$(VERSION) --center=" " sslh.pod | gzip -9 - > $(MAN) 
    21 @@ -58,7 +54,7 @@ 
     21@@ -65,7 +61,7 @@ uninstall: 
    2222        update-rc.d sslh remove 
    2323  
    2424 clean: 
    25 -       rm -f sslh-fork sslh-select $(MAN) *.o 
    26 +       rm -f sslh-fork $(MAN) *.o 
     25-       rm -f sslh-fork sslh-select echosrv $(MAN) *.o *.gcov *.gcno *.gcda *.png *.html *.css *.info  
     26+       rm -f sslh-fork echosrv $(MAN) *.o *.gcov *.gcno *.gcda *.png *.html *.css *.info  
    2727  
    2828 tags: 
Note: See TracChangeset for help on using the changeset viewer.