diff options
author | Gianluca Boiano | 2019-02-25 14:24:05 +0100 |
---|---|---|
committer | Gianluca Boiano | 2019-02-25 14:24:05 +0100 |
commit | 8397a7045977c74f44f11027afcbe5c434315aa5 (patch) | |
tree | 327e5380270e4ee839bc92510eb03722a9d8b350 | |
parent | b8e524a5c363e528d434f310af412e9d1fefcf9a (diff) | |
download | aur-8397a7045977c74f44f11027afcbe5c434315aa5.tar.gz |
coova-chilli-arch: 1.4
-rw-r--r-- | .SRCINFO | 12 | ||||
-rw-r--r-- | 4149a5ddfcc666ebbca3fcc9da308e7ff9e433b7.patch | 916 | ||||
-rw-r--r-- | PKGBUILD | 45 | ||||
-rw-r--r-- | makefile.am.patch | 11 |
4 files changed, 963 insertions, 21 deletions
@@ -1,8 +1,6 @@ -# Generated by mksrcinfo v8 -# Sat Nov 18 19:09:40 UTC 2017 pkgbase = coova-chilli-arch pkgdesc = An open-source software access controller - pkgver = 1.3.2 + pkgver = 1.4 pkgrel = 1 url = https://coova.github.io/ install = chilli.install @@ -17,10 +15,14 @@ pkgbase = coova-chilli-arch replaces = coova-chilli options = !libtool backup = etc/chilli.conf - source = https://github.com/coova/coova-chilli/archive/1.3.2.tar.gz + source = https://github.com/coova/coova-chilli/archive/1.4.tar.gz source = chilli.service - md5sums = 26e02689f632ad27ad599bc0d9f5ae3d + source = 4149a5ddfcc666ebbca3fcc9da308e7ff9e433b7.patch + source = makefile.am.patch + md5sums = c322fb0c0d575993acdfb8bdbe1cc022 md5sums = 828147e21eac257c3b700ea7f4ca3d98 + md5sums = a185897520cdde94be784f336dd67bcc + md5sums = 986482eb732530c30cdc9e7987a53ad4 pkgname = coova-chilli-arch diff --git a/4149a5ddfcc666ebbca3fcc9da308e7ff9e433b7.patch b/4149a5ddfcc666ebbca3fcc9da308e7ff9e433b7.patch new file mode 100644 index 000000000000..712be4cbd3c5 --- /dev/null +++ b/4149a5ddfcc666ebbca3fcc9da308e7ff9e433b7.patch @@ -0,0 +1,916 @@ +diff --git a/.travis.yml b/.travis.yml +index 9951ab0..c314910 100644 +--- a/.travis.yml ++++ b/.travis.yml +@@ -6,10 +6,10 @@ before_install: + script: + - ./configure --enable-largelimits --enable-proxyvsa --enable-miniportal + --enable-chilliredir --enable-chilliproxy --enable-binstatusfile +- --enable-chilliscript --enable-chilliradsec --enable-dnslog --enable-layer3 ++ --enable-chilliscript --enable-chilliradsec --with-avl --enable-layer3 + --enable-eapol --enable-uamdomainfile --enable-redirdnsreq --enable-modules + --enable-multiroute --enable-extadmvsa --with-openssl --with-poll +- --enable-json --enable-libjson --with-avl ++ --enable-json --enable-libjson + - make + compiler: + - clang +diff --git a/conf/chilli.in b/conf/chilli.in +index 2462ba3..fea6dfe 100644 +--- a/conf/chilli.in ++++ b/conf/chilli.in +@@ -61,9 +61,9 @@ start() { + echo "*/$HS_ADMINTERVAL * * * * $0 radconfig") | crontab - 2>&- + } + +- test ${HS_LANIF_KEEPADDR:-0} -eq 0 && ifconfig $HS_LANIF 0.0.0.0 ++ test ${HS_LANIF_KEEPADDR:-0} -eq 0 && ip address add 0.0.0.0 dev $HS_LANIF + +- daemon $exec -c $CONFIG ++ daemon -- $exec -c $CONFIG + retval=$? + echo + [ $retval -eq 0 ] && touch $lockfile +diff --git a/conf/functions.in b/conf/functions.in +index 2a81474..58ce43b 100644 +--- a/conf/functions.in ++++ b/conf/functions.in +@@ -54,7 +54,11 @@ HS_WISPRLOGIN=${HS_WISPRLOGIN:-$HS_UAMSERVICE} + HS_PAP_OK=${HS_PAP_OK:-on} + HS_DNS1=${HS_DNS1:-$HS_DNS} + HS_DNS1=${HS_DNS1:-$(grep '^nameserver' /etc/resolv.conf | head -n1 | awk '{print $2}')} ++if [ $(uname) = "Linux" ]; then + HS_WANIF=${HS_WANIF:-$(route -n|grep '^0.0.0.0'|head -n1|awk '{print $8}')} ++else ++HS_WANIF=${HS_WANIF:-$(route get default | grep interface | awk '{print $2}')} ++fi + + bailout() { echo $1; exit; } + +@@ -125,7 +129,13 @@ writeconfig() { + addconfig1 ${HS_GID:+"gid \"$HS_GID\""} + + [ -n "$HS_DHCPGATEWAY" ] && { +- HS_DHCPRELAYAGENT=${HS_DHCPRELAYAGENT:-$(ifconfig $(route -n|grep '^0.0.0.0'|awk '{ print $8 }')|grep 'inet addr:'|cut -d: -f 2|cut -d' ' -f1)} ++ if [ $(uname) = "Linux" ]; then ++ HS_DHCPRELAYAGENT=${HS_DHCPRELAYAGENT:-$(ifconfig $(route -n|grep '^0.0.0.0'| \ ++ awk '{ print $8 }')|grep 'inet addr:'|cut -d: -f 2|cut -d' ' -f1)} ++ else ++ HS_DHCPRELAYAGENT=${HS_DHCPRELAYAGENT:-$(ifconfig $(netstat -rn | grep 'default' | \ ++ head -n1 | awk '{print$7}') | grep 'inet ' | cut -d/ -f 1 | cut -d' ' -f2)} ++ fi + addconfig1 "dhcpgateway \"$HS_DHCPGATEWAY\"" + addconfig1 "dhcprelayagent \"$HS_DHCPRELAYAGENT\"" + } +@@ -317,6 +327,10 @@ files_equal() { # returns 0 for equal, 1 for not-equal + [ "$(md5sum $1 | cut -f1 -d' ')" = "$(md5sum $2 | cut -f1 -d' ')" ] && return 0; + return 1; + } ++ [ -x /usr/bin/md5 ] || [ -x /sbin/md5 ] || [ -x /bin/md5 ] && { ++ [ "$(md5 $1)" = "$(md5 $2)" ] && return 0; ++ return 1; ++ } + return 0; + } + +diff --git a/debian/changelog b/debian/changelog +index 585b3ce..c439d6a 100644 +--- a/debian/changelog ++++ b/debian/changelog +@@ -1,3 +1,9 @@ ++coova-chilli (1.4) UNRELEASED; urgency=medium ++ ++ * See ChangeLog ++ ++ -- David Bird (Coova Technologies) <support@coova.com> Tue, 03 Jan 2017 12:34:07 +0100 ++ + coova-chilli (1.3.0) unstable; urgency=low + + * See ChangeLog +diff --git a/debian/compat b/debian/compat +index 7f8f011..f599e28 100644 +--- a/debian/compat ++++ b/debian/compat +@@ -1 +1 @@ +-7 ++10 +diff --git a/debian/conffiles b/debian/conffiles +deleted file mode 100644 +index 887d58a..0000000 +--- a/debian/conffiles ++++ /dev/null +@@ -1,2 +0,0 @@ +-/etc/default/chilli +-/etc/init.d/chilli +diff --git a/debian/control b/debian/control +index d10aeda..80f7eed 100644 +--- a/debian/control ++++ b/debian/control +@@ -2,18 +2,26 @@ Source: coova-chilli + Section: net + Priority: optional + Maintainer: David Bird (Coova Technologies) <support@coova.com> +-Build-Depends: debhelper (>= 7), libc6-dev | libc6-dev-amd64, gengetopt, libtool, automake, libssl-dev +-Standards-Version: 3.8.1 ++Build-Depends: debhelper (>= 7), libc6-dev | libc6-dev-amd64, gengetopt, libtool, automake, libssl-dev, libjson-c-dev ++Standards-Version: 3.9.8 + + Package: coova-chilli + Architecture: any + Replaces: chillispot + Conflicts: chillispot + Provides: chillispot +-Depends: iptables, haserl ++Depends: ++ ${shlibs:Depends}, ++ iptables, ++ haserl, ++ adduser, ++Suggests: ++ python, ++ python-gtk2, + Description: Wireless LAN Access Point Controller (captive portal). + Coova-Chilli is an open source captive portal or wireless LAN access point + controller, forked from chillispot. It supports web based login which is +- today's standard for public HotSpots and it supports Wireless Protected Access (WPA) which +- is the standard of the future. Authentication, Authorization and Accounting (AAA) +- is handled by your favorite radius server. Read more at http://coova.github.io/ ++ today's standard for public HotSpots and it supports Wireless Protected Access ++ (WPA) which is the standard of the future. Authentication, Authorization and ++ Accounting (AAA) is handled by your favorite radius server. Read more at ++ http://coova.github.io/ +diff --git a/miniportal/config-local.sh.in b/miniportal/config-local.sh.in +index 9b92a69..622c5b6 100755 +--- a/miniportal/config-local.sh.in ++++ b/miniportal/config-local.sh.in +@@ -130,7 +130,12 @@ local_login_url() { + if [ "$HS_USELOCALUSERS" = "on" ]; then + line=$(head -1 $USERS) + if [ "$line" = "" ]; then ++ if [ -x /usr/bin/md5sum ] || [ -x /bin/md5sum ]; then + echo "tos:$(echo '$$$(date)'|md5sum|cut -f1)" >> $USERS ++ fi ++ if [ -x /usr/bin/md5 ] || [ -x /sbin/md5 ] || [ -x /bin/md5 ]; then ++ echo "tos:$(echo '$$$(date)'|md5)" >> $USERS ++ fi + line=$(head -1 $USERS) + fi + if [ "$line" != "" ]; then +@@ -237,7 +242,12 @@ then + [ "$HTTPS" = "on" ] && HTTP="https" + URL="$HTTP://$SERVER_NAME/$REQUEST_URI?$QS" + CHECK="$URL$HS_UAMSECRET" ++ if [ -x /usr/bin/md5sum ] || [ -x /bin/md5sum ]; then + CHECK_MD5=$(echo -n "$CHECK" |md5sum|cut -d' ' -f1|tr 'a-z' 'A-Z'); ++ fi ++ if [ -x /usr/bin/md5 ] || [ -x /sbin/md5 ] || [ -x /bin/md5 ]; then ++ CHECK_MD5=$(echo -n "$CHECK" |md5 |tr 'a-z' 'A-Z'); ++ fi + if [ "$CHECK_MD5" = "$FORM_md" ]; then + COOVA_USERURL=$FORM_userurl + else +diff --git a/src/chilli.c b/src/chilli.c +index 32a3051..0a7ba30 100644 +--- a/src/chilli.c ++++ b/src/chilli.c +@@ -182,19 +182,19 @@ static pid_t launch_daemon(char *name, char *path) { + #endif + + #ifdef ENABLE_CHILLIPROXY +-static void launch_chilliproxy() { ++static void launch_chilliproxy(void) { + proxy_pid = launch_daemon("[chilli_proxy]", SBINDIR "/chilli_proxy"); + } + #endif + + #ifdef ENABLE_CHILLIREDIR +-static void launch_chilliredir() { ++static void launch_chilliredir(void) { + redir_pid = launch_daemon("[chilli_redir]", SBINDIR "/chilli_redir"); + } + #endif + + #ifdef ENABLE_CHILLIRADSEC +-static void launch_chilliradsec() { ++static void launch_chilliradsec(void) { + radsec_pid = launch_daemon("[chilli_radsec]", SBINDIR "/chilli_radsec"); + } + #endif +@@ -316,19 +316,19 @@ static void _sigchld(int signum) { + syslog(LOG_DEBUG, "%s(%d): child %d terminated", __FUNCTION__, __LINE__, pid); + #endif + #ifdef ENABLE_CHILLIRADSEC +- if (!_options.debug && radsec_pid > 0 && radsec_pid == pid) { ++ if (radsec_pid > 0 && radsec_pid == pid) { + syslog(LOG_ERR, "Having to re-launch chilli_radsec... PID %d exited", pid); + launch_chilliradsec(); + } + #endif + #ifdef ENABLE_CHILLIPROXY +- if (!_options.debug && proxy_pid > 0 && proxy_pid == pid) { ++ if (proxy_pid > 0 && proxy_pid == pid) { + syslog(LOG_ERR, "Having to re-launch chilli_proxy... PID %d exited", pid); + launch_chilliproxy(); + } + #endif + #ifdef ENABLE_CHILLIREDIR +- if (!_options.debug && redir_pid > 0 && redir_pid == pid) { ++ if (redir_pid > 0 && redir_pid == pid) { + syslog(LOG_ERR, "Having to re-launch chilli_redir... PID %d exited", pid); + launch_chilliredir(); + } +@@ -455,11 +455,11 @@ time_t mainclock_towall(time_t t) { + return mainclock.tv_sec; + } + +-time_t mainclock_wall() { ++time_t mainclock_wall(void) { + return mainclock_towall(mainclock.tv_sec); + } + +-time_t mainclock_tick() { ++time_t mainclock_tick(void) { + #ifdef HAVE_LIBRT + struct timespec ts; + #if defined(CLOCK_MONOTONIC) +@@ -487,11 +487,11 @@ time_t mainclock_tick() { + return mainclock.tv_sec; + } + +-time_t mainclock_now() { ++time_t mainclock_now(void) { + return mainclock.tv_sec; + } + +-time_t mainclock_rt() { ++time_t mainclock_rt(void) { + time_t rt = 0; + #ifdef HAVE_LIBRT + struct timespec ts; +@@ -561,7 +561,7 @@ static void set_sessionid(struct app_conn_t *appconn, char full) { + + snprintf(appconn->s_state.sessionid, + sizeof(appconn->s_state.sessionid), +- "%.8lx%.8x", appconn->rt, appconn->unit); ++ "%.8lld%.8x", (long long int)appconn->rt, appconn->unit); + + appconn->s_state.redir.classlen = 0; + appconn->s_state.redir.statelen = 0; +@@ -890,7 +890,7 @@ static int newip(struct ippoolm_t **ipm, struct in_addr *hisip, uint8_t *hismac) + * A few functions to manage connections + */ + +-static int initconn() { ++static int initconn(void) { + checktime = rereadtime = mainclock.tv_sec; + return 0; + } +@@ -1183,7 +1183,7 @@ void session_interval(struct app_conn_t *conn) { + #endif + } + +-static int checkconn() { ++static int checkconn(void) { + struct app_conn_t *conn; + struct dhcp_conn_t* dhcpconn; + uint32_t checkdiff; +@@ -1232,7 +1232,7 @@ static int checkconn() { + return 0; + } + +-void chilli_freeconn() { ++void chilli_freeconn(void) { + struct app_conn_t *conn, *c; + struct dhcp_conn_t *d = NULL; + +@@ -1252,7 +1252,7 @@ void chilli_freeconn() { + } + + /* Kill all connections and send Radius Acct Stop */ +-int static killconn() { ++int static killconn(void) { + struct app_conn_t *conn; + + for (conn = firstusedconn; conn; conn = conn->next) { +@@ -7182,7 +7182,7 @@ static int rtmon_accept(struct rtmon_t *rtmon, int idx) { + } + #endif + +-static inline void macauth_reserved() { ++static inline void macauth_reserved(void) { + struct dhcp_conn_t *conn = dhcp->firstusedconn; + struct app_conn_t *appconn; + +@@ -7198,7 +7198,7 @@ static inline void macauth_reserved() { + } + + #ifdef ENABLE_LAYER3 +-static int session_timeout() { ++static int session_timeout(void) { + struct app_conn_t *conn = firstusedconn; + + while (conn) { +@@ -7413,13 +7413,15 @@ int chilli_main(int argc, char **argv) { + syslog(LOG_ERR, "%s: getting startup (realtime) time", strerror(errno)); + } + if (_options.debug) +- syslog(LOG_DEBUG, "%s(%d): clock realtime sec %ld nsec %ld", __FUNCTION__, __LINE__, startup_real.tv_sec, startup_real.tv_nsec); ++ syslog(LOG_DEBUG, "%s(%d): clock realtime sec %lld nsec %ld", __FUNCTION__, __LINE__, ++ (long long int)startup_real.tv_sec, startup_real.tv_nsec); + #ifdef CLOCK_MONOTONIC + if (clock_gettime(CLOCK_MONOTONIC, &startup_mono) < 0) { + syslog(LOG_ERR, "%s: getting startup (monotonic) time", strerror(errno)); + } + if (_options.debug) +- syslog(LOG_DEBUG, "%s(%d): clock monotonic sec %ld nsec %ld", __FUNCTION__, __LINE__, startup_mono.tv_sec, startup_mono.tv_nsec); ++ syslog(LOG_DEBUG, "%s(%d): clock monotonic sec %lld nsec %ld", __FUNCTION__, __LINE__, ++ (long long int)startup_mono.tv_sec, startup_mono.tv_nsec); + #endif + #endif + +diff --git a/src/chilli.h b/src/chilli.h +index d80ac30..1c26b6c 100644 +--- a/src/chilli.h ++++ b/src/chilli.h +@@ -202,8 +202,8 @@ struct chilli_peer { + #endif + + #ifdef ENABLE_STATFILE +-int printstatus(); +-int loadstatus(); ++int printstatus(void); ++int loadstatus(void); + #endif + + int chilli_connect(struct app_conn_t **appconn, struct dhcp_conn_t *conn); +@@ -262,16 +262,16 @@ int dnprot_reject(struct app_conn_t *appconn); + + int get_urlparts(char *src, char *host, int hostsize, int *port, int *uripos); + +-int cmdsock_init(); ++int cmdsock_init(void); + +-int cmdsock_port_init(); ++int cmdsock_port_init(void); + + void cmdsock_shutdown(); + +-time_t mainclock_tick(); +-time_t mainclock_now(); +-time_t mainclock_rt(); +-time_t mainclock_wall(); ++time_t mainclock_tick(void); ++time_t mainclock_now(void); ++time_t mainclock_rt(void); ++time_t mainclock_wall(void); + time_t mainclock_towall(time_t t); + int mainclock_diff(time_t past); + uint32_t mainclock_diffu(time_t past); +@@ -296,8 +296,8 @@ int chilli_learn_location(uint8_t *loc, int loclen, + #ifdef HAVE_NETFILTER_COOVA + int kmod_coova_update(struct app_conn_t *appconn); + int kmod_coova_release(struct dhcp_conn_t *conn); +-int kmod_coova_sync(); +-int kmod_coova_clear(); ++int kmod_coova_sync(void); ++int kmod_coova_clear(void); + #endif + + #ifdef HAVE_OPENSSL +@@ -325,7 +325,7 @@ uint8_t* chilli_called_station(struct session_state *state); + int chilli_cmd(struct cmdsock_request *req, bstring s, int sock); + + int chilli_handle_signal(void *ctx, int fd); +-void chilli_freeconn(); ++void chilli_freeconn(void); + + int runscript(struct app_conn_t *appconn, char* script, + char *loc, char *oloc); +@@ -349,10 +349,10 @@ int selfpipe_init (void); + int selfpipe_read (void); + int selfpipe_trap (int signo); + int selfpipe_ignore (int signo); +-void selfpipe_finish(); ++void selfpipe_finish(void); + + #ifdef ENABLE_LOCATION +-void location_init(); ++void location_init(void); + #ifdef HAVE_AVL + + struct loc_search_t { +diff --git a/src/cmdsock.c b/src/cmdsock.c +index 3565b32..8782cf1 100644 +--- a/src/cmdsock.c ++++ b/src/cmdsock.c +@@ -20,7 +20,7 @@ + #include "chilli.h" + + int +-cmdsock_init() { ++cmdsock_init(void) { + struct sockaddr_un local; + int cmdsock; + +@@ -61,7 +61,7 @@ cmdsock_init() { + + + int +-cmdsock_port_init() { ++cmdsock_port_init(void) { + struct sockaddr_in local; + int cmdsock; + int rc; +diff --git a/src/dhcp.c b/src/dhcp.c +index 395998a..544f396 100644 +--- a/src/dhcp.c ++++ b/src/dhcp.c +@@ -1234,10 +1234,6 @@ int dhcp_new(struct dhcp_t **pdhcp, int numconn, int hashsize, + return 0; + } + +-int dhcp_reopen() { +- return 0; +-} +- + int dhcp_reserve_ip(uint8_t *mac, struct in_addr *ip) { + struct dhcp_conn_t *conn = 0; + +diff --git a/src/garden.c b/src/garden.c +index 3a56164..de1a2ce 100644 +--- a/src/garden.c ++++ b/src/garden.c +@@ -74,13 +74,14 @@ int garden_print_appconn(struct app_conn_t *appconn, void *d) { + inet_ntoa(appconn->hisip), + appconn->s_params.pass_through_count, + SESSION_PASS_THROUGH_MAX); +- if (!safe_write(fd, line, strlen(line))) /* error */; ++ if (!safe_write(fd, line, strlen(line))) /* error */ ++ ; + #ifdef HAVE_PATRICIA + if (appconn->ptree) { + patricia_process(appconn->ptree, cb); + } else + #endif +- garden_print_list(fd, ++ garden_print_list(fd, + appconn->s_params.pass_throughs, + appconn->s_params.pass_through_count); + } +@@ -136,7 +137,8 @@ void garden_print(int fd) { + "authed garden (%d/%d):\n", + _options.num_authed_pass_throughs, + MAX_PASS_THROUGHS); +- if (!safe_write(fd, line, strlen(line))) /* error */; ++ if (!safe_write(fd, line, strlen(line))) /* error */ ++ ; + + #ifdef HAVE_PATRICIA + if (dhcp->ptree_authed) { +@@ -320,7 +322,7 @@ void garden_patricia_load_list(patricia_tree_t **pptree, + garden_patricia_add(&ptlist[i], ptree); + } + +-void garden_patricia_reload() { ++void garden_patricia_reload(void) { + if (_options.patricia) { + garden_patricia_load_list(&dhcp->ptree, + _options.pass_throughs, +@@ -649,7 +651,7 @@ typedef struct uamdomain_regex_t { + + static uamdomain_regex * _list_head = 0; + +-void garden_free_domainfile() { ++void garden_free_domainfile(void) { + while (_list_head) { + uamdomain_regex * n = _list_head; + _list_head = _list_head->next; +@@ -658,7 +660,7 @@ void garden_free_domainfile() { + } + } + +-void garden_load_domainfile() { ++void garden_load_domainfile(void) { + garden_free_domainfile(); + if (!_options.uamdomainfile) return; + else { +diff --git a/src/garden.h b/src/garden.h +index 1b07a23..2fc2a94 100644 +--- a/src/garden.h ++++ b/src/garden.h +@@ -102,12 +102,12 @@ int garden_patricia_check(patricia_tree_t *ptree, + void garden_patricia_load_list(patricia_tree_t **pptree, + pass_through *ptlist, + uint32_t ptcnt); +-void garden_patricia_reload(); ++void garden_patricia_reload(void); + #endif + + #ifdef ENABLE_UAMDOMAINFILE +-void garden_load_domainfile(); +-void garden_free_domainfile(); ++void garden_load_domainfile(void); ++void garden_free_domainfile(void); + int garden_check_domainfile(char *question); + #endif + +diff --git a/src/kcoova.c b/src/kcoova.c +index ddcb04e..faa53f6 100644 +--- a/src/kcoova.c ++++ b/src/kcoova.c +@@ -58,12 +58,12 @@ kmod_coova_release(struct dhcp_conn_t *conn) { + } + + int +-kmod_coova_clear() { ++kmod_coova_clear(void) { + return kmod('/', 0); + } + + int +-kmod_coova_sync() { ++kmod_coova_sync(void) { + char file[128]; + char * line = 0; + size_t len = 0; +diff --git a/src/location.c b/src/location.c +index 45542d1..ffc78cb 100644 +--- a/src/location.c ++++ b/src/location.c +@@ -509,7 +509,7 @@ void location_printlist(bstring s, char *loc, int json, int list) { + + #endif + +-void location_init() { ++void location_init(void) { + #ifdef HAVE_AVL + struct app_conn_t *conn = firstusedconn; + memset(&loc_search_tree, 0, sizeof(loc_search_tree)); +diff --git a/src/main-proxy.c b/src/main-proxy.c +index 4e97a64..2f720f7 100644 +--- a/src/main-proxy.c ++++ b/src/main-proxy.c +@@ -87,7 +87,7 @@ static int still_running = 0; + + static char nas_hwaddr[PKT_ETH_ALEN]; + +-static void print_requests() { ++static void print_requests(void) { + proxy_request * req = 0; + int i; + +diff --git a/src/ms_chap.c b/src/ms_chap.c +index 2c236d2..8ad8327 100644 +--- a/src/ms_chap.c ++++ b/src/ms_chap.c +@@ -96,18 +96,18 @@ MakeKey(u_char *key, u_char *des_key) + des_key[6] = Get7Bits(key, 42); + des_key[7] = Get7Bits(key, 49); + +- des_set_odd_parity((des_cblock *)des_key); ++ DES_set_odd_parity((DES_cblock *)des_key); + } + + static void /* IN 8 octets IN 7 octest OUT 8 octets */ + DesEncrypt(u_char *clear, u_char *key, u_char *cipher) + { +- des_cblock des_key; +- des_key_schedule key_schedule; ++ DES_cblock des_key; ++ DES_key_schedule key_schedule; + + MakeKey(key, des_key); +- des_set_key(&des_key, key_schedule); +- des_ecb_encrypt((des_cblock *)clear, (des_cblock *)cipher, key_schedule, 1); ++ DES_set_key(&des_key, &key_schedule); ++ DES_ecb_encrypt((DES_cblock *)clear, (DES_cblock *)cipher, &key_schedule, 1); + } + + #define LENGTH 20 +diff --git a/src/net.c b/src/net.c +index cde91bd..2e4a0cf 100644 +--- a/src/net.c ++++ b/src/net.c +@@ -1082,9 +1082,6 @@ int net_route(struct in_addr *dst, struct in_addr *gateway, + close(fd); + return 0; + +-#elif defined(__sun__) +- syslog(LOG_ERR, "%s: Could not set up routing on Solaris. Please add route manually.", strerror(errno)); +- return 0; + #else + #error "Unknown platform!" + #endif +@@ -1263,11 +1260,6 @@ int net_open_eth(net_interface *netif) { + ndelay_on(netif->fd); + coe(netif->fd); + +- option = 1; +- if (net_setsockopt(netif->fd, SOL_SOCKET, TCP_NODELAY, +- &option, sizeof(option)) < 0) +- return -1; +- + /* Enable reception and transmission of broadcast frames */ + option = 1; + if (net_setsockopt(netif->fd, SOL_SOCKET, SO_BROADCAST, +diff --git a/src/options.c b/src/options.c +index 71469a9..eef2171 100644 +--- a/src/options.c ++++ b/src/options.c +@@ -23,7 +23,7 @@ + #include "chilli_module.h" + #endif + +-void options_init() { ++void options_init(void) { + memset(&_options, 0, sizeof(_options)); + } + +@@ -666,12 +666,12 @@ int reload_options(int argc, char **argv) { + return ok; + } + +-void options_destroy() { ++void options_destroy(void) { + if (_options._data) + free(_options._data); + } + +-void options_cleanup() { ++void options_cleanup(void) { + char file[128]; + + #ifdef ENABLE_MODULES +diff --git a/src/options.h b/src/options.h +index 32499c5..af78e90 100644 +--- a/src/options.h ++++ b/src/options.h +@@ -437,9 +437,9 @@ int process_options(int argc, char **argv, int minimal); + void reprocess_options(int argc, char **argv); + int reload_options(int argc, char **argv); + int options_save(char *file, bstring bt); +-void options_init(); +-void options_destroy(); +-void options_cleanup(); ++void options_init(void); ++void options_destroy(void); ++void options_cleanup(void); + + #ifndef MAIN_FILE /* all main() files must implement _options */ + extern struct options_t _options; +diff --git a/src/queue.c b/src/queue.c +index 587ba67..63e9e63 100644 +--- a/src/queue.c ++++ b/src/queue.c +@@ -57,7 +57,7 @@ static struct nfq_q_handle *qh; + /*static struct nfnl_handle *nh;*/ + static int fd; + +-int q_setup() { ++int q_setup(void) { + printf("opening library handle\n"); + h = nfq_open(); + if (!h) { +diff --git a/src/redir.c b/src/redir.c +index c481f14..01b6dd0 100644 +--- a/src/redir.c ++++ b/src/redir.c +@@ -3362,7 +3362,8 @@ int redir_main(struct redir_t *redir, + redir_chartohex(challenge, hexchal, REDIR_MD5LEN); \ + msg.mtype = msgtype; \ + memcpy(conn.s_state.redir.uamchal, challenge, REDIR_MD5LEN); \ +- if (_options.debug) syslog(LOG_DEBUG, "%s(%d): ---->>> resetting challenge: %s", __FUNCTION__, __LINE__, hexchal) ++ if (_options.debug) \ ++ syslog(LOG_DEBUG, "%s(%d): ---->>> resetting challenge: %s", __FUNCTION__, __LINE__, hexchal) + + #ifdef USING_IPC_UNIX + #define redir_msg_send(msgopt) \ +diff --git a/src/statusfile.c b/src/statusfile.c +index 8c57f93..dd77fe3 100644 +--- a/src/statusfile.c ++++ b/src/statusfile.c +@@ -29,7 +29,7 @@ extern struct ippool_t *ippool; + #ifdef ENABLE_BINSTATFILE + static int has_loaded = 0; + +-int loadstatus() { ++int loadstatus(void) { + char filedest[512]; + FILE *file; + char c; +@@ -303,7 +303,7 @@ int loadstatus() { + return 0; + } + +-int printstatus() { ++int printstatus(void) { + char filedest[512]; + time_t tm; + FILE *file; +@@ -371,12 +371,12 @@ int printstatus() { + } + #else + #ifdef ENABLE_STATFILE +-int loadstatus() { ++int loadstatus(void) { + printstatus(); + return 0; + } + +-int printstatus() { ++int printstatus(void) { + FILE *file; + char filedest[512]; + +diff --git a/src/system.h b/src/system.h +index 5f268ff..257b65b 100644 +--- a/src/system.h ++++ b/src/system.h +@@ -112,6 +112,15 @@ + #include <signal.h> + #endif + ++#ifdef HAVE_SYS_SYSINFO_H ++#include <sys/sysinfo.h> ++#else ++#ifdef HAVE_LINUX_SYSINFO_H ++#define _LINUX_KERNEL_H ++#include <linux/sysinfo.h> ++#endif ++#endif ++ + #ifdef HAVE_INTTYPES_H + #define __STDC_FORMAT_MACROS + #include <inttypes.h> +@@ -129,15 +138,6 @@ + #include <linux/un.h> + #endif + +-#ifdef HAVE_SYS_SYSINFO_H +-#include <sys/sysinfo.h> +-#else +-#ifdef HAVE_LINUX_SYSINFO_H +-#define _LINUX_KERNEL_H +-#include <linux/sysinfo.h> +-#endif +-#endif +- + #elif defined (__FreeBSD__) || defined (__APPLE__) || defined (__OpenBSD__) || defined (__NetBSD__) + #include <net/if.h> + #include <net/bpf.h> +diff --git a/src/tun.c b/src/tun.c +index 7cd5945..2e8aa25 100644 +--- a/src/tun.c ++++ b/src/tun.c +@@ -506,14 +506,6 @@ int tun_addaddr(struct tun_t *this, struct in_addr *addr, + this->addrs++; + return 0; + +-#elif defined (__sun__) +- +- if (!this->addrs) /* Use ioctl for first addr to make ping work */ +- return tun_setaddr(this, addr, dstaddr, netmask); +- +- syslog(LOG_ERR, "%s: Setting multiple addresses not possible on Solaris", strerror(errno)); +- return -1; +- + #else + #error "Unknown platform!" + #endif +@@ -540,12 +532,6 @@ int tuntap_interface(struct _net_interface *netif) { + struct ifaliasreq areq; + int fd; + +-#elif defined(__sun__) +- int if_fd, ppa = -1; +- static int ip_fd = 0; +- int muxid; +- struct ifreq ifr; +- + #else + #error "Unknown platform!" + #endif +@@ -687,66 +673,6 @@ int tuntap_interface(struct _net_interface *netif) { + close(fd); + return 0; + +-#elif defined(__sun__) +- +- if ((ip_fd = open("/dev/udp", O_RDWR, 0)) < 0) { +- syslog(LOG_ERR, "%s: Can't open /dev/udp", strerror(errno)); +- return -1; +- } +- +- if ((netif->fd = open("/dev/tun", O_RDWR, 0)) < 0) { +- syslog(LOG_ERR, "%s: Can't open /dev/tun", strerror(errno)); +- return -1; +- } +- +- /* Assign a new PPA and get its unit number. */ +- if ((ppa = ioctl(netif->fd, TUNNEWPPA, -1)) < 0) { +- syslog(LOG_ERR, "%s: Can't assign new interface", strerror(errno)); +- return -1; +- } +- +- if ((if_fd = open("/dev/tun", O_RDWR, 0)) < 0) { +- syslog(LOG_ERR, "%s: Can't open /dev/tun (2)", strerror(errno)); +- return -1; +- } +- +- if (ioctl(if_fd, I_PUSH, "ip") < 0){ +- syslog(LOG_ERR, "%d Can't push IP module"); +- return -1; +- } +- +- /* Assign ppa according to the unit number returned by tun device */ +- if (ioctl(if_fd, IF_UNITSEL, (char *)&ppa) < 0) { +- syslog(LOG_ERR, "%d Can't set PPA %d", ppa); +- return -1; +- } +- +- /* Link the two streams */ +- if ((muxid = ioctl(ip_fd, I_LINK, if_fd)) < 0) { +- syslog(LOG_ERR, "%d Can't link TUN device to IP"); +- return -1; +- } +- +- close (if_fd); +- +- snprintf(netif->devname, sizeof(netif->devname), +- "tun%d", ppa); +- +- memset(&ifr, 0, sizeof(ifr)); +- strlcpy(ifr.ifr_name, netif->devname, sizeof(ifr.ifr_name)); +- ifr.ifr_ip_muxid = muxid; +- +- if (ioctl(ip_fd, SIOCSIFMUXID, &ifr) < 0) { +- ioctl(ip_fd, I_PUNLINK, muxid); +- syslog(LOG_ERR, "%d Can't set multiplexor id"); +- return -1; +- } +- +- /* if (fcntl (fd, F_SETFL, O_NONBLOCK) < 0) +- msg (M_ERR, "Set file descriptor to non-blocking failed"); */ +- +- return 0; +- + #else + #error "Unknown platform!" + #endif +@@ -943,29 +869,6 @@ int tun_decaps(struct tun_t *this, int idx) { + } + + return 0; +- +-#elif defined (__sun__) +- struct pkt_buffer pb; +- uint8_t packet[PKT_MAX_LEN+4]; +- ssize_t length; +- struct strbuf sbuf; +- int f = 0; +- +- pkt_buffer_init(&pb, packet, sizeof(packet), 4); +- +- sbuf.maxlen = pkt_buffer_size(&pb); +- sbuf.buf = pkt_buffer_head(&pb); +- if (getmsg(tun(this, idx).fd, NULL, &sbuf, &f) < 0) { +- syslog(LOG_ERR, "%d getmsg() failed"); +- return -1; +- } +- +- pb.length = sbuf.len; +- +- if (this->cb_ind) +- return this->cb_ind(this, &pb); +- return 0; +- + #endif + } + +@@ -1007,13 +910,6 @@ int tun_write(struct tun_t *tun, uint8_t *pack, size_t len, int idx) { + + return safe_write(tun(tun, idx).fd, pack, len); + +-#elif defined (__sun__) +- +- struct strbuf sbuf; +- sbuf.len = len; +- sbuf.buf = pack; +- return putmsg(tun(tun, idx).fd, NULL, &sbuf, 0); +- + #endif + } + +diff --git a/www/ChilliLibrary.js b/www/ChilliLibrary.js +index 02ebd7f..c65e11b 100644 +--- a/www/ChilliLibrary.js ++++ b/www/ChilliLibrary.js +@@ -250,7 +250,7 @@ chilliController.logonStep2 = function ( resp ) { + return chilliController.onError('Cannot get challenge'); + } + +- if ( resp.clientSate === chilliController.stateCodes.AUTH ) { ++ if ( resp.clientState === chilliController.stateCodes.AUTH ) { + log('logonStep2: Already connected. Aborting.'); + return chilliController.onError('Already connected.'); + } @@ -1,7 +1,7 @@ # Maintainer: robertfoster pkgname=coova-chilli-arch -pkgver=1.3.2 +pkgver=1.4 pkgrel=1 pkgdesc='An open-source software access controller' arch=('i686' 'x86_64') @@ -13,15 +13,21 @@ optdepends=('python2') options=(!libtool) replaces=(coova-chilli) source=("https://github.com/coova/coova-chilli/archive/$pkgver.tar.gz" - chilli.service) + chilli.service + 4149a5ddfcc666ebbca3fcc9da308e7ff9e433b7.patch + makefile.am.patch +) backup=('etc/chilli.conf') install=chilli.install -build() { - cd "${srcdir}/coova-chilli-${pkgver}" +prepare() { + cd "${srcdir}/coova-chilli-${pkgver}" + + patch -Np1 -i ../4149a5ddfcc666ebbca3fcc9da308e7ff9e433b7.patch + patch -Np1 -i ../makefile.am.patch - ./bootstrap - ./configure --prefix=/usr --sbindir=/usr/bin/ \ + ./bootstrap + ./configure --prefix=/usr --sbindir=/usr/bin/ \ --sysconfdir=/etc --localstatedir=/var \ --enable-statusfile \ --disable-static \ @@ -33,19 +39,26 @@ build() { --enable-chilliscript \ --with-poll \ --with-openssl \ - --enable-chilliradsec - make + --enable-chilliradsec + +} + +build() { + cd "${srcdir}/coova-chilli-${pkgver}" + make } package() { - cd "${srcdir}/coova-chilli-${pkgver}" - make DESTDIR="${pkgdir}" install - -msg2 "Installing systemd unit for ${pkgname}" - install -Dm0644 ../chilli.service $pkgdir/usr/lib/systemd/system/chilli.service + cd "${srcdir}/coova-chilli-${pkgver}" + make DESTDIR="${pkgdir}" install + + msg2 "Installing systemd unit for ${pkgname}" + install -Dm0644 ../chilli.service $pkgdir/usr/lib/systemd/system/chilli.service - rm -rf ${pkgdir}/etc/init.d + rm -rf ${pkgdir}/etc/init.d } -md5sums=('26e02689f632ad27ad599bc0d9f5ae3d' - '828147e21eac257c3b700ea7f4ca3d98') +md5sums=('c322fb0c0d575993acdfb8bdbe1cc022' + '828147e21eac257c3b700ea7f4ca3d98' + 'a185897520cdde94be784f336dd67bcc' +'986482eb732530c30cdc9e7987a53ad4') diff --git a/makefile.am.patch b/makefile.am.patch new file mode 100644 index 000000000000..26987bbda5d2 --- /dev/null +++ b/makefile.am.patch @@ -0,0 +1,11 @@ +--- a/src/Makefile.am 2016-12-15 18:28:43.000000000 +0100 ++++ b/src/Makefile.am 2019-02-25 14:21:14.798719879 +0100 +@@ -25,7 +25,7 @@ + iphash.c lookup.c system.h util.c options.c statusfile.c conn.c sig.c \ + garden.c dns.c session.c pkt.c chksum.c net.c safe.c + +-AM_CFLAGS = -D_GNU_SOURCE -Wall -Werror -fno-builtin -fno-strict-aliasing \ ++AM_CFLAGS = -D_GNU_SOURCE -fno-builtin -fno-strict-aliasing \ + -fomit-frame-pointer -funroll-loops -pipe -I$(top_builddir)/bstring \ + -DDEFCHILLICONF='"$(sysconfdir)/chilli.conf"'\ + -DDEFPIDFILE='"$(localstatedir)/run/chilli.pid"'\ |