Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package gensio for openSUSE:Factory checked 
in at 2021-05-15 23:16:28
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gensio (Old)
 and      /work/SRC/openSUSE:Factory/.gensio.new.2988 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "gensio"

Sat May 15 23:16:28 2021 rev:10 rq:893341 version:2.2.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/gensio/gensio.changes    2021-02-08 
11:47:34.129723772 +0100
+++ /work/SRC/openSUSE:Factory/.gensio.new.2988/gensio.changes  2021-05-15 
23:17:30.320421581 +0200
@@ -1,0 +2,6 @@
+Thu May 13 11:10:12 UTC 2021 - Martin Hauke <mar...@gmx.de>
+
+- Update to version 2.2.5
+  * Mostly small bug fixes.
+
+-------------------------------------------------------------------

Old:
----
  gensio-2.2.4.tar.gz

New:
----
  gensio-2.2.5.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ gensio.spec ++++++
--- /var/tmp/diff_new_pack.iTBTAR/_old  2021-05-15 23:17:30.740419425 +0200
+++ /var/tmp/diff_new_pack.iTBTAR/_new  2021-05-15 23:17:30.744419404 +0200
@@ -25,11 +25,11 @@
 %bcond_with    openipmi
 %endif
 Name:           gensio
-Version:        2.2.4
+Version:        2.2.5
 Release:        0
 Summary:        Library to abstract stream and packet I/O
 # examples/* is licenced under Apache-2.0
-License:        GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
+License:        Apache-2.0 AND GPL-2.0-only AND LGPL-2.1-only
 Group:          Productivity/Networking/Other
 URL:            https://github.com/cminyard/gensio
 #Git-Clone:     https://github.com/cminyard/gensio.git

++++++ gensio-2.2.4.tar.gz -> gensio-2.2.5.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gensio-2.2.4/CMakeLists.txt 
new/gensio-2.2.5/CMakeLists.txt
--- old/gensio-2.2.4/CMakeLists.txt     2021-02-06 01:32:10.000000000 +0100
+++ new/gensio-2.2.5/CMakeLists.txt     2021-05-11 03:04:32.000000000 +0200
@@ -15,8 +15,6 @@
 set (CMAKE_C_FLAGS "-Wall")
 option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
 
-option(USE_UUCP_LOCKING "Enable UUCP lock file handling for devices" ON)
-
 option(ENABLE_TCP_WRAPPERS "Enable tcpwrappers support" ON)
 if(ENABLE_TCP_WRAPPERS)
   CHECK_INCLUDE_FILE(tcpd.h HAVE_TCPD_H)
@@ -148,6 +146,25 @@
 check_symbol_exists(regexec "regex.h" HAVE_REGEXEC)
 check_symbol_exists(fnmatch "fnmatch.h" HAVE_FNMATCH)
 
+if (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Darwin")
+  set(APPLE 1)
+else()
+  set(APPLE 0)
+endif()
+
+if (${UNIX} AND NOT ${APPLE})
+  set(DEF_UUCP_LOCKING ON)
+else()
+  set(DEF_UUCP_LOCKING OFF)
+endif()
+if (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Linux")
+  set(UUCP_LOCK_DIR "/var/lock")
+else()
+  set(UUCP_LOCK_DIR "/var/spool/lock")
+endif()
+option(USE_UUCP_LOCKING "Enable UUCP lock file handling for devices"
+       ${DEF_UUCP_LOCKING})
+
 if(UNIX)
   set(HAVE_STDIO 1)
   set(HAVE_SERIALDEV 1)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gensio-2.2.4/config.h.cmake 
new/gensio-2.2.5/config.h.cmake
--- old/gensio-2.2.4/config.h.cmake     2021-02-06 01:32:10.000000000 +0100
+++ new/gensio-2.2.5/config.h.cmake     2021-05-11 03:04:32.000000000 +0200
@@ -1,5 +1,6 @@
 #cmakedefine USE_PTHREADS
 #cmakedefine USE_UUCP_LOCKING
+#cmakedefine UUCP_LOCK_DIR "@UUCP_LOCK_DIR@"
 #cmakedefine HAVE_TCPD_H
 #cmakedefine HAVE_EPOLL_PWAIT
 #cmakedefine01 HAVE_OPENIPMI
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gensio-2.2.4/configure.ac 
new/gensio-2.2.5/configure.ac
--- old/gensio-2.2.4/configure.ac       2021-02-06 01:32:10.000000000 +0100
+++ new/gensio-2.2.5/configure.ac       2021-05-11 03:04:32.000000000 +0200
@@ -1,20 +1,59 @@
-AC_INIT([gensio], [2.2.4], [miny...@acm.org])
+AC_INIT([gensio], [2.2.5], [miny...@acm.org])
 AC_SUBST(gensio_VERSION_MAJOR, 2)
 AC_SUBST(gensio_VERSION_MINOR, 2)
-AC_SUBST(gensio_VERSION_PATCH, 4)
+AC_SUBST(gensio_VERSION_PATCH, 5)
 AC_SUBST(gensio_VERSION_STRING, ${PACKAGE_VERSION})
+AC_CANONICAL_TARGET
 AM_INIT_AUTOMAKE([-Wall])
 AC_CONFIG_HEADERS([config.h])
 AC_PROG_CC
 AM_PROG_AR
 AM_PROG_LIBTOOL
+
+# defaults
+uucp_locking_flag=yes
+UUCP_LOCK_DIR=/var/spool/lock
+USE_FILE_STDIO=0
+system_type=unix
+case $target_os in
+       mingw*)
+               LIBS="$LIBS -lws2_32 -liphlpapi -lgdi32 -lbcrypt"
+               uucp_locking_flag=no
+               system_type=windows
+               USE_FILE_STDIO=1
+               ;;
+       cygwin*)
+               uucp_locking_flag=no
+               ;;
+       linux*)
+               UUCP_LOCK_DIR=/var/lock
+               ;;
+       *macos*)
+               uucp_locking_flag=no
+               ;;
+       *)
+               # Defaults should be correct for BSD type systems
+               ;;
+esac
 AC_ARG_WITH(uucp-locking,
- [AS_HELP_STRING([--with-uucp-locking], [Enable UUCP-style locking])],
- uucp_locking_flag="$withval",
- uucp_locking_flag=yes)
-if test "$uucp_locking_flag" = yes; then
-  AC_DEFINE([USE_UUCP_LOCKING], [], [Enable device locking])
-fi
+ [AS_HELP_STRING([--with-uucp-locking], [Enable UUCP-style locking with 
yes/no, or set the uucp lock directory otherwise])],
+ uucp_locking_flag="$withval")
+case "$uucp_locking_flag" in
+       yes)
+               USE_UUCP_LOCKING=1
+               ;;
+       no)
+               USE_UUCP_LOCKING=0
+               ;;
+       *)
+               USE_UUCP_LOCKING=1
+               UUCP_LOCK_DIR="$uucp_locking_flag"
+               ;;
+esac
+AC_DEFINE_UNQUOTED([USE_UUCP_LOCKING], [$USE_UUCP_LOCKING],
+                  [Enable device locking])
+AC_DEFINE_UNQUOTED([UUCP_LOCK_DIR], ["$UUCP_LOCK_DIR"],
+                  [Directory holding UUCP locks])
 
 AC_ARG_WITH(tcp-wrappers,
  [AS_HELP_STRING([--with-tcp-wrappers], [Enable tcpwrappers support])],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gensio-2.2.4/include/gensio/gensio.h 
new/gensio-2.2.5/include/gensio/gensio.h
--- old/gensio-2.2.4/include/gensio/gensio.h    2021-02-06 01:32:10.000000000 
+0100
+++ new/gensio-2.2.5/include/gensio/gensio.h    2021-05-11 03:04:32.000000000 
+0200
@@ -44,7 +44,8 @@
 /*
  * Serial callbacks start here and run to 2000.
  */
-#define SERGENIO_EVENT_BASE    1000
+#define SERGENSIO_EVENT_BASE   1000
+#define SERGENSIO_EVENT_MAX    1999
 
 /*
  * If a user creates their own gensio with their own events, they should
@@ -555,7 +556,7 @@
  * The protocol type is returned, either TCP, UDP, or SCTP.  Protocol
  * may be NULL.
  *
- * ai should be freed with gensio_free_addr().
+ * ai should be freed with gensio_addr_free().
  *
  * args should be freed with str_to_argv_free().
  */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gensio-2.2.4/include/gensio/sergensio.h 
new/gensio-2.2.5/include/gensio/sergensio.h
--- old/gensio-2.2.4/include/gensio/sergensio.h 2021-02-06 01:32:10.000000000 
+0100
+++ new/gensio-2.2.5/include/gensio/sergensio.h 2021-05-11 03:04:32.000000000 
+0200
@@ -263,24 +263,24 @@
  * requested the mask be changed.  buf points to an unsigned integer
  * holding the modem or line state.
  */
-#define GENSIO_EVENT_SER_MODEMSTATE    (SERGENIO_EVENT_BASE + 1)
-#define GENSIO_EVENT_SER_LINESTATE     (SERGENIO_EVENT_BASE + 2)
+#define GENSIO_EVENT_SER_MODEMSTATE    (SERGENSIO_EVENT_BASE + 1)
+#define GENSIO_EVENT_SER_LINESTATE     (SERGENSIO_EVENT_BASE + 2)
 
 /*
  * On the server side, these are for reporting that the client is
  * requesting the signature.  Not for client.
  */
-#define GENSIO_EVENT_SER_SIGNATURE     (SERGENIO_EVENT_BASE + 3)
+#define GENSIO_EVENT_SER_SIGNATURE     (SERGENSIO_EVENT_BASE + 3)
 
 /*
  * The remote end is asking the user to flow control or flush.  Client
  * or server.
  */
-#define GENSIO_EVENT_SER_FLOW_STATE    (SERGENIO_EVENT_BASE + 4)
-#define GENSIO_EVENT_SER_FLUSH         (SERGENIO_EVENT_BASE + 5)
+#define GENSIO_EVENT_SER_FLOW_STATE    (SERGENSIO_EVENT_BASE + 4)
+#define GENSIO_EVENT_SER_FLUSH         (SERGENSIO_EVENT_BASE + 5)
 
 /* Got a sync from the other end.  Client or server. */
-#define GENSIO_EVENT_SER_SYNC          (SERGENIO_EVENT_BASE + 6)
+#define GENSIO_EVENT_SER_SYNC          (SERGENSIO_EVENT_BASE + 6)
 
 /*
  * Server callbacks.  These only come in in server mode, you must
@@ -288,15 +288,15 @@
  * though the done callback is ignored in that case.  buf points to
  * an integer holding the value.
  */
-#define GENSIO_EVENT_SER_BAUD          (SERGENIO_EVENT_BASE + 7)
-#define GENSIO_EVENT_SER_DATASIZE      (SERGENIO_EVENT_BASE + 8)
-#define GENSIO_EVENT_SER_PARITY                (SERGENIO_EVENT_BASE + 9)
-#define GENSIO_EVENT_SER_STOPBITS      (SERGENIO_EVENT_BASE + 10)
-#define GENSIO_EVENT_SER_FLOWCONTROL   (SERGENIO_EVENT_BASE + 11)
-#define GENSIO_EVENT_SER_IFLOWCONTROL  (SERGENIO_EVENT_BASE + 12)
-#define GENSIO_EVENT_SER_SBREAK                (SERGENIO_EVENT_BASE + 13)
-#define GENSIO_EVENT_SER_DTR           (SERGENIO_EVENT_BASE + 14)
-#define GENSIO_EVENT_SER_RTS           (SERGENIO_EVENT_BASE + 15)
+#define GENSIO_EVENT_SER_BAUD          (SERGENSIO_EVENT_BASE + 7)
+#define GENSIO_EVENT_SER_DATASIZE      (SERGENSIO_EVENT_BASE + 8)
+#define GENSIO_EVENT_SER_PARITY                (SERGENSIO_EVENT_BASE + 9)
+#define GENSIO_EVENT_SER_STOPBITS      (SERGENSIO_EVENT_BASE + 10)
+#define GENSIO_EVENT_SER_FLOWCONTROL   (SERGENSIO_EVENT_BASE + 11)
+#define GENSIO_EVENT_SER_IFLOWCONTROL  (SERGENSIO_EVENT_BASE + 12)
+#define GENSIO_EVENT_SER_SBREAK                (SERGENSIO_EVENT_BASE + 13)
+#define GENSIO_EVENT_SER_DTR           (SERGENSIO_EVENT_BASE + 14)
+#define GENSIO_EVENT_SER_RTS           (SERGENSIO_EVENT_BASE + 15)
 
 GENSIO_DLL_PUBLIC
 bool sergensio_is_client(struct sergensio *sio);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gensio-2.2.4/lib/gensio_certauth.c 
new/gensio-2.2.5/lib/gensio_certauth.c
--- old/gensio-2.2.4/lib/gensio_certauth.c      2021-02-06 01:32:10.000000000 
+0100
+++ new/gensio-2.2.5/lib/gensio_certauth.c      2021-05-11 03:04:32.000000000 
+0200
@@ -160,7 +160,7 @@
     case GENSIO_EVENT_PASSWORD_VERIFY:
        pwvfy.io = io;
        pwvfy.password = (char *) buf;
-       pwvfy.password_len = strlen((const char *) buf);
+       pwvfy.password_len = *buflen;
        return gensio_acc_cb(nadata->acc, GENSIO_ACC_EVENT_PASSWORD_VERIFY,
                             &pwvfy);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gensio-2.2.4/lib/gensio_filter_certauth.c 
new/gensio-2.2.5/lib/gensio_filter_certauth.c
--- old/gensio-2.2.4/lib/gensio_filter_certauth.c       2021-02-06 
01:32:10.000000000 +0100
+++ new/gensio-2.2.5/lib/gensio_filter_certauth.c       2021-05-11 
03:04:32.000000000 +0200
@@ -635,7 +635,6 @@
        gca_logs_err(sfilter, "Failure reading cert from network");
        return GE_NOCERT;
     }
-    sfilter->write_buf_len += sfilter->cert_buf_mem.length;
 
     sfilter->sk_ca = sk_X509_new_null();
     if (!sfilter->sk_ca) {
@@ -791,6 +790,7 @@
 {
     struct certauth_filter *sfilter = filter_to_certauth(filter);
     struct gensio *io;
+    gensiods len;
     bool password_requested = false;
     int err, rv;
 
@@ -1071,11 +1071,12 @@
        if (!sfilter->password || !*sfilter->password)
            goto finish_result;
 
+       len = sfilter->password_len;
        certauth_unlock(sfilter);
        err = gensio_filter_do_event(sfilter->filter,
                                     GENSIO_EVENT_PASSWORD_VERIFY, 0,
                                     (unsigned char *) sfilter->password,
-                                    NULL, NULL);
+                                    &len, NULL);
        certauth_lock(sfilter);
        memset(sfilter->password, 0, sfilter->password_len);
        if (!err) {
@@ -1416,7 +1417,7 @@
            sfilter->state = CERTAUTH_SERVERDONE;
        } else if (sfilter->curr_msg_type != sfilter->state) {
            gca_log_err(sfilter, "Expected message type %d, got %d",
-                       sfilter->curr_msg_type, sfilter->state);
+                       sfilter->state, sfilter->curr_msg_type);
            sfilter->pending_err = GE_PROTOERR;
            goto out_unlock;
        }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gensio-2.2.4/lib/gensio_mux.c 
new/gensio-2.2.5/lib/gensio_mux.c
--- old/gensio-2.2.4/lib/gensio_mux.c   2021-02-06 01:32:10.000000000 +0100
+++ new/gensio-2.2.5/lib/gensio_mux.c   2021-05-11 03:04:32.000000000 +0200
@@ -1246,8 +1246,14 @@
     if (--chan->freeref > 0)
        goto out_unlock;
     switch (chan->state) {
-    case MUX_INST_IN_CLOSE:
     case MUX_INST_IN_REM_CLOSE:
+       /*
+        * We don't call finish_close() in this case, so we need to do
+        * the deref here instead.
+        */
+       chan_deref(chan);
+       /* Fallthrough */
+    case MUX_INST_IN_CLOSE:
     case MUX_INST_IN_CLOSE_FINAL:
     case MUX_INST_IN_OPEN_CLOSE:
        chan->close_done = NULL;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gensio-2.2.4/lib/gensio_stdio.c 
new/gensio-2.2.5/lib/gensio_stdio.c
--- old/gensio-2.2.4/lib/gensio_stdio.c 2021-02-06 01:32:10.000000000 +0100
+++ new/gensio-2.2.5/lib/gensio_stdio.c 2021-05-11 03:04:32.000000000 +0200
@@ -318,11 +318,12 @@
        stdiona_unlock(nadata);
        close_done(schan->io, close_data);
        stdiona_lock(nadata);
+    }
 
-       if (schan->in_free && schan->io) {
-           gensio_data_free(schan->io);
-           schan->io = NULL;
-       }
+    if (schan->in_free && schan->io) {
+       gensio_data_free(schan->io);
+       schan->io = NULL;
+       stdiona_deref_and_unlock(nadata);
     }
 }
 
@@ -505,7 +506,7 @@
     struct stdiona_data *nadata = schan->nadata;
 
     stdiona_lock(nadata);
-    if (schan->closed || !schan->io)
+    if ((!schan->in_close && schan->closed) || !schan->io)
        goto out_unlock;
     schan->read_enabled = enabled;
     if (schan->in_read || schan->in_open ||
@@ -531,7 +532,7 @@
     struct stdiona_data *nadata = schan->nadata;
 
     stdiona_lock(nadata);
-    if (schan->closed || schan->infd == -1)
+    if ((!schan->in_close && schan->closed) || schan->infd == -1)
        goto out_unlock;
     if (schan->xmit_enabled == enabled)
        goto out_unlock;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gensio-2.2.4/lib/sergensio_serialdev.c 
new/gensio-2.2.5/lib/sergensio_serialdev.c
--- old/gensio-2.2.4/lib/sergensio_serialdev.c  2021-02-06 01:32:10.000000000 
+0100
+++ new/gensio-2.2.5/lib/sergensio_serialdev.c  2021-05-11 03:04:32.000000000 
+0200
@@ -458,6 +458,12 @@
 
     g_termios default_termios;
     g_termios orig_termios;
+    int orig_mctl;
+
+    bool rts_set;
+    bool rts_val;
+    bool dtr_set;
+    bool dtr_val;
 
     bool deferred_op_pending;
     struct gensio_runner *deferred_op_runner;
@@ -1211,6 +1217,7 @@
  out_rm_uucp:
     if (!err) {
        do_flush(sdata->fd, TCOFLUSH);
+       ioctl(sdata->fd, TIOCMSET, &sdata->orig_mctl);
        set_termios(sdata->fd, &sdata->orig_termios);
        if (!sdata->no_uucp_lock)
            uucp_rm_lock(sdata->devname);
@@ -1266,15 +1273,9 @@
     int options;
 
     if (!sdata->no_uucp_lock) {
-       err = uucp_mk_lock(sdata->devname);
-       if (err > 0) {
-           err = GE_INUSE;
-           goto out;
-       }
-       if (err < 0) {
-           err = gensio_os_err_to_err(sdata->o, errno);
+       err = uucp_mk_lock(sdata->o, sdata->devname);
+       if (err)
            goto out;
-       }
     }
 
     sdata->timer_stopped = false;
@@ -1290,6 +1291,7 @@
        goto out_uucp;
     }
 
+    ioctl(sdata->fd, TIOCMGET, &sdata->orig_mctl);
     get_termios(sdata->fd, &sdata->orig_termios);
 
     if (!sdata->write_only &&
@@ -1298,6 +1300,39 @@
        goto out_restore;
     }
 
+    if (!sdata->write_only) {
+       int nval;
+
+       if (sdata->dtr_set) {
+           if (ioctl(sdata->fd, TIOCMGET, &nval) == -1) {
+               err = errno;
+               goto out_uucp;
+           }
+           if (sdata->rts_val)
+               nval |= TIOCM_DTR;
+           else
+               nval &= ~TIOCM_DTR;
+           if (ioctl(sdata->fd, TIOCMSET, &nval) == -1) {
+               err = errno;
+               goto out_uucp;
+           }
+       }
+       if (sdata->rts_set) {
+           if (ioctl(sdata->fd, TIOCMGET, &nval) == -1) {
+               err = errno;
+               goto out_uucp;
+           }
+           if (sdata->rts_val)
+               nval |= TIOCM_RTS;
+           else
+               nval &= ~TIOCM_RTS;
+           if (ioctl(sdata->fd, TIOCMSET, &nval) == -1) {
+               err = errno;
+               goto out_uucp;
+           }
+       }
+    }
+
     if (!sdata->write_only && !sdata->disablebreak) {
        if (ioctl(sdata->fd, TIOCCBRK) == -1) {
            err = errno;
@@ -1327,6 +1362,7 @@
     return 0;
 
  out_restore:
+    ioctl(sdata->fd, TIOCMSET, &sdata->orig_mctl);
     set_termios(sdata->fd, &sdata->orig_termios);
  out_uucp:
     if (!sdata->no_uucp_lock)
@@ -1556,7 +1592,8 @@
 }
 
 static int
-process_termios_parm(g_termios *termio, const char *parm, bool custspeed)
+process_termios_parm(struct sterm_data *sdata, g_termios *termio,
+                    const char *parm, bool custspeed)
 {
     int rv = 0, val;
     const char *str;
@@ -1580,6 +1617,12 @@
            termio->c_cflag |= HUPCL;
        else
            termio->c_cflag &= ~HUPCL;
+    } else if (gensio_check_keybool(parm, "dtr", &bval) > 0) {
+       sdata->dtr_set = true;
+       sdata->dtr_val = bval;
+    } else if (gensio_check_keybool(parm, "rts", &bval) > 0) {
+       sdata->rts_set = true;
+       sdata->rts_val = bval;
 
     /* Everything below is deprecated. */
     } else if (strcasecmp(parm, "1STOPBIT") == 0) {
@@ -1701,7 +1744,7 @@
            sdata->disablebreak = false;
            continue;
        }
-       err = process_termios_parm(&sdata->default_termios, argv[i],
+       err = process_termios_parm(sdata, &sdata->default_termios, argv[i],
                                   sdata->allow_custspeed);
        if (err)
            break;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gensio-2.2.4/lib/utils.c new/gensio-2.2.5/lib/utils.c
--- old/gensio-2.2.4/lib/utils.c        2021-02-06 01:32:10.000000000 +0100
+++ new/gensio-2.2.5/lib/utils.c        2021-05-11 03:04:32.000000000 +0200
@@ -221,7 +221,7 @@
                }
            } else if (escape >= 2) {
                if ((base == 16 && isxdigit(*p)) || isodigit(*p)) {
-                   if (isodigit(*p))
+                   if (isdigit(*p))
                        cval = cval * base + *p - '0';
                    else if (isupper(*p))
                        cval = cval * base + *p - 'A';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gensio-2.2.4/lib/uucplock.c 
new/gensio-2.2.5/lib/uucplock.c
--- old/gensio-2.2.4/lib/uucplock.c     2021-02-06 01:32:10.000000000 +0100
+++ new/gensio-2.2.5/lib/uucplock.c     2021-05-11 03:04:32.000000000 +0200
@@ -23,7 +23,7 @@
 #include <sys/stat.h>
 #include <signal.h>
 
-static char *uucp_lck_dir = "/var/lock/";
+static char *uucp_lck_dir = UUCP_LOCK_DIR;
 static char *dev_prefix = "/dev/";
 
 static size_t
@@ -35,10 +35,10 @@
        devname += dev_prefix_len;
 
     /*
-     * Format is "/var/lock/LCK..<devname>".  The 6 is for
-     * the "LCK.." and the final nil char.
+     * Format is "/var/lock/LCK..<devname>".  The 7 is for
+     * the "/LCK.." and the final nil char.
      */
-    return 6 + strlen(uucp_lck_dir) + strlen(devname);
+    return 7 + strlen(uucp_lck_dir) + strlen(devname);
 }
 
 static void
@@ -49,8 +49,8 @@
     if (strncmp(dev_prefix, devname, dev_prefix_len) == 0)
        devname += dev_prefix_len;
 
-    sprintf(buf, "%sLCK..%s", uucp_lck_dir, devname);
-    for (i = strlen(uucp_lck_dir); buf[i]; i++) {
+    sprintf(buf, "%s/LCK..%s", uucp_lck_dir, devname);
+    for (i = strlen(uucp_lck_dir) + 1; buf[i]; i++) {
        if (buf[i] == '/')
            buf[i] = '_';
     }
@@ -91,7 +91,7 @@
 }
 
 int
-uucp_mk_lock(char *devname)
+uucp_mk_lock(struct gensio_os_funcs *o, char *devname)
 {
     struct stat stt;
     int pid = -1;
@@ -130,9 +130,7 @@
                /* death lockfile - remove it */
                unlink(lck_file);
                pid = 0;
-           } else
-               pid = 1;
-
+           }
        }
 
        if (pid == 0) {
@@ -160,7 +158,15 @@
        free(lck_file);
     }
 
-    return pid;
+    if (pid < 0) {
+       gensio_log(o, GENSIO_LOG_ERR, "Error accessing locks in %s: %s",
+                  uucp_lck_dir, strerror(errno));
+       return GE_NOTFOUND;
+    } else if (pid > 0) {
+       gensio_log(o, GENSIO_LOG_ERR, "Port in use by pid %d", pid);
+       return GE_INUSE;
+    }
+    return 0;
 }
 
 #else
@@ -171,7 +177,7 @@
 }
 
 int
-uucp_mk_lock(char *devname)
+uucp_mk_lock(struct gensio_os_funcs *o, char *devname)
 {
     return 0;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gensio-2.2.4/lib/uucplock.h 
new/gensio-2.2.5/lib/uucplock.h
--- old/gensio-2.2.4/lib/uucplock.h     2021-02-06 01:32:10.000000000 +0100
+++ new/gensio-2.2.5/lib/uucplock.h     2021-05-11 03:04:32.000000000 +0200
@@ -13,5 +13,5 @@
 
 void uucp_rm_lock(char *devname);
 
-/* returns 0=OK, -1=error (errno will be set), >0=pid of locking process */
-int uucp_mk_lock(char *devname);
+/* returns gensio error. */
+int uucp_mk_lock(struct gensio_os_funcs *o, char *devname);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gensio-2.2.4/man/gensio.5 
new/gensio-2.2.5/man/gensio.5
--- old/gensio-2.2.4/man/gensio.5       2021-02-06 01:32:10.000000000 +0100
+++ new/gensio-2.2.5/man/gensio.5       2021-05-11 03:04:32.000000000 +0200
@@ -635,6 +635,12 @@
 ignore them (false).  However, if you don't ignore the modem control
 lines, it can result in long shutdown delays.
 .TP
+.B dtr[=on|off]
+Force the DTR line to be on or off when the gensio is opened.
+.TP
+.B rts[=on|off]
+Force the RTS line to be on or off when the gensio is opened.
+.TP
 .B hangup-when-done[=true|false]
 Lower/don't lower the modem control lines when the gensio is closed.
 The default is to not lower the modem control lines on close (false).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gensio-2.2.4/man/gensio_acc_accept_s.3 
new/gensio-2.2.5/man/gensio_acc_accept_s.3
--- old/gensio-2.2.4/man/gensio_acc_accept_s.3  2021-02-06 01:32:10.000000000 
+0100
+++ new/gensio-2.2.5/man/gensio_acc_accept_s.3  2021-05-11 03:04:32.000000000 
+0200
@@ -9,13 +9,13 @@
 .TP 20
 .B int gensio_acc_accept_s(struct gensio_accepter *acc,
 .br
-.B                         struct timeval *timeout,
+.B                         struct gensio_time *timeout,
 .br
 .B                         struct gensio **new_io);
 .TP 20
 .B int gensio_acc_accept_s_intr(struct gensio_accepter *acc,
 .br
-.B                         struct timeval *timeout,
+.B                         struct gensio_time *timeout,
 .br
 .B                         struct gensio **new_io);
 .SH "DESCRIPTION"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gensio-2.2.4/man/gensio_event.3 
new/gensio-2.2.5/man/gensio_event.3
--- old/gensio-2.2.4/man/gensio_event.3 2021-02-06 01:32:10.000000000 +0100
+++ new/gensio-2.2.5/man/gensio_event.3 2021-05-11 03:04:32.000000000 +0200
@@ -107,7 +107,7 @@
 .TP
 .B GE_NOTSUP
 \- Just continue with authentication.
-
+.PP
 Any other error will terminate the connection, these should
 generally be things like out of memory and such,
 .B NOT
@@ -172,10 +172,12 @@
 A password has been received from the remote end, it is passed
 in
 .B buf.
-The callee should validate it.  Return values are:
+The callee should validate it.  The length is passed in *buflen,
+Return values are:
 .TP
 .B 0
 \- The password verification succeeds.
+.TP
 .B GE_NOTSUP
 \- Fail the validation, but the connection shutdown will
 depend on the setting of allow-authfail.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gensio-2.2.4/man/gensio_set_sync.3 
new/gensio-2.2.5/man/gensio_set_sync.3
--- old/gensio-2.2.4/man/gensio_set_sync.3      2021-02-06 01:32:10.000000000 
+0100
+++ new/gensio-2.2.5/man/gensio_set_sync.3      2021-05-11 03:04:32.000000000 
+0200
@@ -13,25 +13,25 @@
 .br
 .B                   void *data, gensiods datalen,
 .br
-.B                   struct timeval *timeout);
+.B                   struct gensio_time *timeout);
 .TP 20
 .B int gensio_read_s_intr(struct gensio *io, gensiods *count,
 .br
 .B                   void *data, gensiods datalen,
 .br
-.B                   struct timeval *timeout);
+.B                   struct gensio_time *timeout);
 .TP 20
 .B int gensio_write_s(struct gensio *io, gensiods *count,
 .br
 .B                    const void *data, gensiods datalen,
 .br
-.B                    struct timeval *timeout);
+.B                    struct gensio_time *timeout);
 .TP 20
 .B int gensio_write_s_intr(struct gensio *io, gensiods *count,
 .br
 .B                    const void *data, gensiods datalen,
 .br
-.B                    struct timeval *timeout);
+.B                    struct gensio_time *timeout);
 .SH "DESCRIPTION"
 Normal gensio operation is asynchronous callback based.  This serves
 most programs fairly well, especially if they are listening to
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gensio-2.2.4/tools/gtlssh-keygen.in 
new/gensio-2.2.5/tools/gtlssh-keygen.in
--- old/gensio-2.2.4/tools/gtlssh-keygen.in     2021-02-06 01:32:10.000000000 
+0100
+++ new/gensio-2.2.5/tools/gtlssh-keygen.in     2021-05-11 03:04:32.000000000 
+0200
@@ -245,7 +245,8 @@
        fi
     fi
     if $stdin; then
-       if ! cat >${DEST}; then
+       if ! awk -e '/^-----END CERTIFICATE-----$/ { print; exit }' \
+               -e '{print}' >${DEST}; then
            echo "Unable to copy stdin into ${DEST}" 1>&2
            return 1
        fi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gensio-2.2.4/tools/gtlssh.c 
new/gensio-2.2.5/tools/gtlssh.c
--- old/gensio-2.2.4/tools/gtlssh.c     2021-02-06 01:32:10.000000000 +0100
+++ new/gensio-2.2.5/tools/gtlssh.c     2021-05-11 03:04:32.000000000 +0200
@@ -295,13 +295,13 @@
     fprintf(stderr, "\r\n");
 }
 
-static void
+static int
 check_cert_expiry(const char *name, const char *filename,
                  const char *cert, gensiods certlen)
 {
     X509 *x = NULL;
     const ASN1_TIME *t = NULL;
-    int days, seconds;
+    int days, seconds, err = 0;
 
     if (filename) {
        FILE *fp = fopen(filename, "r");
@@ -310,7 +310,7 @@
            fprintf(stderr,
                    "Unable to open %s certificate file for "
                    "expiry verification: %s\n", name, strerror(errno));
-           return;
+           return GE_NOTFOUND;
        }
        x = PEM_read_X509(fp, NULL, NULL, NULL);
        fclose(fp);
@@ -319,7 +319,7 @@
 
        if (!cert_bio) {
            fprintf(stderr, "Unable to create %s certificate BIO\n", name);
-           return;
+           return GE_IOERR;
        }
 
        x = PEM_read_bio_X509(cert_bio, NULL, NULL, NULL);
@@ -329,17 +329,25 @@
        fprintf(stderr,
                "Unable to load %s certificate for expiry verification\n",
                name);
-       return;
+       return GE_IOERR;
     }
 
     t = X509_get0_notAfter(x);
     if (!t) {
        fprintf(stderr, "Unable to get certificate expiry time\n");
+       err = GE_IOERR;
        goto out;
     }
 
     if (!ASN1_TIME_diff(&days, &seconds, NULL, t)) {
        fprintf(stderr, "Unable to compare certificate expiry time\n");
+       err = GE_IOERR;
+       goto out;
+    }
+
+    if (days < 0 || seconds < 0) {
+       fprintf(stderr, "***Error: %s certificate has expired\n", name);
+       err = GE_CERTEXPIRED;
        goto out;
     }
 
@@ -350,6 +358,8 @@
  out:
     if (x)
        X509_free(x);
+
+    return err;
 }
 
 static int
@@ -770,7 +780,7 @@
 
     postcert_done:
        if (!err)
-           check_cert_expiry("remote host", NULL, cert, certlen);
+           err = check_cert_expiry("remote host", NULL, cert, certlen);
        return err;
 
     case GENSIO_EVENT_REQUEST_PASSWORD:

Reply via email to