[arch-commits] Commit in open-iscsi/trunk (4 files)

Christian Hesse eworm at archlinux.org
Wed Oct 17 20:56:46 UTC 2018


    Date: Wednesday, October 17, 2018 @ 20:56:45
  Author: eworm
Revision: 395087

upgpkg: open-iscsi 2.0.877-1

new upstream release

Added:
  open-iscsi/trunk/0001-libkmod.patch
Modified:
  open-iscsi/trunk/PKGBUILD
Deleted:
  open-iscsi/trunk/0001-gcc8.patch
  open-iscsi/trunk/open-iscsi.service

--------------------+
 0001-gcc8.patch    |  190 ---------------------------------------------------
 0001-libkmod.patch |   35 +++++++++
 PKGBUILD           |   37 ++++-----
 open-iscsi.service |   10 --
 4 files changed, 51 insertions(+), 221 deletions(-)

Deleted: 0001-gcc8.patch
===================================================================
--- 0001-gcc8.patch	2018-10-17 20:51:07 UTC (rev 395086)
+++ 0001-gcc8.patch	2018-10-17 20:56:45 UTC (rev 395087)
@@ -1,190 +0,0 @@
-From 7fd4eb9313154f3b3458ea07d6a12f0be26d2a4e Mon Sep 17 00:00:00 2001
-From: Lee Duncan <lduncan at suse.com>
-Date: Wed, 21 Mar 2018 16:43:33 -0700
-Subject: Use correct size when copying nic name.
-
-The incorrect length was being used to copy
-the NIC name.
-
-Found by gcc-8, which gave this error:
->    [   19s] nic_utils.c: In function 'nic_util_enable_disable_multicast':
->    [   19s] nic_utils.c:308:9: warning: argument to 'sizeof' in 'strncpy'
->             call is the same expression as the source; did you mean to
->             use the size of the destination? [-Wsizeof-pointer-memaccess]
->    [   19s]    sizeof(nic->eth_device_name));
->    [   19s]          ^
----
- iscsiuio/src/unix/nic_utils.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/iscsiuio/src/unix/nic_utils.c b/iscsiuio/src/unix/nic_utils.c
-index e2f2943..786f2a4 100644
---- a/iscsiuio/src/unix/nic_utils.c
-+++ b/iscsiuio/src/unix/nic_utils.c
-@@ -305,7 +305,7 @@ static int nic_util_enable_disable_multicast(nic_t *nic, uint32_t cmd)
- 	/* Prepare the request */
- 	memset(&ifr, 0, sizeof(ifr));
- 	strncpy(ifr.ifr_name, nic->eth_device_name,
--		sizeof(nic->eth_device_name));
-+		sizeof(ifr.ifr_name));
- 	memcpy(ifr.ifr_hwaddr.sa_data, multicast_addr.addr, ETH_ALEN);
- 
- 	fd = socket(AF_INET, SOCK_DGRAM, 0);
--- 
-cgit v1.1-33-g03f6
-
-
-From 1846d2c995f38fc5fa6e1960f6644b4b3b543bb0 Mon Sep 17 00:00:00 2001
-From: Lee Duncan <lduncan at suse.com>
-Date: Wed, 21 Mar 2018 16:47:10 -0700
-Subject: Do not overload global sysfs_path locally.
-
-There is a global string "sysfs_path", and
-it was confusing having a local variable of
-the same name, so rename the local version,
-to be clear which one is being used.
----
- usr/iscsi_sysfs.c | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
-
-diff --git a/usr/iscsi_sysfs.c b/usr/iscsi_sysfs.c
-index 0cc55b9..031ac1d 100644
---- a/usr/iscsi_sysfs.c
-+++ b/usr/iscsi_sysfs.c
-@@ -1153,7 +1153,7 @@ int iscsi_sysfs_for_each_iface_on_host(void *data, uint32_t host_no,
- 	int rc = 0, i, n;
- 	struct iface_rec iface;
-         char devpath[PATH_SIZE];
--        char sysfs_path[PATH_SIZE];
-+        char sysfs_dev_iscsi_iface_path[PATH_SIZE];
-         char id[NAME_SIZE];
- 
-         snprintf(id, sizeof(id), "host%u", host_no);
-@@ -1163,11 +1163,11 @@ int iscsi_sysfs_for_each_iface_on_host(void *data, uint32_t host_no,
-                 return ISCSI_ERR_SYSFS_LOOKUP;
-         }
- 
--	sprintf(sysfs_path, "/sys");
--	strlcat(sysfs_path, devpath, sizeof(sysfs_path));
--	strlcat(sysfs_path, "/iscsi_iface", sizeof(sysfs_path));
-+	sprintf(sysfs_dev_iscsi_iface_path, "/sys");
-+	strlcat(sysfs_dev_iscsi_iface_path, devpath, sizeof(sysfs_dev_iscsi_iface_path));
-+	strlcat(sysfs_dev_iscsi_iface_path, "/iscsi_iface", sizeof(sysfs_dev_iscsi_iface_path));
- 
--	n = scandir(sysfs_path, &namelist, trans_filter, alphasort);
-+	n = scandir(sysfs_dev_iscsi_iface_path, &namelist, trans_filter, alphasort);
- 	if (n <= 0)
- 		/* older kernels or some drivers will not have ifaces */
- 		return 0;
--- 
-cgit v1.1-33-g03f6
-
-
-From af02412d3dd3839441ae48e2c9f9c307889d5fc1 Mon Sep 17 00:00:00 2001
-From: Lee Duncan <lduncan at suse.com>
-Date: Wed, 21 Mar 2018 18:44:44 -0700
-Subject: libopeniscsiusr: ensure sysfs pathname doesn't overflow.
-
-When instantiating a pathname in sysfs, make sure there's enough
-room to prevent possible overflow.
-
-Found by gcc-8, which gave this warning:
-> [54s] sysfs.c:326:48: error: '/iscsi_host/' directive output may be
->    truncated writing 12 bytes into a region of size between 1 and 4096
->    [-Werror=format-truncation=]
----
- libopeniscsiusr/sysfs.c | 15 +++++++++++++--
- 1 file changed, 13 insertions(+), 2 deletions(-)
-
-diff --git a/libopeniscsiusr/sysfs.c b/libopeniscsiusr/sysfs.c
-index 70298f2..6f590f4 100644
---- a/libopeniscsiusr/sysfs.c
-+++ b/libopeniscsiusr/sysfs.c
-@@ -311,6 +311,9 @@ int _iscsi_host_id_of_session(struct iscsi_context *ctx, uint32_t sid,
- 	int n = 0;
- 	const char *host_id_str = NULL;
- 	int i = 0;
-+	const char iscsi_host_dir_str[] = "/iscsi_host/";
-+	const unsigned int iscsi_host_dir_strlen = strlen(iscsi_host_dir_str);
-+
- 
- 	assert(ctx != NULL);
- 	assert(sid != 0);
-@@ -323,8 +326,16 @@ int _iscsi_host_id_of_session(struct iscsi_context *ctx, uint32_t sid,
- 
- 	_good(sysfs_get_dev_path(ctx, sys_se_dir_path, sys_dev_path), rc, out);
- 
--	snprintf(sys_scsi_host_dir_path, PATH_MAX, "%s/iscsi_host/",
--		 sys_dev_path);
-+	if ((strlen(sys_dev_path) + iscsi_host_dir_strlen) >= PATH_MAX) {
-+		rc = LIBISCSI_ERR_SYSFS_LOOKUP;
-+		_error(ctx, "Pathname too long: %s%s",
-+		       sys_dev_path, iscsi_host_dir_str);
-+		goto out;
-+	}
-+
-+	strncpy(sys_scsi_host_dir_path, sys_dev_path, PATH_MAX);
-+	strncat(sys_scsi_host_dir_path, iscsi_host_dir_str,
-+		PATH_MAX - iscsi_host_dir_strlen);
- 
- 	n = scandir(sys_scsi_host_dir_path, &namelist, _scan_filter_skip_dot,
- 		    alphasort);
--- 
-cgit v1.1-33-g03f6
-
-
-From 47de9586abd04e412e53232c88d7b1c8f89034f6 Mon Sep 17 00:00:00 2001
-From: Lee Duncan <lduncan at suse.com>
-Date: Wed, 21 Mar 2018 18:59:40 -0700
-Subject: Ensure sysfs pathname doesn't overflow.
-
-When instantiating a pathname in sysfs, make sure there's enough
-room to prevent possible overflow.
-
-Found by gcc-8, which gave this warning:
->    [   13s] iscsi_sysfs.c: In function 'iscsi_sysfs_for_each_device':
->    [   13s] iscsi_sysfs.c:1822:44: warning: '%s' directive output may
->             be truncated writing up to 511 bytes into a region of size
->             between 1 and 512 [-Wformat-truncation=]
->    [   13s]   snprintf(path_full, sizeof(path_full), "%s%s/device/target%d:0:%d",
->    [   13s]                                             ^~
->    [   13s]     sysfs_path, devpath, host_no, target);
->    [   13s]                 ~~~~~~~
->    [   13s] iscsi_sysfs.c:1822:41: note: using the range
->             [-2147483648, 2147483647] for directive argument
->    [   13s]   snprintf(path_full, sizeof(path_full), "%s%s/device/target%d:0:%d",
->    [   13s]                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
----
- usr/iscsi_sysfs.c | 9 ++++++++-
- 1 file changed, 8 insertions(+), 1 deletion(-)
-
-diff --git a/usr/iscsi_sysfs.c b/usr/iscsi_sysfs.c
-index 031ac1d..a510694 100644
---- a/usr/iscsi_sysfs.c
-+++ b/usr/iscsi_sysfs.c
-@@ -1806,7 +1806,7 @@ int iscsi_sysfs_for_each_device(void *data, int host_no, uint32_t sid,
- 	int h, b, t, l, i, n, err = 0, target;
- 	char devpath[PATH_SIZE];
- 	char id[NAME_SIZE];
--	char path_full[PATH_SIZE];
-+	char path_full[3*PATH_SIZE];
- 
- 	target = get_target_no_from_sid(sid, &err);
- 	if (err)
-@@ -1821,6 +1821,13 @@ int iscsi_sysfs_for_each_device(void *data, int host_no, uint32_t sid,
- 
- 	snprintf(path_full, sizeof(path_full), "%s%s/device/target%d:0:%d",
- 		 sysfs_path, devpath, host_no, target);
-+
-+	if (strlen(path_full) > PATH_SIZE) {
-+		log_debug(3, "Could not lookup devpath for %s %s (too long)",
-+			  ISCSI_SESSION_SUBSYS, id);
-+		return ISCSI_ERR_SYSFS_LOOKUP;
-+	}
-+
- 	n = scandir(path_full, &namelist, trans_filter,
- 		    alphasort);
- 	if (n <= 0)
--- 
-cgit v1.1-33-g03f6
-

Added: 0001-libkmod.patch
===================================================================
--- 0001-libkmod.patch	                        (rev 0)
+++ 0001-libkmod.patch	2018-10-17 20:56:45 UTC (rev 395087)
@@ -0,0 +1,35 @@
+diff --git a/libopeniscsiusr/Makefile b/libopeniscsiusr/Makefile
+index bf7c96c..589c69b 100644
+--- a/libopeniscsiusr/Makefile
++++ b/libopeniscsiusr/Makefile
+@@ -44,7 +44,7 @@ OBJS = context.o misc.o session.o sysfs.o iface.o idbm.o node.o default.o
+ CFLAGS ?= -O2 -g
+ CFLAGS += -Wall -Werror -Wextra -fvisibility=hidden -fPIC
+ 
+-LIBADD =
++LIBADD = -lkmod
+ 
+ all: $(LIBS) $(LIBS_MAJOR) $(TESTS) doc
+ 
+diff --git a/usr/Makefile b/usr/Makefile
+index f9445ad..13a719d 100644
+--- a/usr/Makefile
++++ b/usr/Makefile
+@@ -36,7 +36,7 @@ CFLAGS ?= -O2 -g
+ WARNFLAGS ?= -Wall -Wstrict-prototypes
+ CFLAGS += $(WARNFLAGS) -I../include -I. -D_GNU_SOURCE \
+ 	  -I$(TOPDIR)/libopeniscsiusr
+-ISCSI_LIB = -L$(TOPDIR)/libopeniscsiusr -lopeniscsiusr
++ISCSI_LIB = -L$(TOPDIR)/libopeniscsiusr -lopeniscsiusr -lkmod
+ PROGRAMS = iscsid iscsiadm iscsistart
+ 
+ # libc compat files
+@@ -60,7 +60,7 @@ all: $(PROGRAMS)
+ 
+ iscsid: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(DISCOVERY_SRCS) \
+ 	iscsid.o session_mgmt.o discoveryd.o mntcheck.o
+-	$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@  -lisns -lcrypto -lrt -lmount $(ISCSI_LIB)
++	$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@  -lisns -lcrypto -lrt -lmount -lsystemd $(ISCSI_LIB)
+ 
+ iscsiadm: $(ISCSI_LIB_SRCS) $(DISCOVERY_SRCS) iscsiadm.o session_mgmt.o mntcheck.o
+ 	$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -lisns -lcrypto -lmount $(ISCSI_LIB)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2018-10-17 20:51:07 UTC (rev 395086)
+++ PKGBUILD	2018-10-17 20:56:45 UTC (rev 395087)
@@ -2,36 +2,30 @@
 # Maintainer: Stefan Kirrmann <stefan.kirrmann at gmail dot com>
 
 pkgname=open-iscsi
-pkgver=2.0.876
-pkgrel=2
-pkgdesc="userland tools"
+pkgver=2.0.877
+pkgrel=1
+pkgdesc='iSCSI userland tools'
 arch=('x86_64')
-url="http://www.open-iscsi.com/"
+url='https://www.open-iscsi.com/'
 license=('GPL')
-depends=('libutil-linux' 'openssl' 'open-isns')
+depends=('libsystemd' 'libutil-linux' 'kmod' 'openssl' 'open-isns')
 install=$pkgname.install
 backup=('etc/iscsi/iscsid.conf'
 	'etc/iscsi/initiatorname.iscsi')
 options=('docs')
 source=("$pkgname-$pkgver.tar.gz::https://github.com/open-iscsi/open-iscsi/archive/$pkgver.tar.gz"
-        '0001-gcc8.patch'
-        'open-iscsi.service')
-sha256sums=('9f01327d5e100ed794dc5083fc18dc4a06a0c29c77b252e21abd1b8f56edd9a7'
-            'a8e6920f5e135dda4d8eb76eb9c5a00f793ed6ccfa9b51006b083c4b8177f171'
-            '7b8e37dd10a909a67ba7f7126f699920639be39adfa65f1d2b2bcd8846e58db7')
+        '0001-libkmod.patch')
+sha256sums=('69eb95b0c39dee2da9d0d751bfdcdb8d11f9d37390de15c1a0b4558f9d0c4a57'
+            'cacf5d5826868bc4afe4df6ac5721aafb75f82469c50d6d24cd7d685471a9cd8')
 
 prepare() {
   cd "$srcdir"/${pkgname}-${pkgver}
 
-  # Merge pull request #94 from gonzoleeman/gcc-8-fixes
-  # Gcc 8 fixes -- clean up some string handling corner cases, and to make compiler happy
-  patch -Np1 < '../0001-gcc8.patch'
+  # fix build with libkmod
+  patch -Np1 < ../0001-libkmod.patch
 
   # include iscsistart in the package
   sed -i -e '/^PROGRAMS = /s/$/ usr\/iscsistart/' Makefile
-
-  # build breaks if the openslp package is installed
-  sed -i -e 's/\(\.\/configure\)/ \1 --without-slp/g' Makefile
 }
 
 build() {
@@ -45,15 +39,16 @@
 
   make DESTDIR="$pkgdir" LIB_DIR=/usr/lib install
 
-  install -D -m644 "$srcdir"/${pkgname}-${pkgver}/etc/iscsid.conf "$pkgdir"/etc/iscsi
-  install -D -m644 "$srcdir"/open-iscsi.service "$pkgdir"/usr/lib/systemd/system/open-iscsi.service
+  install -D -m0644 etc/systemd/iscsid.service "$pkgdir"/usr/lib/systemd/system/iscsid.service
+  install -D -m0644 etc/systemd/iscsi.service "$pkgdir"/usr/lib/systemd/system/iscsi.service
 
-  echo -n >"$pkgdir"/etc/iscsi/initiatorname.iscsi
+  install -D -m0644 "$srcdir"/${pkgname}-${pkgver}/etc/iscsid.conf "$pkgdir"/etc/iscsi
+  echo -n > "$pkgdir"/etc/iscsi/initiatorname.iscsi
 
   # copy docs
   mkdir -p "$pkgdir"/usr/share/doc/${pkgname}
-  install -m644 Changelog "$pkgdir"/usr/share/doc/${pkgname}/
-  install -m644 README "$pkgdir"/usr/share/doc/${pkgname}/
+  install -m0644 Changelog "$pkgdir"/usr/share/doc/${pkgname}/
+  install -m0644 README "$pkgdir"/usr/share/doc/${pkgname}/
 
   mv "$pkgdir"/sbin "$pkgdir"/usr/bin
 }

Deleted: open-iscsi.service
===================================================================
--- open-iscsi.service	2018-10-17 20:51:07 UTC (rev 395086)
+++ open-iscsi.service	2018-10-17 20:56:45 UTC (rev 395087)
@@ -1,10 +0,0 @@
-[Unit]
-Description=Open iSCSI Daemon
-After=network.target
-
-[Service]
-Type=forking
-ExecStart=/sbin/iscsid
-
-[Install]
-WantedBy=multi-user.target



More information about the arch-commits mailing list