gnu: guile-ssh: Close RREPL channel ports before they are finalized.
[jackhill/guix/guix.git] / gnu / packages / ssh.scm
index ea5ec81..d03686c 100644 (file)
@@ -1,11 +1,12 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2016 Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
+;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -38,7 +39,7 @@
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages nettle)
-  #:use-module (gnu packages mit-krb5)
+  #:use-module (gnu packages kerberos)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:autoload   (gnu packages protobuf) (protobuf)
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module ((guix licenses) #:prefix license:)
-  #:use-module (guix packages))
+  #:use-module (guix packages)
+  #:use-module (srfi srfi-1))
 
 (define-public libssh
   (package
     (name "libssh")
-    (version "0.7.3")
+    (version "0.7.5")
     (source (origin
               (method url-fetch)
               (uri (string-append
-                    "https://red.libssh.org/attachments/download/195/libssh-"
+                    "https://red.libssh.org/attachments/download/218/libssh-"
                     version ".tar.xz"))
               (sha256
                (base32
-                "165g49i4kmm3bfsjm0n8hm21kadv79g9yjqyq09138jxanz4dvr6"))))
+                "15bh6dm9c50ndddzh3gqcgw7axp3ghrspjpkb1z3dr90vkanvs2l"))
+              (patches (search-patches "libssh-hostname-parser-bug.patch"))))
     (build-system cmake-build-system)
+    (outputs '("out" "debug"))
     (arguments
      '(#:configure-flags '("-DWITH_GCRYPT=ON")
 
 client and server implementations.  With libssh, you can remotely execute
 programs, transfer files, and use a secure and transparent tunnel for your
 remote applications.")
-    (home-page "http://www.libssh.org")
+    (home-page "https://www.libssh.org")
     (license license:lgpl2.1+)))
 
 (define-public libssh2
   (package
    (name "libssh2")
-   (version "1.7.0")
+   (version "1.8.0")
    (source (origin
             (method url-fetch)
             (uri (string-append
@@ -93,13 +97,21 @@ remote applications.")
                    version ".tar.gz"))
             (sha256
              (base32
-              "116mh112w48vv9k3f15ggp5kxw5sj4b88dzb5j69llsh7ba1ymp4"))))
+              "1m3n8spv79qhjq4yi0wgly5s5rc8783jb1pyra9bkx1md0plxwrr"))
+            (patches
+             (search-patches "libssh2-fix-build-failure-with-gcrypt.patch"))))
    (build-system gnu-build-system)
    ;; The installed libssh2.pc file does not include paths to libgcrypt and
    ;; zlib libraries, so we need to propagate the inputs.
    (propagated-inputs `(("libgcrypt" ,libgcrypt)
                         ("zlib" ,zlib)))
-   (arguments '(#:configure-flags `("--with-libgcrypt")))
+   (arguments '(#:configure-flags `("--with-libgcrypt")
+                #:phases (modify-phases %standard-phases
+                           (add-before 'configure 'autoreconf
+                             (lambda _
+                               (zero? (system* "autoreconf" "-v")))))))
+   (native-inputs `(("autoconf" ,autoconf)
+                    ("automake" ,automake)))
    (synopsis "Client-side C library implementing the SSH2 protocol")
    (description
     "libssh2 is a library intended to allow software developers access to
@@ -112,7 +124,7 @@ a server that supports the SSH-2 protocol.")
 (define-public openssh
   (package
    (name "openssh")
-   (version "7.3p1")
+   (version "7.5p1")
    (source (origin
             (method url-fetch)
             (uri (let ((tail (string-append name "-" version ".tar.gz")))
@@ -122,12 +134,11 @@ a server that supports the SSH-2 protocol.")
                                         tail)
                          (string-append "http://ftp2.fr.openbsd.org/pub/OpenBSD/OpenSSH/portable/"
                                         tail))))
-            (patches (search-patches "openssh-memory-exhaustion.patch"))
             (sha256 (base32
-                     "1k5y1wi29d47cgizbryxrhc1fbjsba2x8l5mqfa9b9nadnd9iyrz"))))
+                     "1w7rb5gbrikxdkp8w7zxnci4549gk4bw1lml01s59w5rzb2y6ilq"))))
    (build-system gnu-build-system)
-   (inputs `(("groff" ,groff)
-             ("openssl" ,openssl)
+   (native-inputs `(("groff" ,groff)))
+   (inputs `(("openssl" ,openssl)
              ("pam" ,linux-pam)
              ("mit-krb5" ,mit-krb5)
              ("zlib" ,zlib)
@@ -204,7 +215,7 @@ Additionally, various channel-specific options can be negotiated.")
 (define-public guile-ssh
   (package
     (name "guile-ssh")
-    (version "0.10.2")
+    (version "0.11.0")
     (home-page "https://github.com/artyom-poptsov/guile-ssh")
     (source (origin
               ;; ftp://memory-heap.org/software/guile-ssh/guile-ssh-VERSION.tar.gz
@@ -216,8 +227,21 @@ Additionally, various channel-specific options can be negotiated.")
               (file-name (string-append name "-" version ".tar.gz"))
               (sha256
                (base32
-                "0pkiq3fm15pr4w1r420rrwwfmi4jz492r6l6vzjk6v73xlyfyfl3"))))
+                "0r261i8kc3avbmbwgyzak2vnqwssjlgz37g2y2fwm80w9bmn2m7j"))
+              (patches (search-patches "guile-ssh-rexec-bug.patch"
+                                       "guile-ssh-double-free.patch"
+                                       "guile-ssh-channel-finalization.patch"))
+              (modules '((guix build utils)))
+              (snippet
+               ;; 'configure.ac' mistakenly tries to link files from examples/
+               ;; that are not instantiated yet.  Work around it.
+               '(substitute* "configure.ac"
+                  (("AC_CONFIG_LINKS\\(\\[examples/([^:]+):.*" _ file)
+                   (string-append "AC_CONFIG_FILES([examples/" file
+                                  "], [chmod +x examples/"
+                                  file "])\n"))))))
     (build-system gnu-build-system)
+    (outputs '("out" "debug"))
     (arguments
      '(#:phases (modify-phases %standard-phases
                   (add-after 'unpack 'autoreconf
@@ -247,7 +271,7 @@ Additionally, various channel-specific options can be negotiated.")
                      ("texinfo" ,texinfo)
                      ("pkg-config" ,pkg-config)
                      ("which" ,which)))
-    (inputs `(("guile" ,guile-2.0)
+    (inputs `(("guile" ,guile-2.2)
               ("libssh" ,libssh)
               ("libgcrypt" ,libgcrypt)))
     (synopsis "Guile bindings to libssh")
@@ -257,6 +281,16 @@ programs written in GNU Guile interpreter.  It is a wrapper to the underlying
 libssh library.")
     (license license:gpl3+)))
 
+(define-public guile2.2-ssh
+  (deprecated-package "guile2.2-ssh" guile-ssh))
+
+(define-public guile2.0-ssh
+  (package
+    (inherit guile-ssh)
+    (name "guile2.0-ssh")
+    (inputs `(("guile" ,guile-2.0)
+              ,@(alist-delete "guile" (package-inputs guile-ssh))))))
+
 (define-public corkscrew
   (package
     (name "corkscrew")
@@ -264,8 +298,11 @@ libssh library.")
     (source
      (origin
        (method url-fetch)
-       (uri (string-append "http://www.agroman.net/corkscrew/corkscrew-"
-                           version ".tar.gz"))
+       ;; The agroman.net domain name expired on 2017-03-23, and the original
+       ;; "http://www.agroman.net/corkscrew/corkscrew-2.0.tar.gz" now returns
+       ;; bogus HTML.  Perhaps it will yet return.  Until then, use a mirror.
+       (uri (string-append "https://downloads.openwrt.org/sources/"
+                           "corkscrew-" version ".tar.gz"))
        (sha256 (base32
                 "1gmhas4va6gd70i2x2mpxpwpgww6413mji29mg282jms3jscn3qd"))))
     (build-system gnu-build-system)
@@ -288,26 +325,31 @@ libssh library.")
                (setenv "CONFIG_SHELL" bash)
                (zero? (apply system* bash
                              (string-append "." "/configure")
-                             flags))))))))
+                             flags)))))
+         (add-after 'install 'install-documentation
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (doc (string-append out "/share/doc/corkscrew")))
+               (install-file "README" doc)
+               #t))))))
     (home-page "http://www.agroman.net/corkscrew")
-    (synopsis "Tunneling SSH through HTTP proxies")
+    (synopsis "SSH tunneling through HTTP(S) proxies")
     (description
-     "Corkscrew allows creating TCP tunnels through HTTP proxies.  WARNING:
-At the moment only plain text authentication is supported, should you require
-to use it with your HTTP proxy.  Digest based authentication may be supported
-in future and NTLM based authentication is most likey never be supported.")
+     "Corkscrew tunnels SSH connections through most HTTP and HTTPS proxies.
+Proxy authentication is only supported through the plain-text HTTP basic
+authentication scheme.")
     (license license:gpl2+)))
 
 (define-public mosh
   (package
     (name "mosh")
-    (version "1.2.6")
+    (version "1.3.0")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://mosh.org/mosh-" version ".tar.gz"))
               (sha256
                (base32
-                "118fhpm754wpklf1blnlq5xbvrxqml6rdfs3b07wg666zkxvg0ky"))))
+                "0xikz40q873g9ihvz3x6bwkcb9hb8kcnp5wpcmb72pg5c7s143ij"))))
     (build-system gnu-build-system)
     (arguments
      '(#:phases
@@ -342,7 +384,7 @@ especially over Wi-Fi, cellular, and long-distance links.")
 (define-public dropbear
   (package
     (name "dropbear")
-    (version "2016.74")
+    (version "2017.75")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -350,7 +392,7 @@ especially over Wi-Fi, cellular, and long-distance links.")
                     name "-" version ".tar.bz2"))
               (sha256
                (base32
-                "14c8f4gzixf0j9fkx68jgl85q7b05852kk0vf09gi6h0xmafl817"))))
+                "1309cm2aw62n9m3h38prvgsqr8bj85hfasgnvwkd42cp3k5ivg3c"))))
     (build-system gnu-build-system)
     (arguments  `(#:tests? #f)) ; There is no "make check" or anything similar
     (inputs `(("zlib" ,zlib)))
@@ -439,7 +481,14 @@ basis for almost any application.")
      '(;; Skip the `configure' test that checks whether /dev/ptmx &
        ;; co. work as expected, because it relies on impurities (for
        ;; instance, /dev/pts may be unavailable in chroots.)
-       #:configure-flags '("lsh_cv_sys_unix98_ptys=yes")
+       #:configure-flags '("lsh_cv_sys_unix98_ptys=yes"
+
+                           ;; Use glibc's argp rather than the bundled one.
+                           "--with-system-argp"
+
+                           ;; 'lsh_argp.h' checks HAVE_ARGP_PARSE but nothing
+                           ;; defines it.
+                           "CPPFLAGS=-DHAVE_ARGP_PARSE")
 
        ;; FIXME: Tests won't run in a chroot, presumably because
        ;; /etc/profile is missing, and thus clients get an empty $PATH
@@ -452,6 +501,12 @@ basis for almost any application.")
            (lambda* (#:key inputs #:allow-other-keys)
              (let* ((nettle    (assoc-ref inputs "nettle"))
                     (sexp-conv (string-append nettle "/bin/sexp-conv")))
+               ;; Remove argp from the list of sub-directories; we don't want
+               ;; to build it, really.
+               (substitute* "src/Makefile.in"
+                 (("^SUBDIRS = argp")
+                  "SUBDIRS ="))
+
                ;; Make sure 'lsh' and 'lshd' pick 'sexp-conv' in the right place
                ;; by default.
                (substitute* "src/environ.h.in"