Script 'mail_helper' called by obssrc Hello community,
here is the log from the commit of package ser2net for openSUSE:Factory checked in at 2022-12-30 11:08:41 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ser2net (Old) and /work/SRC/openSUSE:Factory/.ser2net.new.1563 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ser2net"
Fri Dec 30 11:08:41 2022 rev:21 rq:1045748 version:4.3.11
Changes: -------- --- /work/SRC/openSUSE:Factory/ser2net/ser2net.changes 2022-01-27 23:18:24.926377708 +0100 +++ /work/SRC/openSUSE:Factory/.ser2net.new.1563/ser2net.changes 2022-12-30 11:08:59.589267284 +0100 @@ -1,0 +2,18 @@ +Thu Dec 29 13:59:09 UTC 2022 - Dominique Leuenberger dimstar@opensuse.org + +- Update to version 4.3.11: + + Shut off write ready on a network write error. + + Shut down device write on a device error. +- Changes from version 4.3.10: + + Retry port startup on gensio allocation failure. +- Changes from version 4.3.9: + + Add link to libgensioosh. +- Changes from version 4.3.8: + + Update ser2net.yaml.5. + + Add libgensiomdns if the mdns code is not in libgensio. +- Changes from version 4.3.7: + + Fix issues disabling PAM support. +- Changes from version 4.3.6: + + Add PAM authentication support. + +-------------------------------------------------------------------
Old: ---- ser2net-4.3.5.tar.gz
New: ---- ser2net-4.3.11.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences: ------------------ ++++++ ser2net.spec ++++++ --- /var/tmp/diff_new_pack.J620Wh/_old 2022-12-30 11:09:00.069270154 +0100 +++ /var/tmp/diff_new_pack.J620Wh/_new 2022-12-30 11:09:00.073270178 +0100 @@ -17,7 +17,7 @@
Name: ser2net -Version: 4.3.5 +Version: 4.3.11 Release: 0 Summary: Serial port to network proxy License: GPL-2.0-or-later
++++++ ser2net-4.3.5.tar.gz -> ser2net-4.3.11.tar.gz ++++++ ++++ 17662 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ser2net-4.3.5/addsysattrs.c new/ser2net-4.3.11/addsysattrs.c --- old/ser2net-4.3.5/addsysattrs.c 2022-01-17 18:59:00.000000000 +0100 +++ new/ser2net-4.3.11/addsysattrs.c 2022-09-07 04:18:42.000000000 +0200 @@ -26,6 +26,7 @@ */
#include <gensio/gensio.h> +#include "absout.h"
#ifdef linux
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ser2net-4.3.5/ar-lib new/ser2net-4.3.11/ar-lib --- old/ser2net-4.3.5/ar-lib 2020-02-05 15:31:03.000000000 +0100 +++ new/ser2net-4.3.11/ar-lib 2022-03-18 14:09:08.000000000 +0100 @@ -2,9 +2,9 @@ # Wrapper for Microsoft lib.exe
me=ar-lib -scriptversion=2012-03-01.08; # UTC +scriptversion=2019-07-04.01; # UTC
-# Copyright (C) 2010-2018 Free Software Foundation, Inc. +# Copyright (C) 2010-2021 Free Software Foundation, Inc. # Written by Peter Rosin peda@lysator.liu.se. # # This program is free software; you can redistribute it and/or modify @@ -53,7 +53,7 @@ MINGW*) file_conv=mingw ;; - CYGWIN*) + CYGWIN* | MSYS*) file_conv=cygwin ;; *) @@ -65,7 +65,7 @@ mingw) file=`cmd //C echo "$file " | sed -e 's/"(.*) " *$/\1/'` ;; - cygwin) + cygwin | msys) file=`cygpath -m "$file" || echo "$file"` ;; wine) @@ -224,10 +224,11 @@ esac done else - $AR -NOLOGO -LIST "$archive" | sed -e 's/\/\\/g' | while read member - do - $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $? - done + $AR -NOLOGO -LIST "$archive" | tr -d '\r' | sed -e 's/\/\\/g' \ + | while read member + do + $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $? + done fi
elif test -n "$quick$replace"; then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ser2net-4.3.5/auth.c new/ser2net-4.3.11/auth.c --- old/ser2net-4.3.5/auth.c 2020-10-27 02:49:45.000000000 +0100 +++ new/ser2net-4.3.11/auth.c 2022-11-01 22:27:57.000000000 +0100 @@ -29,9 +29,26 @@ #include <limits.h> #include <errno.h> #include <stdlib.h> +#include <pwd.h> +#include <dirent.h> #include <gensio/gensio.h> +#include <gensio/gensio_list.h> #include "ser2net.h"
+#if defined(USE_PAM) +#include <security/pam_appl.h> +#endif + +/* + * Ambiguity in spec: is it an array of pointers or a pointer to an array? + * Stolen from openssh. + */ +#ifdef PAM_SUN_CODEBASE +# define PAM_MSG_MEMBER(msg, n, member) ((*(msg))[(n)].member) +#else +# define PAM_MSG_MEMBER(msg, n, member) ((msg)[(n)]->member) +#endif + struct user { struct gensio_link link; char *name; @@ -118,7 +135,7 @@ * The next few functions are for authentication handling. */ static int -handle_auth_begin(struct gensio *net, const char *authdir, +handle_auth_begin(struct gensio *net, const char *authdir, const char *pamauth, const struct gensio_list *allowed_users) { gensiods len; @@ -139,6 +156,33 @@ return GE_AUTHREJECT; }
+#if defined(USE_PAM) + /* set user-specific authdir if it exists. */ + if (pamauth) { + char userauthdir[1000]; + DIR *dir; + struct passwd *pw; + + pw = getpwnam(username); + if (pw) { + len = snprintf(userauthdir, sizeof(userauthdir), + "%s/.gtlssh/allowed_certs/", pw->pw_dir); + dir = opendir(userauthdir); + if (dir) { + closedir(dir); + + err = gensio_control(net, 0, GENSIO_CONTROL_SET, + GENSIO_CONTROL_CERT_AUTH, userauthdir, &len); + if (err) { + syslog(LOG_ERR, "Could not set authdir %s: %s", userauthdir, + gensio_err_to_str(err)); + return GE_NOTSUP; + } + } + } + } +#endif + return GE_NOTSUP; }
@@ -238,8 +282,112 @@ return GE_NOTSUP; }
+#if defined(USE_PAM) +static int +pam_conversation_cb(int num_msg, const struct pam_message **msg, + struct pam_response **pam_response, void *appdata_ptr) +{ + int i; + const char *password = appdata_ptr; + struct pam_response *resp = NULL; + + if (password == NULL) { + return PAM_CONV_ERR; + } + + resp = calloc(num_msg, sizeof(struct pam_response)); + if (resp == NULL) { + return PAM_BUF_ERR; + } + + for (i = 0; i < num_msg; i++) { + resp[i].resp_retcode = 0; + + switch(PAM_MSG_MEMBER(msg, i, msg_style)) { + case PAM_PROMPT_ECHO_ON: + case PAM_PROMPT_ECHO_OFF: + resp[i].resp = strdup(password); + if(resp[i].resp == NULL) { + goto error; + } + } + } + + *pam_response = resp; + return PAM_SUCCESS; + +error: + if (resp) { + for (i = 0; i < num_msg; i++) { + free(resp[i].resp); + } + free(resp); + } + return PAM_BUF_ERR; +} + +static int +handle_password_pam(struct gensio *net, const char *pamauth, const char *password) +{ + int ret = GE_AUTHREJECT; + char username[100]; + gensiods len; + int err, pam_err = 0; + pam_handle_t *pamh = NULL; + struct pam_conv pam_conv; + + len = sizeof(username); + err = gensio_control(net, 0, true, GENSIO_CONTROL_USERNAME, username, + &len); + if (err) { + syslog(LOG_ERR, "No username provided by remote: %s", + gensio_err_to_str(err)); + goto exit; + } + + pam_conv.conv = pam_conversation_cb; + pam_conv.appdata_ptr = (char *)password; + pam_err = pam_start(pamauth, username, &pam_conv, &pamh); + if (pam_err != PAM_SUCCESS) { + syslog(LOG_ERR, "Unable to start PAM transaction: %s", + pam_strerror(pamh, pam_err)); + goto exit; + } + + pam_err = pam_authenticate(pamh, PAM_SILENT); + if (pam_err != PAM_SUCCESS) { + syslog(LOG_ERR, "PAM authentication failed: %s", + pam_strerror(pamh, pam_err) + ); + goto exit; + } else { + syslog(LOG_INFO, "Accepted password for %s\n", username); + } + + pam_err = pam_acct_mgmt(pamh, 0); + if (pam_err == PAM_NEW_AUTHTOK_REQD) { + syslog(LOG_ERR, "user %s password expired", username); + goto exit; + } + if (pam_err != PAM_SUCCESS) { + syslog(LOG_ERR, "pam_acct_mgmt failed for %s: %s", + username, pam_strerror(pamh, pam_err) + ); + goto exit; + } + + ret = 0; + +exit: + if (pamh) { + pam_end(pamh, pam_err); + } + return ret; +} +#endif + int -handle_acc_auth_event(const char *authdir, +handle_acc_auth_event(const char *authdir, const char *pamauth, const struct gensio_list *allowed_users, int event, void *data) { @@ -247,7 +395,7 @@ case GENSIO_ACC_EVENT_AUTH_BEGIN: if (!authdir) return 0; - return handle_auth_begin(data, authdir, allowed_users); + return handle_auth_begin(data, authdir, pamauth, allowed_users);
case GENSIO_ACC_EVENT_PRECERT_VERIFY: if (!authdir) @@ -256,10 +404,17 @@
case GENSIO_ACC_EVENT_PASSWORD_VERIFY: { struct gensio_acc_password_verify_data *pwdata; - if (!authdir) - return 0; pwdata = (struct gensio_acc_password_verify_data *) data; - return handle_password(pwdata->io, authdir, pwdata->password); +#if defined(USE_PAM) + if (pamauth) { + return handle_password_pam(pwdata->io, pamauth, pwdata->password); + } else +#endif + if (authdir) { + return handle_password(pwdata->io, authdir, pwdata->password); + } else { + return 0; + } }
default: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ser2net-4.3.5/compile new/ser2net-4.3.11/compile --- old/ser2net-4.3.5/compile 2020-02-05 15:31:03.000000000 +0100 +++ new/ser2net-4.3.11/compile 2022-03-18 14:09:08.000000000 +0100 @@ -3,7 +3,7 @@
scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey tromey@cygnus.com. # # This program is free software; you can redistribute it and/or modify @@ -53,7 +53,7 @@ MINGW*) file_conv=mingw ;; - CYGWIN*) + CYGWIN* | MSYS*) file_conv=cygwin ;; *) @@ -67,7 +67,7 @@ mingw/*) file=`cmd //C echo "$file " | sed -e 's/"(.*) " *$/\1/'` ;; - cygwin/*) + cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ser2net-4.3.5/configure.ac new/ser2net-4.3.11/configure.ac --- old/ser2net-4.3.5/configure.ac 2022-01-18 01:21:26.000000000 +0100 +++ new/ser2net-4.3.11/configure.ac 2022-12-21 16:28:54.000000000 +0100 @@ -1,4 +1,4 @@ -AC_INIT([ser2net], [4.3.5], [minyard@acm.org]) +AC_INIT([ser2net], [4.3.11], [minyard@acm.org]) AM_INIT_AUTOMAKE([-Wall]) AC_PROG_CC AM_PROG_AR @@ -27,6 +27,34 @@ fi]) fi
+use_pam=check +AC_ARG_WITH(pam, +[ --with-pam=yes|no Support PAM authentication or not.], + if test "x$withval" = "xyes"; then + use_pam=yes + elif test "x$withval" = "xno"; then + use_pam=no + else + [AC_MSG_FAILURE([Unknown option to --with-pam, use yes or no])] + fi, +) + +if test "$use_pam" != "no"; then + have_pam=yes + AC_CHECK_HEADER(security/pam_appl.h, [], [have_pam=no]) + if test "$have_pam" = "yes"; then + AC_CHECK_LIB(pam, pam_start, [], [have_pam=no]) + fi + if test "$use_pam" = "yes" -a "$have_pam" = "no"; then + AC_MSG_ERROR([Pam enabled, but no pam support found]) + fi + use_pam=$have_pam +fi +if test "x$use_pam" != "xno"; then + LIBS="$LIBS -lpam" + AC_DEFINE([USE_PAM], [], [Enable PAM support]) +fi + AC_ARG_WITH(sysfs-led-support, [ --with-sysfs-led-support Enable LED support (Linux only)], sysfs_led_support_flag="$withval", @@ -50,12 +78,22 @@ AC_CHECK_HEADERS([wordexp.h]) AC_CHECK_FUNCS(wordexp)
-PKG_CHECK_MODULES(GENSIO, libgensio, [LIBS=$GENSIO_LIBS], +PKG_CHECK_MODULES(GENSIO, libgensio, [LIBS="$LIBS $GENSIO_LIBS"], [AC_CHECK_HEADER(gensio/gensio.h, [], [AC_MSG_ERROR([gensio.h not found, please install gensio dev package])]) AC_CHECK_LIB(gensio, str_to_gensio, [], [AC_MSG_ERROR([libgensio won't link, please install gensio dev package])])])
+AC_CHECK_LIB(gensio, gensio_list_add_tail, [], + [PKG_CHECK_MODULES(GENSIOOSH, libgensioosh, [LIBS="$LIBS $GENSIOOSH_LIBS"], + [AC_CHECK_LIB(gensioosh, gensio_list_add_tail, [], + [AC_MSG_ERROR([libgensioosh won't link, please install gensio dev package])])])]) + +AC_CHECK_LIB(gensio, gensio_alloc_mdns, [], + [PKG_CHECK_MODULES(GENSIOMDNS, libgensiomdns, [LIBS="$LIBS $GENSIOMDNS_LIBS"], + [AC_CHECK_LIB(gensiomdns, gensio_alloc_mdns, [], + [AC_MSG_ERROR([libgensiomdns won't link, please install gensio dev package])])])]) + AC_CHECK_HEADER(yaml.h, [], [AC_MSG_ERROR([yaml.h not found, please install libyaml dev package])]) AC_CHECK_LIB(yaml, yaml_document_initialize, [], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ser2net-4.3.5/controller.c new/ser2net-4.3.11/controller.c --- old/ser2net-4.3.5/controller.c 2020-10-27 02:49:45.000000000 +0100 +++ new/ser2net-4.3.11/controller.c 2022-07-19 21:53:30.000000000 +0200 @@ -44,6 +44,7 @@ static struct gensio_lock *cntlr_lock; static struct gensio_accepter *controller_accepter; static char *controller_authdir; +static char *controller_pamauth; static struct gensio_waiter *accept_waiter;
static int max_controller_ports = 4; /* How many control connections @@ -1074,7 +1075,10 @@ return controller_acc_new_child(data);
default: - return handle_acc_auth_event(controller_authdir, NULL, event, data); + return handle_acc_auth_event( + controller_authdir, controller_pamauth, + NULL, event, data + ); } }
@@ -1106,6 +1110,9 @@ if (find_default_str("authdir-admin", &controller_authdir)) goto out_nomem;
+ if (find_default_str("pamauth-admin", &controller_pamauth)) + goto out_nomem; + for (i = 0; options && options[i]; i++) { if (gensio_check_keyvalue(options[i], "authdir-admin", &val) > 0) { char *s = strdup(val); @@ -1117,6 +1124,16 @@ controller_authdir = s; continue; } + if (gensio_check_keyvalue(options[i], "pamauth-admin", &val) > 0) { + char *s = strdup(val); + + if (!s) + goto out_nomem; + if (controller_pamauth) + free(controller_pamauth); + controller_pamauth = s; + continue; + } if (eout) eout->out(eout, "Invalid option to admin port: %s", options[i]); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ser2net-4.3.5/dataxfer.c new/ser2net-4.3.11/dataxfer.c --- old/ser2net-4.3.5/dataxfer.c 2022-01-17 18:59:00.000000000 +0100 +++ new/ser2net-4.3.11/dataxfer.c 2022-11-21 14:39:23.000000000 +0100 @@ -708,7 +708,7 @@ }
out_unlock: - if (rv > 0) + if (rv != 0) gensio_set_write_callback_enable(netcon->net, false);
if (rv >= 0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ser2net-4.3.5/defaults.c new/ser2net-4.3.11/defaults.c --- old/ser2net-4.3.5/defaults.c 2021-01-23 04:01:13.000000000 +0100 +++ new/ser2net-4.3.11/defaults.c 2022-07-19 21:53:30.000000000 +0200 @@ -71,6 +71,8 @@ DATAROOT "/ser2net/auth" }, { "authdir-admin", GENSIO_DEFAULT_STR, .def.strval = SYSCONFDIR "/ser2net/auth" }, + { "pamauth", GENSIO_DEFAULT_STR, .def.strval = NULL }, + { "pamauth-admin", GENSIO_DEFAULT_STR, .def.strval = NULL }, { "allowed-users", GENSIO_DEFAULT_STR, .def.strval = NULL }, { "signature", GENSIO_DEFAULT_STR, .def.strval = "ser2net" }, { "openstr", GENSIO_DEFAULT_STR, .def.strval = NULL }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ser2net-4.3.5/m4/libtool.m4 new/ser2net-4.3.11/m4/libtool.m4 --- old/ser2net-4.3.5/m4/libtool.m4 2020-03-02 10:35:42.000000000 +0100 +++ new/ser2net-4.3.11/m4/libtool.m4 2022-03-24 17:13:52.000000000 +0100 @@ -1071,11 +1071,11 @@ # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + 10.0,*86*-darwin8*|10.0,*-darwin[[912]]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[[012]][[,.]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - 10.*) + 10.*|11.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ser2net-4.3.5/missing new/ser2net-4.3.11/missing --- old/ser2net-4.3.5/missing 2020-02-05 15:31:03.000000000 +0100 +++ new/ser2net-4.3.11/missing 2022-03-18 14:09:08.000000000 +0100 @@ -3,7 +3,7 @@
scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard pinard@iro.umontreal.ca, 1996.
# This program is free software; you can redistribute it and/or modify diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ser2net-4.3.5/port.c new/ser2net-4.3.11/port.c --- old/ser2net-4.3.5/port.c 2022-01-17 18:59:00.000000000 +0100 +++ new/ser2net-4.3.11/port.c 2022-11-21 15:00:41.000000000 +0100 @@ -122,13 +122,22 @@ port_start_timer(port_info_t *port) { gensio_time timeout; - unsigned int timeout_sec = 1; + unsigned int timeout_sec;
- if (port->dev_to_net_state == PORT_UNCONNECTED) + switch (port->dev_to_net_state) { + case PORT_UNCONNECTED: timeout_sec = port->connector_retry_time; + break;
- if (port->dev_to_net_state == PORT_CLOSED) + case PORT_CLOSED: + case PORT_NOT_STARTED: timeout_sec = port->accepter_retry_time; + break; + + default: + timeout_sec = 1; + break; + }
#ifdef gensio_version_major timeout.secs = timeout_sec; @@ -273,8 +282,8 @@ return port_new_con(port, data);
default: - return handle_acc_auth_event(port->authdir, port->allowed_users, - event, data); + return handle_acc_auth_event(port->authdir, port->pamauth, + port->allowed_users, event, data); } }
@@ -497,6 +506,11 @@ { int err;
+ if (port->dev_to_net_state == PORT_NOT_STARTED) { + port_start_timer(port); + return GE_NOTREADY; + } + if (port->dev_to_net_state != PORT_CLOSED) return GE_INUSE;
@@ -869,6 +883,7 @@ /* An error occurred and we are in a non-err shutdown. Convert it. */ port->shutdown_reason = errreason; port->net_to_dev_state = PORT_CLOSING; + gensio_set_read_callback_enable(port->io, false); return 0; }
@@ -882,6 +897,9 @@ /* It's an error, force a shutdown. Don't set dev_to_net_state yet. */ port->shutdown_reason = errreason; port->net_to_dev_state = PORT_CLOSING; + + /* Shut down write on an error. */ + gensio_set_read_callback_enable(port->io, false); } else { port->shutdown_reason = "All users disconnected"; } @@ -914,6 +932,66 @@ return false; }
+static int +port_startup(port_info_t *new_port, struct absout *eout, bool retry) +{ + int err; + + err = str_to_gensio(new_port->devname, so, handle_dev_event, new_port, + &new_port->io); + if (err) { + if (!retry || new_port->retry_startup_counter % 64 == 0) + eout->out(eout, "device configuration %s invalid: %s", + new_port->devname, gensio_err_to_str(err)); + goto out_err; + } + + err = str_to_gensio_accepter(new_port->accstr, so, + handle_port_child_event, new_port, + &new_port->accepter); + if (err) { + gensio_free(new_port->io); + new_port->io = NULL; + if (!retry || new_port->retry_startup_counter % 64 == 0) + eout->out(eout, "Invalid accepter port name/number '%s': %s", + new_port->accstr, gensio_err_to_str(err)); + goto out_err; + } + + if (new_port->enabled && new_port->do_telnet) { + const char *str = "telnet"; + struct gensio_accepter *parent; + + if (new_port->allow_2217) + str = "telnet(rfc2217=true)"; + err = str_to_gensio_accepter_child(new_port->accepter, str, + so, + handle_port_child_event, + new_port, &parent); + if (err) { + gensio_free(new_port->io); + new_port->io = NULL; + gensio_acc_free(new_port->accepter); + new_port->accepter = NULL; + if (!retry || new_port->retry_startup_counter % 64 == 0) + eout->out(eout, "Could not allocate telnet gensio: %s", + gensio_err_to_str(err)); + goto out_err; + } + new_port->accepter = parent; + } + + new_port->dev_to_net_state = PORT_CLOSED; + if (retry) + eout->out(eout, "port accepter '%s' is now started", + new_port->accstr); + return 0; + + out_err: + new_port->retry_startup_counter++; + return err; +} + static void port_timeout(struct gensio_timer *timer, void *data) { @@ -922,6 +1000,12 @@ int err;
so->lock(port->lock); + if (port->dev_to_net_state == PORT_NOT_STARTED) { + err = port_startup(port, &syslog_absout, true); + if (err) + goto out; + } + if (port->dev_to_net_state == PORT_CLOSED) { if (port->enabled) startup_port(&syslog_absout, port); @@ -989,7 +1073,7 @@ if (curr->deleted) continue;
- if (curr->enabled) { + if (curr->enabled && curr->accepter) { /* * This unlock is a little strange, but we don't want to * do any waiting while holding the ports lock, otherwise @@ -1112,8 +1196,6 @@ for (curr = ports; curr; curr = curr->next) { so->lock(curr->lock); if (!curr->deleted) { - curr->dev_to_net_state = PORT_CLOSED; - curr->net_to_dev_state = PORT_CLOSED; if (curr->accepter_stopped) { curr->accepter_stopped = false; if (curr->enabled) { @@ -1134,11 +1216,8 @@ }
int -dataxfer_setup_port(port_info_t *new_port, struct absout *eout, - bool do_telnet) +dataxfer_setup_port(port_info_t *new_port, struct absout *eout) { - int err; - new_port->timer = so->alloc_timer(so, port_timeout, new_port); if (!new_port->timer) { eout->out(eout, "Could not allocate timer data"); @@ -1158,40 +1237,10 @@ return -1; }
- err = str_to_gensio(new_port->devname, so, handle_dev_event, new_port, - &new_port->io); - if (err) { - eout->out(eout, "device configuration %s invalid: %s", - new_port->devname, gensio_err_to_str(err)); - return -1; - } + new_port->dev_to_net_state = PORT_NOT_STARTED; + new_port->net_to_dev_state = PORT_CLOSED;
- err = str_to_gensio_accepter(new_port->accstr, so, - handle_port_child_event, new_port, - &new_port->accepter); - if (err) { - eout->out(eout, "Invalid accepter port name/number '%s': %s", - new_port->accstr, gensio_err_to_str(err)); - return -1; - } - - if (new_port->enabled && do_telnet) { - const char *str = "telnet"; - struct gensio_accepter *parent; - - if (new_port->allow_2217) - str = "telnet(rfc2217=true)"; - err = str_to_gensio_accepter_child(new_port->accepter, str, - so, - handle_port_child_event, - new_port, &parent); - if (err) { - eout->out(eout, "Could not allocate telnet gensio: %s", - gensio_err_to_str(err)); - return -1; - } - new_port->accepter = parent; - } + port_startup(new_port, eout, false);
return 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ser2net-4.3.5/port.h new/ser2net-4.3.11/port.h --- old/ser2net-4.3.5/port.h 2022-01-17 18:59:00.000000000 +0100 +++ new/ser2net-4.3.11/port.h 2022-11-08 13:02:42.000000000 +0100 @@ -28,6 +28,7 @@
#include <netdb.h> #include <sys/time.h> +#include <sys/socket.h> #include "gbuf.h" #include "absout.h" #include <gensio/gensio.h> @@ -38,14 +39,15 @@ #endif
/* States for the net_to_dev_state and dev_to_net_state. */ -#define PORT_CLOSED 0 /* The accepter is disabled. */ -#define PORT_UNCONNECTED 1 /* The TCP port is not connected +#define PORT_NOT_STARTED 0 /* The dataxfer_start_port failed. */ +#define PORT_CLOSED 1 /* The accepter is disabled. */ +#define PORT_UNCONNECTED 2 /* The TCP port is not connected to anything right now. */ -#define PORT_WAITING_INPUT 2 /* Waiting for input from the +#define PORT_WAITING_INPUT 3 /* Waiting for input from the input side. */ -#define PORT_WAITING_OUTPUT_CLEAR 3 /* Waiting for output to clear +#define PORT_WAITING_OUTPUT_CLEAR 4 /* Waiting for output to clear so I can send data. */ -#define PORT_CLOSING 4 /* Waiting for output close +#define PORT_CLOSING 5 /* Waiting for output close string to be sent. */ typedef struct trace_info_s { @@ -122,6 +124,12 @@ void (*port_op_done)(struct port_info *, void *); void *port_op_data;
+ /* FIXME - remove this with old config. An old config specified telnet. */ + bool do_telnet; + + /* Keeps a count of retried port startups. */ + unsigned int retry_startup_counter; + /* The port has been deleted, but still has connections in use. */ bool deleted;
@@ -330,6 +338,11 @@ char *authdir;
/* + * Enable PAM authentication + */ + char *pamauth; + + /* * List of authorized users. If NULL, all users are authorized. * If no allowed users are specified, the default is taken. */ @@ -390,8 +403,7 @@ netcon < &(port->netcons[port->max_connections]); \ netcon++) void shutdown_one_netcon(net_info_t *netcon, const char *reason); -int dataxfer_setup_port(port_info_t *new_port, struct absout *eout, - bool do_telnet); +int dataxfer_setup_port(port_info_t *new_port, struct absout *eout); int startup_port(struct absout *eout, port_info_t *port); int shutdown_port(port_info_t *port, const char *errreason); void port_start_timer(port_info_t *port); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ser2net-4.3.5/portconfig.c new/ser2net-4.3.11/portconfig.c --- old/ser2net-4.3.5/portconfig.c 2022-01-17 18:59:00.000000000 +0100 +++ new/ser2net-4.3.11/portconfig.c 2022-11-03 21:44:35.000000000 +0100 @@ -591,6 +591,15 @@ if (port->authdir) free(port->authdir); port->authdir = fval; + } else if (gensio_check_keyvalue(pos, "pamauth", &val) > 0) { + fval = strdup(val); + if (!fval) { + eout->out(eout, "Out of memory allocating pamauth"); + return -1; + } + if (port->pamauth) + free(port->pamauth); + port->pamauth = fval; } else if (gensio_check_keyvalue(pos, "allowed-users", &val) > 0) { rv = add_allowed_users(&port->allowed_users, val, eout); if (rv) @@ -836,6 +845,8 @@ port->accepter_retry_time = find_default_int("accepter-retry-time"); if (find_default_str("authdir", &port->authdir)) return ENOMEM; + if (find_default_str("pamauth", &port->pamauth)) + return ENOMEM; if (find_default_str("allowed-users", &port->default_allowed_users)) return ENOMEM; if (find_default_str("signature", &port->signaturestr)) @@ -883,7 +894,6 @@ net_info_t *netcon; enum str_type str_type; int err; - bool do_telnet = false; bool write_only = false; unsigned int i; struct port_remaddr *r; @@ -963,7 +973,7 @@ } else if (strcmp(state, "telnet") == 0) { /* FIXME - remove this someday. */ new_port->enabled = true; - do_telnet = true; + new_port->do_telnet = true; } else if (strcmp(state, "off") == 0) { new_port->enabled = false; } else { @@ -1009,7 +1019,7 @@ new_port->default_allowed_users = NULL; }
- if (dataxfer_setup_port(new_port, eout, do_telnet)) + if (dataxfer_setup_port(new_port, eout)) goto errout;
if (gbuf_init(&new_port->dev_to_net, new_port->dev_to_net.maxsize)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ser2net-4.3.5/portinfo.c new/ser2net-4.3.11/portinfo.c --- old/ser2net-4.3.5/portinfo.c 2022-01-17 18:59:00.000000000 +0100 +++ new/ser2net-4.3.11/portinfo.c 2022-09-07 04:18:42.000000000 +0200 @@ -26,6 +26,7 @@ #include <string.h> #include <stdio.h> #include <errno.h> +#include <arpa/inet.h> #include <gensio/gensio.h> #include <gensio/sergensio.h> #include "ser2net.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ser2net-4.3.5/rotator.c new/ser2net-4.3.11/rotator.c --- old/ser2net-4.3.5/rotator.c 2020-10-27 02:49:45.000000000 +0100 +++ new/ser2net-4.3.11/rotator.c 2022-07-19 21:53:30.000000000 +0200 @@ -46,6 +46,7 @@ struct gensio_accepter *accepter;
char *authdir; + char *pamauth; struct gensio_list *allowed_users; char *default_allowed_users;
@@ -150,8 +151,8 @@ return rot_new_con(rot, data);
default: - return handle_acc_auth_event(rot->authdir, rot->allowed_users, - event, data); + return handle_acc_auth_event(rot->authdir, rot->pamauth, + rot->allowed_users, event, data); } }
@@ -195,6 +196,8 @@ gensio_acc_free(rot->accepter); if (rot->authdir) free(rot->authdir); + if (rot->pamauth) + free(rot->pamauth); free_user_list(rot->allowed_users); if (rot->default_allowed_users) free(rot->default_allowed_users); @@ -277,6 +280,9 @@ if (find_default_str("authdir", &rot->authdir)) goto out_nomem;
+ if (find_default_str("pamauth", &rot->pamauth)) + goto out_nomem; + if (find_default_str("allowed-users", &rot->default_allowed_users)) goto out_nomem;
@@ -297,6 +303,16 @@ goto out_nomem; } continue; + } else if (gensio_check_keyvalue(options[i], "pamauth", &str) > 0) { + if (rot->pamauth) + free(rot->pamauth); + rot->pamauth = strdup(str); + if (!rot->pamauth) { + eout->out(eout, "Out of memory allocating rotator" + " pamauth on line %d\n", lineno); + goto out_nomem; + } + continue; } else if (gensio_check_keyvalue(options[i], "allowed-users", &str) > 0) { rv = add_allowed_users(&rot->allowed_users, str, eout); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ser2net-4.3.5/ser2net.c new/ser2net-4.3.11/ser2net.c --- old/ser2net-4.3.5/ser2net.c 2022-01-17 18:59:00.000000000 +0100 +++ new/ser2net-4.3.11/ser2net.c 2022-08-10 21:13:01.000000000 +0200 @@ -89,7 +89,7 @@ " -s - specify a default signature for RFC2217 protocol\n" " -Y - Handle a yaml configuration string. This may be specified multiple\n" " times; these strings are strung together as if they were one input\n" -" string. This disables the defalt config file, you must specify -c\n" +" string. This disables the default config file, you must specify -c\n" " after the last -Y. The config file will be processed first, if it\n" " is specified, then the -Y strings in order, as if they are one\n" " continguous file. '#' characters outside of quotes will be converted\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ser2net-4.3.5/ser2net.h new/ser2net-4.3.11/ser2net.h --- old/ser2net-4.3.5/ser2net.h 2020-10-27 02:49:45.000000000 +0100 +++ new/ser2net-4.3.11/ser2net.h 2022-07-19 21:53:30.000000000 +0200 @@ -65,7 +65,7 @@ /* * Handle authorization events from accepters. */ -int handle_acc_auth_event(const char *authdir, +int handle_acc_auth_event(const char *authdir, const char *pamauth, const struct gensio_list *allowed_users, int event, void *data);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ser2net-4.3.5/ser2net.yaml new/ser2net-4.3.11/ser2net.yaml --- old/ser2net-4.3.5/ser2net.yaml 2022-01-17 18:59:00.000000000 +0100 +++ new/ser2net-4.3.11/ser2net.yaml 2022-07-19 21:53:30.000000000 +0200 @@ -280,6 +280,7 @@ # net-to-dev-bufsize: 64 # max-connections: 1 # authdir: <authentication directory> +# pamauth: "" # allowed-users: <space separated list of names> # remaddr: <remote address> # connback: <remote connector string> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ser2net-4.3.5/ser2net.yaml.5 new/ser2net-4.3.11/ser2net.yaml.5 --- old/ser2net-4.3.5/ser2net.yaml.5 2022-01-17 18:59:00.000000000 +0100 +++ new/ser2net-4.3.11/ser2net.yaml.5 2022-08-14 23:39:32.000000000 +0200 @@ -15,7 +15,7 @@ YAML has the ability to create aliases that can be used elsewhere in the configuration file. These can be used for tying things together between parts of the file, or (as an extension to YAML) for string -subtitution. +substitution.
You define an alias with the following: .IP @@ -129,7 +129,7 @@ .RS connection: &toS0telnet .RS -accepter: telnet(rfc2217)tcp,1234 +accepter: telnet(rfc2217),tcp,1234 .br connector: serialdev,/dev/ttyS0,local .RE @@ -364,7 +364,7 @@ sets the number of serial port characters, in tenths of a character, to wait after receiving from the connection gensio and sending to the accepted gensio. So setting this to 25 will cause ser2net to wait the -amount of time it takes to recieve 2.5 serial port characters before +amount of time it takes to receive 2.5 serial port characters before sending the data on to the TCP port. The default value is 20.
.I chardelay-min: <number> @@ -421,11 +421,11 @@
.I no-con-to-acc: true|false If true, do not transfer any data from the connector to the accepter. -Throw any data recevied from the connecter away. +Throw any data received from the connecter away.
.I no-acc-to-con: true|false If true, do not transfer any data from the accepter to the connecter. -Throw any data recevied from the accepter away. +Throw any data received from the accepter away.
.I connback: <connector>[;<connector>[;...]] specifies reverse connections that will be made when data comes in on @@ -453,6 +453,9 @@ .I authdir: <directory string> specified the authentication directory to use for this connection.
+.I pamauth: <service name> +Enables PAM authentication and sets the PAM service name. + .I allowed-users: <space separated list of names> The users that are allowed to use this connections. This has no meaning if authentication is not enabled on the connections. If this @@ -536,7 +539,7 @@ .RE .RE
-A rotator has three possible options, "authdir", "allowed-users", and +A rotator has four possible options, "authdir", "pamauth", "allowed-users", and "accepter-retry-time", both same as connections.
You should use YAML aliases for the connections. @@ -634,7 +637,7 @@ sets the number of serial port characters, in tenths of a character, to wait after receiving from the serial port and sending to the TCP port. So setting this to 25 will cause ser2net to wait the amount -of time it takes to recieve 2.5 serial port characters before sending +of time it takes to receive 2.5 serial port characters before sending the data on to the TCP port. This can range from 1-1000. .TP .B chardelay-min: 1000 @@ -678,6 +681,13 @@ The authentication directory for ser2net for admin connections. The "ADMIN_CONNECTIONS" for more details. .TP +.B pamauth: <NULL> +The PAM service name for ser2net PAM authentication (<NULL> for disabled). +.TP +.B pamauth-admin: <NULL> +The PAM service name for ser2net admin connection PAM authentication (<NULL> +for disabled). See "ADMIN_CONNECTIONS" for more details. +.TP .B mdns-interface: -1 The default mDNS interface. .TP @@ -707,10 +717,10 @@ .RE .RE
-The only option available is "authdir-admin", which sets the -authentication directory for the admin port. This is different than -the authdir for connections and rotators, though you can set it to the -same value. +The only options available are "authdir-admin", which sets the authentication +directory for the admin port and "pamauth-admin" which sets the PAM service +name and enables PAM authentication. Both are different than "authdir" resp. +"pamauth" for connections, though you can set it to the same value.
.SH LEDS .B ser2net @@ -1137,14 +1147,18 @@ ask you to verify it, much like ssh does. If certificates, IP address, etc. change, gtlssh will tell you about it.
-If you do not want to use a certificate (certificates are certainly -preferred, but may not alway be workable) you can use a password -login, too. Put a password in authdir/username/password. When -you connect with gtlssh, if certificate validate fails, you will -be prompted for the password. If it matches the first line in the -password file, then authentication will succeed. You must set -enable-password in the certauth gensio options for passwords -to work. +If you do not want to use a certificate (certificates are certainly preferred, +but may not always be workable) you can use a password login, too. You must set +enable-password in the certauth gensio options for passwords to work. When you +connect with gtlssh, if certificate validate fails, you will be prompted for +the password. Password authentication can be performed in two different ways. +Both are mutually exclusive, depending on whether pamauth is set or not: +.IP (bu +To authenticate using the PAM library set the PAM service name via pamauth +option. +.IP (bu +Put a password in authdir/username/password. If it matches the first line in +the password file and pamauth is not set, then authentication will succeed. .SS "AUTHENTICATION AND ROTATORS" Rotators are a special case. BE CAREFUL. A rotator has its own authentication. If you set up authentication on a port that is diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ser2net-4.3.5/test-driver new/ser2net-4.3.11/test-driver --- old/ser2net-4.3.5/test-driver 2020-02-05 15:31:03.000000000 +0100 +++ new/ser2net-4.3.11/test-driver 2022-03-18 14:09:08.000000000 +0100 @@ -3,7 +3,7 @@
scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 2011-2018 Free Software Foundation, Inc. +# Copyright (C) 2011-2021 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -42,11 +42,13 @@ { cat <<END Usage: - test-driver --test-name=NAME --log-file=PATH --trs-file=PATH - [--expect-failure={yes|no}] [--color-tests={yes|no}] - [--enable-hard-errors={yes|no}] [--] + test-driver --test-name NAME --log-file PATH --trs-file PATH + [--expect-failure {yes|no}] [--color-tests {yes|no}] + [--enable-hard-errors {yes|no}] [--] TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS] + The '--test-name', '--log-file' and '--trs-file' options are mandatory. +See the GNU Automake documentation for information. END }
@@ -103,8 +105,11 @@ trap "st=141; $do_exit" 13 trap "st=143; $do_exit" 15
-# Test script is run here. -"$@" >$log_file 2>&1 +# Test script is run here. We create the file first, then append to it, +# to ameliorate tests themselves also writing to the log file. Our tests +# don't, but others can (automake bug#35762). +: >"$log_file" +"$@" >>"$log_file" 2>&1 estatus=$?
if test $enable_hard_errors = no && test $estatus -eq 99; then @@ -126,7 +131,7 @@ # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). -echo "$res $test_name (exit status: $estatus)" >>$log_file +echo "$res $test_name (exit status: $estatus)" >>"$log_file"
# Report outcome to console. echo "${col}${res}${std}: $test_name" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ser2net-4.3.5/tests/test_xfer_basic_ipmisol.py new/ser2net-4.3.11/tests/test_xfer_basic_ipmisol.py --- old/ser2net-4.3.5/tests/test_xfer_basic_ipmisol.py 2022-01-17 18:59:00.000000000 +0100 +++ new/ser2net-4.3.11/tests/test_xfer_basic_ipmisol.py 2022-07-19 21:53:30.000000000 +0200 @@ -28,5 +28,5 @@ " accepter: tcp,3023", " connector: ipmisol,lan -U ipmiusr -P test -p %d localhost,9600" % ipmisimdaemon.ipmisol_port), "tcp,localhost,3023", - "serialdev,/dev/ttyPipeA0,9600N81,LOCAL", + "serialdev,/dev/ttyPipeA0,9600N81,local", switch_delay = 0.25) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ser2net-4.3.5/tests/test_xfer_basic_sctp.py new/ser2net-4.3.11/tests/test_xfer_basic_sctp.py --- old/ser2net-4.3.5/tests/test_xfer_basic_sctp.py 2020-10-27 02:49:45.000000000 +0100 +++ new/ser2net-4.3.11/tests/test_xfer_basic_sctp.py 2022-07-19 21:53:30.000000000 +0200 @@ -12,7 +12,7 @@ test_write_drain("basic sctp", "This is a write drain test!", ("connection: &con", " accepter: sctp,3023", - " connector: serialdev,/dev/ttyPipeA0,9600N81"), + " connector: serialdev,/dev/ttyPipeA0,9600N81,local"), "sctp,localhost,3023", "serialdev,/dev/ttyPipeB0,9600N81")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ser2net-4.3.5/tests/test_xfer_basic_ssl_tcp.py new/ser2net-4.3.11/tests/test_xfer_basic_ssl_tcp.py --- old/ser2net-4.3.5/tests/test_xfer_basic_ssl_tcp.py 2020-10-27 02:49:45.000000000 +0100 +++ new/ser2net-4.3.11/tests/test_xfer_basic_ssl_tcp.py 2022-07-19 21:53:30.000000000 +0200 @@ -15,7 +15,7 @@ ("connection: &con", " accepter: ssl(key=%s/key.pem,cert=%s/cert.pem),tcp,3023" % (utils.keydir, utils.keydir), - " connector: serialdev,/dev/ttyPipeA0,9600N81"), + " connector: serialdev,/dev/ttyPipeA0,9600N81,local"), "ssl(CA=%s/CA.pem),tcp,localhost,3023" % utils.keydir, "serialdev,/dev/ttyPipeB0,9600N81")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ser2net-4.3.5/tests/test_xfer_basic_stdio.py new/ser2net-4.3.11/tests/test_xfer_basic_stdio.py --- old/ser2net-4.3.5/tests/test_xfer_basic_stdio.py 2020-10-27 02:49:45.000000000 +0100 +++ new/ser2net-4.3.11/tests/test_xfer_basic_stdio.py 2022-07-19 21:53:30.000000000 +0200 @@ -12,6 +12,6 @@ test_write_drain("basic stdio", "This is a write drain test!", ("connection: &con", " accepter: stdio", - " connector: serialdev,/dev/ttyPipeA0,9600N81"), + " connector: serialdev,/dev/ttyPipeA0,9600N81,local"), None, "serialdev,/dev/ttyPipeB0,9600N81") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ser2net-4.3.5/tests/test_xfer_basic_tcp.py new/ser2net-4.3.11/tests/test_xfer_basic_tcp.py --- old/ser2net-4.3.5/tests/test_xfer_basic_tcp.py 2020-10-27 02:49:45.000000000 +0100 +++ new/ser2net-4.3.11/tests/test_xfer_basic_tcp.py 2022-07-19 21:53:30.000000000 +0200 @@ -12,9 +12,9 @@ test_write_drain("basic tcp", "This is a write drain test!", ("connection: &con", " accepter: tcp,3023", - " connector: serialdev,/dev/ttyPipeA0,9600N81"), + " connector: serialdev,/dev/ttyPipeA0,9600N81,local"), "tcp,localhost,3023", - "serialdev,/dev/ttyPipeB0,9600N81") + "serialdev,/dev/ttyPipeB0,9600N81,local")
test_connect_back("basic tcp", "TCP Connect back test!", ("connection: &con", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ser2net-4.3.5/tests/test_xfer_basic_telnet.py new/ser2net-4.3.11/tests/test_xfer_basic_telnet.py --- old/ser2net-4.3.5/tests/test_xfer_basic_telnet.py 2020-10-27 02:49:45.000000000 +0100 +++ new/ser2net-4.3.11/tests/test_xfer_basic_telnet.py 2022-07-19 21:53:30.000000000 +0200 @@ -12,7 +12,7 @@ test_write_drain("basic telnet", "This is a write drain test!", ("connection: &con", " accepter: telnet,tcp,3023", - " connector: serialdev,/dev/ttyPipeA0,9600N81"), + " connector: serialdev,/dev/ttyPipeA0,9600N81,local"), "telnet,tcp,localhost,3023", "serialdev,/dev/ttyPipeB0,9600N81")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ser2net-4.3.5/tests/test_xfer_basic_udp.py new/ser2net-4.3.11/tests/test_xfer_basic_udp.py --- old/ser2net-4.3.5/tests/test_xfer_basic_udp.py 2022-01-17 18:59:00.000000000 +0100 +++ new/ser2net-4.3.11/tests/test_xfer_basic_udp.py 2022-07-19 21:53:30.000000000 +0200 @@ -15,7 +15,7 @@ test_write_drain("basic udp", "This is a write drain test!", ("connection: &con", " accepter: udp,3023", - " connector: serialdev,/dev/ttyPipeA0,9600N81"), + " connector: serialdev,/dev/ttyPipeA0,9600N81,local"), "udp,localhost,3023", "serialdev,/dev/ttyPipeB0,9600N81", initial_write_io1 = "A") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ser2net-4.3.5/tests/utils.py new/ser2net-4.3.11/tests/utils.py --- old/ser2net-4.3.5/tests/utils.py 2022-01-17 20:10:01.000000000 +0100 +++ new/ser2net-4.3.11/tests/utils.py 2022-11-02 15:54:47.000000000 +0100 @@ -196,7 +196,7 @@ else: iolen = None
- if (debug or self.debug) and iolen != None: + if (debug or self.debug) and buf is not None and iolen != None: print("%s: Got %d bytes at pos %d of %d" % (self.name, len(buf), self.compared, iolen)) if (debug >= 2 or self.debug >= 2): @@ -485,7 +485,10 @@ self.waiter.wake() return
-import collections +try: + import collections.abc as seqholder +except: + import collections as seqholder
PY3 = sys.version_info[0] == 3
@@ -497,7 +500,7 @@ def is_nonstr_sequence(obj): if isinstance(obj, string_types): return False - return isinstance(obj, collections.Sequence) + return isinstance(obj, seqholder.Sequence)
class Ser2netDaemon: """Create a ser2net daemon instance and start it up