[arch-commits] Commit in nbd/repos/community-x86_64 (9 files)

Christian Hesse eworm at archlinux.org
Wed Mar 18 07:27:03 UTC 2020


    Date: Wednesday, March 18, 2020 @ 07:27:03
  Author: eworm
Revision: 600440

archrelease: copy trunk to community-x86_64

Added:
  nbd/repos/community-x86_64/0001-server_trim_whitespace.patch
    (from rev 600439, nbd/trunk/0001-server_trim_whitespace.patch)
  nbd/repos/community-x86_64/PKGBUILD
    (from rev 600439, nbd/trunk/PKGBUILD)
  nbd/repos/community-x86_64/config
    (from rev 600439, nbd/trunk/config)
  nbd/repos/community-x86_64/nbd.service
    (from rev 600439, nbd/trunk/nbd.service)
  nbd/repos/community-x86_64/sysusers_nbd.conf
    (from rev 600439, nbd/trunk/sysusers_nbd.conf)
Deleted:
  nbd/repos/community-x86_64/PKGBUILD
  nbd/repos/community-x86_64/config
  nbd/repos/community-x86_64/nbd.service
  nbd/repos/community-x86_64/sysusers_nbd.conf

-----------------------------------+
 0001-server_trim_whitespace.patch |   42 +++++++++++++
 PKGBUILD                          |  116 +++++++++++++++++++-----------------
 config                            |   42 ++++++-------
 nbd.service                       |   24 +++----
 sysusers_nbd.conf                 |    2 
 5 files changed, 138 insertions(+), 88 deletions(-)

Copied: nbd/repos/community-x86_64/0001-server_trim_whitespace.patch (from rev 600439, nbd/trunk/0001-server_trim_whitespace.patch)
===================================================================
--- 0001-server_trim_whitespace.patch	                        (rev 0)
+++ 0001-server_trim_whitespace.patch	2020-03-18 07:27:03 UTC (rev 600440)
@@ -0,0 +1,42 @@
+From 6cabf9af2310282ace4208ae6f3f4d874dbf3e88 Mon Sep 17 00:00:00 2001
+From: Jonathan Liu <net147 at gmail.com>
+Date: Sun, 15 Mar 2020 18:10:51 +1100
+Subject: [PATCH] server: trim whitespace from lines in authorization file
+
+The netmask line can fail to parse when passed to getaddrinfo if it
+contains whitespace such as newline when using glibc 2.29 and later.
+This results in clients being denied access even though their IP
+address is listed in the authorization file.
+
+Signed-off-by: Jonathan Liu <net147 at gmail.com>
+Signed-off-by: Wouter Verhelst <w at uter.be>
+---
+ nbdsrv.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/nbdsrv.c b/nbdsrv.c
+index b4fa8000..168d425b 100644
+--- a/nbdsrv.c
++++ b/nbdsrv.c
+@@ -127,6 +127,7 @@ int authorized_client(CLIENT *opts) {
+   
+ 	while (fgets(line,LINELEN,f)!=NULL) {
+ 		char* pos;
++		char* endpos;
+ 		/* Drop comments */
+ 		if((pos = strchr(line, '#'))) {
+ 			*pos = '\0';
+@@ -140,7 +141,12 @@ int authorized_client(CLIENT *opts) {
+ 		if(!(*pos)) {
+ 			continue;
+ 		}
+-		if(address_matches(line, (struct sockaddr*)&opts->clientaddr, NULL)) {
++		/* Trim trailing whitespace */
++		endpos = pos;
++		while ((*endpos) && !isspace(*endpos))
++			endpos++;
++		*endpos = '\0';
++		if(address_matches(pos, (struct sockaddr*)&opts->clientaddr, NULL)) {
+ 			fclose(f);
+ 			return 1;
+ 		}

Deleted: PKGBUILD
===================================================================
--- PKGBUILD	2020-03-18 07:26:53 UTC (rev 600439)
+++ PKGBUILD	2020-03-18 07:27:03 UTC (rev 600440)
@@ -1,54 +0,0 @@
-# Maintainer: Christian Hesse <mail at eworm.de>
-# Contributor: Sven-Hendrik Haase <sh at lutzhaase.com>
-# Contributor: Ionut Biru <ibiru at archlinux.org>
-# Contributor: Gerhard Brauer <gerbra at archlinux.de>
-
-pkgname=nbd
-pkgver=3.20
-pkgrel=1
-pkgdesc='tools for network block devices, allowing you to use remote block devices over TCP/IP'
-arch=('x86_64')
-url='https://nbd.sourceforge.io/'
-license=('GPL')
-depends=('glib2' 'gnutls')
-backup=('etc/nbd-server/config')
-source=("https://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.xz"
-        'config'
-        'nbd.service'
-        'sysusers_nbd.conf')
-sha256sums=('e0e1b3538ab7ae5accf56180afd1a9887d415b98d21223b8ad42592b4af7d6cd'
-            'ee2e9fbbeb8a8b9b71d16b6f32eb41788f6def9d00cc4a47897ed3cb97cdde7c'
-            '1b1add55d82d7623eabf7ff3dfec15c1fbe3c340fa74160df3d60e91eb1c71ba'
-            '3fd98fe87d0b31b82126dc669f00355865f58fae81af3fccbc0d06504baef6cd')
-
-build() {
-  cd "${srcdir}/${pkgname}-${pkgver}"
-
-  ./configure \
-    --prefix=/usr \
-    --sbindir=/usr/bin \
-    --sysconfdir=/etc \
-    --enable-syslog
-
-  make
-}
-
-# checks still fail...
-#check() {
-#  cd "${srcdir}/${pkgname}-${pkgver}"
-#
-#  make check
-#}
-
-package() {
-  cd "${srcdir}/${pkgname}-${pkgver}"
-
-  make DESTDIR="${pkgdir}" install
-  install -D -m0644 systemd/nbd at .service "${pkgdir}"/usr/lib/systemd/system/nbd at .service
-
-  install -D -m0644 "${srcdir}"/config "${pkgdir}"/etc/nbd-server/config
-  install -D -m0644 "${srcdir}"/nbd.service "${pkgdir}"/usr/lib/systemd/system/nbd.service
-  install -D -m0644 "${srcdir}"/sysusers_nbd.conf "${pkgdir}"/usr/lib/sysusers.d/nbd.conf
-
-  install -D -m0644 doc/README "${pkgdir}"/usr/share/doc/nbd/README
-}

Copied: nbd/repos/community-x86_64/PKGBUILD (from rev 600439, nbd/trunk/PKGBUILD)
===================================================================
--- PKGBUILD	                        (rev 0)
+++ PKGBUILD	2020-03-18 07:27:03 UTC (rev 600440)
@@ -0,0 +1,62 @@
+# Maintainer: Christian Hesse <mail at eworm.de>
+# Contributor: Sven-Hendrik Haase <sh at lutzhaase.com>
+# Contributor: Ionut Biru <ibiru at archlinux.org>
+# Contributor: Gerhard Brauer <gerbra at archlinux.de>
+
+pkgname=nbd
+pkgver=3.20
+pkgrel=2
+pkgdesc='tools for network block devices, allowing you to use remote block devices over TCP/IP'
+arch=('x86_64')
+url='https://nbd.sourceforge.io/'
+license=('GPL')
+depends=('glib2' 'gnutls')
+backup=('etc/nbd-server/config')
+source=("https://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.xz"
+        '0001-server_trim_whitespace.patch'
+        'config'
+        'nbd.service'
+        'sysusers_nbd.conf')
+sha256sums=('e0e1b3538ab7ae5accf56180afd1a9887d415b98d21223b8ad42592b4af7d6cd'
+            '2ce3e596fba1464a50557354a898e8f6a7d6a140f303867e577026e90686d7d5'
+            'ee2e9fbbeb8a8b9b71d16b6f32eb41788f6def9d00cc4a47897ed3cb97cdde7c'
+            '1b1add55d82d7623eabf7ff3dfec15c1fbe3c340fa74160df3d60e91eb1c71ba'
+            '3fd98fe87d0b31b82126dc669f00355865f58fae81af3fccbc0d06504baef6cd')
+
+prepare() {
+  cd "${srcdir}/${pkgname}-${pkgver}"
+
+  patch -Np1 < ../0001-server_trim_whitespace.patch
+}
+
+build() {
+  cd "${srcdir}/${pkgname}-${pkgver}"
+
+  ./configure \
+    --prefix=/usr \
+    --sbindir=/usr/bin \
+    --sysconfdir=/etc \
+    --enable-syslog
+
+  make
+}
+
+# checks still fail...
+#check() {
+#  cd "${srcdir}/${pkgname}-${pkgver}"
+#
+#  make check
+#}
+
+package() {
+  cd "${srcdir}/${pkgname}-${pkgver}"
+
+  make DESTDIR="${pkgdir}" install
+  install -D -m0644 systemd/nbd at .service "${pkgdir}"/usr/lib/systemd/system/nbd at .service
+
+  install -D -m0644 "${srcdir}"/config "${pkgdir}"/etc/nbd-server/config
+  install -D -m0644 "${srcdir}"/nbd.service "${pkgdir}"/usr/lib/systemd/system/nbd.service
+  install -D -m0644 "${srcdir}"/sysusers_nbd.conf "${pkgdir}"/usr/lib/sysusers.d/nbd.conf
+
+  install -D -m0644 doc/README "${pkgdir}"/usr/share/doc/nbd/README
+}

Deleted: config
===================================================================
--- config	2020-03-18 07:26:53 UTC (rev 600439)
+++ config	2020-03-18 07:27:03 UTC (rev 600440)
@@ -1,21 +0,0 @@
-[generic]
-	# The [generic] section is required, even if nothing is specified
-	# there.
-	# When either of these options are specified, nbd-server drops
-	# privileges to the given user and group after opening ports, but
-	# _before_ opening files.
-	user = nbd
-	group = nbd
-[export1]
-	exportname = /export/nbd/export1-file
-	authfile = /export/nbd/export1-authfile
-	timeout = 30
-	filesize = 10000000
-	readonly = false
-	multifile = false
-	copyonwrite = false
-	prerun = dd if=/dev/zero of=%s bs=1k count=500
-	postrun = rm -f %s
-[otherexport]
-	exportname = /export/nbd/experiment
-	# The other options are all optional.

Copied: nbd/repos/community-x86_64/config (from rev 600439, nbd/trunk/config)
===================================================================
--- config	                        (rev 0)
+++ config	2020-03-18 07:27:03 UTC (rev 600440)
@@ -0,0 +1,21 @@
+[generic]
+	# The [generic] section is required, even if nothing is specified
+	# there.
+	# When either of these options are specified, nbd-server drops
+	# privileges to the given user and group after opening ports, but
+	# _before_ opening files.
+	user = nbd
+	group = nbd
+[export1]
+	exportname = /export/nbd/export1-file
+	authfile = /export/nbd/export1-authfile
+	timeout = 30
+	filesize = 10000000
+	readonly = false
+	multifile = false
+	copyonwrite = false
+	prerun = dd if=/dev/zero of=%s bs=1k count=500
+	postrun = rm -f %s
+[otherexport]
+	exportname = /export/nbd/experiment
+	# The other options are all optional.

Deleted: nbd.service
===================================================================
--- nbd.service	2020-03-18 07:26:53 UTC (rev 600439)
+++ nbd.service	2020-03-18 07:27:03 UTC (rev 600440)
@@ -1,12 +0,0 @@
-[Unit]
-Description=Network Block Device Server
-After=network.target
-
-[Service]
-Type=forking
-ExecStart=/usr/bin/nbd-server
-ProtectSystem=full
-ProtectHome=on
-
-[Install]
-WantedBy=multi-user.target

Copied: nbd/repos/community-x86_64/nbd.service (from rev 600439, nbd/trunk/nbd.service)
===================================================================
--- nbd.service	                        (rev 0)
+++ nbd.service	2020-03-18 07:27:03 UTC (rev 600440)
@@ -0,0 +1,12 @@
+[Unit]
+Description=Network Block Device Server
+After=network.target
+
+[Service]
+Type=forking
+ExecStart=/usr/bin/nbd-server
+ProtectSystem=full
+ProtectHome=on
+
+[Install]
+WantedBy=multi-user.target

Deleted: sysusers_nbd.conf
===================================================================
--- sysusers_nbd.conf	2020-03-18 07:26:53 UTC (rev 600439)
+++ sysusers_nbd.conf	2020-03-18 07:27:03 UTC (rev 600440)
@@ -1 +0,0 @@
-u nbd - "Network Block Device" /var/empty

Copied: nbd/repos/community-x86_64/sysusers_nbd.conf (from rev 600439, nbd/trunk/sysusers_nbd.conf)
===================================================================
--- sysusers_nbd.conf	                        (rev 0)
+++ sysusers_nbd.conf	2020-03-18 07:27:03 UTC (rev 600440)
@@ -0,0 +1 @@
+u nbd - "Network Block Device" /var/empty



More information about the arch-commits mailing list