Hello community,

here is the log from the commit of package open-iscsi for openSUSE:Factory 
checked in at 2020-06-11 14:44:48
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/open-iscsi (Old)
 and      /work/SRC/openSUSE:Factory/.open-iscsi.new.3606 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "open-iscsi"

Thu Jun 11 14:44:48 2020 rev:96 rq:812704 version:unknown

Changes:
--------
--- /work/SRC/openSUSE:Factory/open-iscsi/open-iscsi.changes    2020-05-05 
18:54:01.613236535 +0200
+++ /work/SRC/openSUSE:Factory/.open-iscsi.new.3606/open-iscsi.changes  
2020-06-11 14:45:03.749445513 +0200
@@ -1,0 +2,31 @@
+Mon Jun  8 16:42:42 UTC 2020 - Lee Duncan <[email protected]>
+
+- Merged in latest upstream. Summary:
+ * Let initiator name be created by iscsi-init.service.
+ * iscsi: fix fd leak
+ * iscsi: Add break to while loop
+ * Fix compiler complaint about string copy in iscsiuio
+ * Fix a compiler complaint about writing one byte
+ * Fix issue with zero-length arrays at end of struct
+ * Add iscsi-init.service
+ * Proper disconnect of TCP connection
+ * Fix SIGPIPE loop in signal handler
+ * Update iscsi-iname.c
+ * log:modify iSCSI shared memory permissions for logs
+ * Ignore iface.example in iface match checks
+ * More changes for musl.
+ * Fix type mismatch under musl.
+ * Change include of <sys/poll.h> to <poll.h>
+ * iscsi-iname: fix iscsi-iname -p access NULL pointer without given IQN prefix
+
+ Note that the "Add iscsi-init.service" change adds a new systemd
+ service called "iscsi-init", that creates the iSCSI initiator name
+ file /etc/iscsi/initiatorname.iscsi, if and only if it does not
+ exist. This obviates the need to do this from the SPEC file, now
+ updated.
+
+ Since this was not a version-number update, in addition to modifying
+ the SPEC file, also updates:
+  * open-iscsi-SUSE-latest.diff.bz2
+
+-------------------------------------------------------------------

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

Other differences:
------------------
++++++ open-iscsi.spec ++++++
--- /var/tmp/diff_new_pack.CmHdDl/_old  2020-06-11 14:45:05.013449195 +0200
+++ /var/tmp/diff_new_pack.CmHdDl/_new  2020-06-11 14:45:05.017449206 +0200
@@ -140,9 +140,6 @@
 
 %post
 %{?regenerate_initrd_post}
-if [ ! -f %{_sysconfdir}/iscsi/initiatorname.iscsi ] ; then
-    /sbin/iscsi-gen-initiatorname
-fi
 %service_add_post iscsi.service iscsid.service iscsid.socket
 
 %posttrans
@@ -186,6 +183,7 @@
 %{_sysconfdir}/iscsid.conf
 %{_unitdir}/iscsid.service
 %{_unitdir}/iscsid.socket
+%{_unitdir}/iscsi-init.service
 %{_unitdir}/iscsi.service
 %{_systemdgeneratordir}/ibft-rule-generator
 %{_sbindir}/rciscsi

++++++ open-iscsi-SUSE-latest.diff.bz2 ++++++
--- /var/tmp/diff_new_pack.CmHdDl/_old  2020-06-11 14:45:05.049449300 +0200
+++ /var/tmp/diff_new_pack.CmHdDl/_new  2020-06-11 14:45:05.049449300 +0200
@@ -1,17 +1,52 @@
+diff --git a/Makefile b/Makefile
+index f0ae91449a97..c4f33889616d 100644
+--- a/Makefile
++++ b/Makefile
+@@ -30,6 +30,7 @@ IFACEFILES = etc/iface.example
+ RULESFILES = utils/50-iscsi-firmware-login.rules
+ SYSTEMDFILES = etc/systemd/iscsi.service \
+                          etc/systemd/iscsid.service etc/systemd/iscsid.socket 
\
++                         etc/systemd/iscsi-init.service \
+                          etc/systemd/iscsiuio.service 
etc/systemd/iscsiuio.socket
+ 
+ export DESTDIR prefix INSTALL
+@@ -107,7 +108,7 @@ install: install_programs install_doc install_etc \
+       install_udev_rules
+ 
+ install_user: install_programs install_doc install_etc \
+-      install_initd install_iname install_iface install_udev_rules \
++      install_initd install_iface install_udev_rules \
+       install_libopeniscsiusr
+ 
+ install_udev_rules:
+diff --git a/etc/systemd/iscsi-init.service b/etc/systemd/iscsi-init.service
+new file mode 100644
+index 000000000000..34557bfa8a71
+--- /dev/null
++++ b/etc/systemd/iscsi-init.service
+@@ -0,0 +1,8 @@
++[Unit]
++Description=One time configuration for iscsid.service
++ConditionPathExists=!/etc/iscsi/initiatorname.iscsi
++
++[Service]
++Type=oneshot
++RemainAfterExit=no
++ExecStart=/sbin/iscsi-gen-initiatorname
 diff --git a/etc/systemd/iscsi.service b/etc/systemd/iscsi.service
-index e4758881cb9c..1c286d1fdeda 100644
+index e4758881cb9c..3de873bf0dc5 100644
 --- a/etc/systemd/iscsi.service
 +++ b/etc/systemd/iscsi.service
-@@ -3,7 +3,7 @@ Description=Login and scanning of iSCSI devices
+@@ -3,15 +3,14 @@ Description=Login and scanning of iSCSI devices
  Documentation=man:iscsiadm(8) man:iscsid(8)
  Before=remote-fs.target
  After=network.target network-online.target iscsid.service
 -Requires=iscsid.service
-+Requires=iscsid.socket
- ConditionPathExists=/etc/iscsi/initiatorname.iscsi
+-ConditionPathExists=/etc/iscsi/initiatorname.iscsi
++Requires=iscsid.socket iscsi-init.service
  
  [Service]
-@@ -11,7 +11,7 @@ Type=oneshot
+ Type=oneshot
  ExecStart=/sbin/iscsiadm -m node --loginall=automatic
  ExecStop=/sbin/iscsiadm -m node --logoutall=automatic
  ExecStop=/sbin/iscsiadm -m node --logoutall=manual
@@ -21,14 +56,18 @@
  
  [Install]
 diff --git a/etc/systemd/iscsid.service b/etc/systemd/iscsid.service
-index 4fef168163ca..648ceeaa0f07 100644
+index 4fef168163ca..fb7dc766d700 100644
 --- a/etc/systemd/iscsid.service
 +++ b/etc/systemd/iscsid.service
-@@ -4,6 +4,7 @@ Documentation=man:iscsid(8) man:iscsiuio(8) man:iscsiadm(8)
+@@ -2,8 +2,10 @@
+ Description=Open-iSCSI
+ Documentation=man:iscsid(8) man:iscsiuio(8) man:iscsiadm(8)
  DefaultDependencies=no
- After=network.target iscsiuio.service
+-After=network.target iscsiuio.service
++After=network.target iscsiuio.service iscsi-init.service
  Before=remote-fs-pre.target
 +Wants=remote-fs-pre.target
++Requires=iscsi-init.service
  
  [Service]
  Type=notify
@@ -44,6 +83,295 @@
  
  [Service]
  Type=notify
+diff --git a/include/iscsi_if.h b/include/iscsi_if.h
+index 2d46214c2a60..5a1c61449d66 100644
+--- a/include/iscsi_if.h
++++ b/include/iscsi_if.h
+@@ -841,7 +841,7 @@ struct iscsi_stats {
+        * up to ISCSI_STATS_CUSTOM_MAX
+        */
+       uint32_t custom_length;
+-      struct iscsi_stats_custom custom[0]
++      struct iscsi_stats_custom custom[]
+               __attribute__ ((aligned (sizeof(uint64_t))));
+ };
+ 
+@@ -972,7 +972,7 @@ struct iscsi_offload_host_stats {
+        * up to ISCSI_HOST_STATS_CUSTOM_MAX
+        */
+       uint32_t custom_length;
+-      struct iscsi_host_stats_custom custom[0]
++      struct iscsi_host_stats_custom custom[]
+                __attribute__ ((aligned (sizeof(uint64_t))));
+ };
+ 
+diff --git a/iscsiuio/src/uip/ipv6.c b/iscsiuio/src/uip/ipv6.c
+index 05efa73fcfdd..11cb4e9aa8ec 100644
+--- a/iscsiuio/src/uip/ipv6.c
++++ b/iscsiuio/src/uip/ipv6.c
+@@ -519,7 +519,7 @@ static void ipv6_insert_protocol_chksum(struct ipv6_hdr 
*ipv6)
+        * SRC IP, DST IP, Protocol Data Length, and Next Header.
+        */
+       sum = 0;
+-      ptr = (u16_t *)&ipv6->ipv6_src;
++      ptr = (u16_t *)&ipv6->ipv6_src.addr16[0];
+ 
+       for (i = 0; i < sizeof(struct ipv6_addr); i++) {
+               sum += HOST_TO_NET16(*ptr);
+diff --git a/iscsiuio/src/unix/nic_nl.c b/iscsiuio/src/unix/nic_nl.c
+index f8306563462f..dee462e799ed 100644
+--- a/iscsiuio/src/unix/nic_nl.c
++++ b/iscsiuio/src/unix/nic_nl.c
+@@ -50,7 +50,7 @@
+ #include <linux/netlink.h>
+ #include <iscsi_if.h>
+ #include <sys/ioctl.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/types.h>
+ #include <sys/user.h>
+ #include <sys/socket.h>
+diff --git a/iscsiuio/src/unix/nic_utils.c b/iscsiuio/src/unix/nic_utils.c
+index ec3b91555069..ec4535de0e23 100644
+--- a/iscsiuio/src/unix/nic_utils.c
++++ b/iscsiuio/src/unix/nic_utils.c
+@@ -603,7 +603,10 @@ static int from_uio_find_associated_host(nic_t *nic, int 
uio_minor,
+                               search_filters[path_iterator], alphasort);
+ 
+               switch (count) {
+-              case 1:
++              case 1: {
++                      char *parsed_src;
++                      size_t parsed_size;
++
+                       parsed_name = (*extract_name[path_iterator]) (files);
+                       if (!parsed_name) {
+                               LOG_WARN(PFX "Couldn't find delimiter in: %s",
+@@ -612,15 +615,22 @@ static int from_uio_find_associated_host(nic_t *nic, int 
uio_minor,
+                               break;
+                       }
+ 
+-                      strncpy(name,
+-                              parsed_name +
+-                              extract_name_offset[path_iterator], name_size);
++                      parsed_src = parsed_name + 
extract_name_offset[path_iterator];
++                      parsed_size = strlen(parsed_src);
++                      if (parsed_size >= name_size) {
++                              LOG_WARN(PFX "uio device name too long: %s (max 
%d)",
++                                      parsed_src, (int)name_size - 1);
++                              rc = -EINVAL;
++                      } else {
++                              strncpy(name, parsed_src, name_size);
++                              rc = 0;
++                      }
+ 
+                       free(files[0]);
+                       free(files);
+ 
+-                      rc = 0;
+                       break;
++              }
+ 
+               case 0:
+                       rc = -EINVAL;
+diff --git a/usr/discovery.c b/usr/discovery.c
+index 9ce122e103e8..7dec696fbc80 100644
+--- a/usr/discovery.c
++++ b/usr/discovery.c
+@@ -25,7 +25,7 @@
+ #include <stdint.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/time.h>
+ #include <sys/param.h>
+ #include <sys/socket.h>
+diff --git a/usr/event_poll.c b/usr/event_poll.c
+index 4cf4ce2b3ba4..ffd12a375118 100644
+--- a/usr/event_poll.c
++++ b/usr/event_poll.c
+@@ -23,7 +23,7 @@
+  */
+ #include <stdlib.h>
+ #include <errno.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+ #include <sys/signalfd.h>
+diff --git a/usr/iface.c b/usr/iface.c
+index 323f16752eb5..11f3d2ac8778 100644
+--- a/usr/iface.c
++++ b/usr/iface.c
+@@ -905,6 +905,9 @@ int iface_for_each_iface(void *data, int skip_def, int 
*nr_found,
+                   !strcmp(iface_dent->d_name, ".."))
+                       continue;
+ 
++              if (!strcmp(iface_dent->d_name, "iface.example"))
++                      continue;
++
+               log_debug(5, "iface_for_each_iface found %s",
+                        iface_dent->d_name);
+               iface = iface_alloc(iface_dent->d_name, &err);
+diff --git a/usr/initiator.c b/usr/initiator.c
+index a07f9aa64ab9..5f4bdca35dc1 100644
+--- a/usr/initiator.c
++++ b/usr/initiator.c
+@@ -711,11 +711,7 @@ static void iscsi_login_eh(struct iscsi_conn *conn, 
struct queue_task *qtask,
+                           !iscsi_retry_initial_login(conn))
+                               session_conn_shutdown(conn, qtask, err);
+                       else {
+-                              session->reopen_cnt++;
+-                              session->t->template->ep_disconnect(conn);
+-                              if (iscsi_conn_connect(conn, qtask))
+-                                      queue_delayed_reopen(qtask,
+-                                              ISCSI_CONN_ERR_REOPEN_DELAY);
++                              session_conn_reopen(conn, qtask, 
STOP_CONN_TERM);
+                       }
+                       break;
+               case R_STAGE_SESSION_REDIRECT:
+diff --git a/usr/io.c b/usr/io.c
+index 210a10ad82a6..a46c9f8c5c95 100644
+--- a/usr/io.c
++++ b/usr/io.c
+@@ -24,7 +24,7 @@
+ #include <signal.h>
+ #include <unistd.h>
+ #include <fcntl.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/ioctl.h>
+ #include <netinet/tcp.h>
+ #include <arpa/inet.h>
+diff --git a/usr/iscsi_util.c b/usr/iscsi_util.c
+index fd8fc0cf2a08..db1dc377727f 100644
+--- a/usr/iscsi_util.c
++++ b/usr/iscsi_util.c
+@@ -152,7 +152,9 @@ int increase_max_files(void)
+               log_debug(1, "Could not get file limit (err %d)", errno);
+               return errno;
+       }
+-      log_debug(1, "Max file limits %lu %lu", rl.rlim_cur, rl.rlim_max);
++      log_debug(1, "Max file limits %lu %lu",
++                      (long unsigned)rl.rlim_cur,
++                      (long unsigned)rl.rlim_max);
+ 
+       if (rl.rlim_cur < ISCSI_MAX_FILES)
+               rl.rlim_cur = ISCSI_MAX_FILES;
+@@ -162,7 +164,8 @@ int increase_max_files(void)
+       err = setrlimit(RLIMIT_NOFILE, &rl);
+       if (err) {
+               log_debug(1, "Could not set file limit to %lu/%lu (err %d)",
+-                        rl.rlim_cur, rl.rlim_max, errno);
++                        (long unsigned)rl.rlim_cur,
++                        (long unsigned)rl.rlim_max, errno);
+               return errno;
+       }
+ 
+diff --git a/usr/iscsid.c b/usr/iscsid.c
+index 99d27ab0e315..e50149823bee 100644
+--- a/usr/iscsid.c
++++ b/usr/iscsid.c
+@@ -310,7 +310,12 @@ static void iscsid_shutdown(void)
+ 
+ static void catch_signal(int signo)
+ {
+-      log_debug(1, "pid %d caught signal %d", getpid(), signo);
++      /*
++       * Do not try to call log_debug() if there is a PIPE error
++       * because we can get caught in a PIPE error loop.
++       */
++      if (signo != SIGPIPE)
++              log_debug(1, "pid %d caught signal %d", getpid(), signo);
+ 
+       /* In foreground mode, treat SIGINT like SIGTERM */
+       if (!daemonize && signo == SIGINT)
+diff --git a/usr/iscsistart.c b/usr/iscsistart.c
+index 00a9c78a53b5..ee810f7ae266 100644
+--- a/usr/iscsistart.c
++++ b/usr/iscsistart.c
+@@ -30,7 +30,6 @@
+ #include <time.h>
+ #include <sys/mman.h>
+ #include <sys/utsname.h>
+-#include <sys/signal.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+ 
+diff --git a/usr/log.c b/usr/log.c
+index 6e16e7cef3c7..2fc1850e26ad 100644
+--- a/usr/log.c
++++ b/usr/log.c
+@@ -73,7 +73,7 @@ static int logarea_init (int size)
+       logdbg(stderr,"enter logarea_init\n");
+ 
+       if ((shmid = shmget(IPC_PRIVATE, sizeof(struct logarea),
+-                          0644 | IPC_CREAT | IPC_EXCL)) == -1) {
++                          0600 | IPC_CREAT | IPC_EXCL)) == -1) {
+               syslog(LOG_ERR, "shmget logarea failed %d", errno);
+               return 1;
+       }
+@@ -93,7 +93,7 @@ static int logarea_init (int size)
+               size = DEFAULT_AREA_SIZE;
+ 
+       if ((shmid = shmget(IPC_PRIVATE, size,
+-                          0644 | IPC_CREAT | IPC_EXCL)) == -1) {
++                          0600 | IPC_CREAT | IPC_EXCL)) == -1) {
+               syslog(LOG_ERR, "shmget msg failed %d", errno);
+               free_logarea();
+               return 1;
+@@ -114,7 +114,7 @@ static int logarea_init (int size)
+       la->tail = la->start;
+ 
+       if ((shmid = shmget(IPC_PRIVATE, MAX_MSG_SIZE + sizeof(struct logmsg),
+-                          0644 | IPC_CREAT | IPC_EXCL)) == -1) {
++                          0600 | IPC_CREAT | IPC_EXCL)) == -1) {
+               syslog(LOG_ERR, "shmget logmsg failed %d", errno);
+               free_logarea();
+               return 1;
+diff --git a/usr/mgmt_ipc.c b/usr/mgmt_ipc.c
+index 51267c133fd8..c292161f6cea 100644
+--- a/usr/mgmt_ipc.c
++++ b/usr/mgmt_ipc.c
+@@ -26,6 +26,7 @@
+ #include <unistd.h>
+ #include <pwd.h>
+ #include <sys/un.h>
++#include <string.h>
+ 
+ #include "iscsid.h"
+ #include "idbm.h"
+diff --git a/usr/netlink.c b/usr/netlink.c
+index d42ca4fb0791..22cad8344b0e 100644
+--- a/usr/netlink.c
++++ b/usr/netlink.c
+@@ -30,7 +30,7 @@
+ #include <asm/types.h>
+ #include <sys/socket.h>
+ #include <sys/types.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <linux/netlink.h>
+ 
+ #include "types.h"
+diff --git a/usr/statics.c b/usr/statics.c
+index 59fb044d3f68..f59729bad837 100644
+--- a/usr/statics.c
++++ b/usr/statics.c
+@@ -1,6 +1,6 @@
+ #include <unistd.h>
+ #include <pwd.h>
+-#include <sys/errno.h>
++#include <errno.h>
+ #include <sys/types.h>
+ 
+ static struct passwd root_pw = {
+@@ -17,4 +17,3 @@ getpwuid(uid_t uid)
+               return 0;
+       }
+ }
+-
 diff --git a/utils/Makefile b/utils/Makefile
 index f65f1e79008c..aed3bb0a694f 100644
 --- a/utils/Makefile
@@ -57,6 +385,35 @@
  PROGRAMS = iscsi-iname
  
  all: $(PROGRAMS)
+diff --git a/utils/fwparam_ibft/fwparam_ibft.c 
b/utils/fwparam_ibft/fwparam_ibft.c
+index 52edac103bf3..e68e50342650 100644
+--- a/utils/fwparam_ibft/fwparam_ibft.c
++++ b/utils/fwparam_ibft/fwparam_ibft.c
+@@ -463,6 +463,7 @@ fwparam_ibft(struct boot_context *context, const char 
*filepath)
+       if (stat(filename, &buf)!=0) {
+               fprintf(stderr, "Could not stat file %s: %s (%d)\n",
+                       filename, strerror(errno), errno);
++              close(fd);
+               return -1;
+       }
+       /* And if not zero use that size */
+diff --git a/utils/fwparam_ibft/fwparam_sysfs.c 
b/utils/fwparam_ibft/fwparam_sysfs.c
+index a0cd1c70a216..87fd6d4a40db 100644
+--- a/utils/fwparam_ibft/fwparam_sysfs.c
++++ b/utils/fwparam_ibft/fwparam_sysfs.c
+@@ -115,8 +115,11 @@ static int get_iface_from_device(char *id, struct 
boot_context *context)
+                               break;
+                       }
+ 
+-                      if (sscanf(dent->d_name, "net:%s", context->iface) != 1)
++                      if (sscanf(dent->d_name, "net:%s", context->iface) != 
1) {
+                               rc = EINVAL;
++                              break;
++                      }
++
+                       rc = 0;
+                       break;
+               } else {
 diff --git a/utils/iscsi-iname.c b/utils/iscsi-iname.c
 index da850dca0088..0f587e1e0d36 100644
 --- a/utils/iscsi-iname.c


Reply via email to