From 141d6d07117e93ea19f05c4003e8b97d7a5c50646fe1cc5f7e884ed46c97afd2 Mon Sep 17 00:00:00 2001 From: Lee Duncan Date: Wed, 6 Apr 2022 17:39:28 +0000 Subject: [PATCH] Accepting request 967142 from home:lee_duncan:branches:Base:System Update to version v1.0.82 (from 1.0.74) OBS-URL: https://build.opensuse.org/request/show/967142 OBS-URL: https://build.opensuse.org/package/show/Base:System/tgt?expand=0&rev=51 --- _service | 4 +- _servicedata | 2 +- tgt-Fix-gcc7-string-truncation-warnings.patch | 102 ------------------ tgt-v1.0.82.tar.gz | 3 + tgt.changes | 39 +++++++ tgt.spec | 15 ++- v1.0.74.tar.gz | 3 - 7 files changed, 52 insertions(+), 116 deletions(-) delete mode 100644 tgt-Fix-gcc7-string-truncation-warnings.patch create mode 100644 tgt-v1.0.82.tar.gz delete mode 100644 v1.0.74.tar.gz diff --git a/_service b/_service index 9a19051..5584261 100644 --- a/_service +++ b/_service @@ -4,8 +4,8 @@ https://github.com/fujita/tgt.git tgt - v1.0.74 - 1.0.74 + v1.0.82 + v1.0.82 enable diff --git a/_servicedata b/_servicedata index d425a52..188cbbf 100644 --- a/_servicedata +++ b/_servicedata @@ -1,4 +1,4 @@ https://github.com/fujita/tgt.git - f33f6b73d3bfac8b3e44f068d02f90627b407f4e \ No newline at end of file + fd4ca0546aa20fa9627c41ca2028db26e11f8d56 \ No newline at end of file diff --git a/tgt-Fix-gcc7-string-truncation-warnings.patch b/tgt-Fix-gcc7-string-truncation-warnings.patch deleted file mode 100644 index 5756f9d..0000000 --- a/tgt-Fix-gcc7-string-truncation-warnings.patch +++ /dev/null @@ -1,102 +0,0 @@ -From 2de8bebe132e3b998bf4848d0bd22b50367ad4b8 Mon Sep 17 00:00:00 2001 -From: Lee Duncan -Date: Sat, 16 Feb 2019 10:29:19 -0800 -Subject: [PATCH] Fix gcc7 string truncation warnings. - -Mostly, this is fixed by checking the legnth -of strings to be copied, making sure they will -fit where they are being copied to, and -erroring out if the copy will not fit. Then -we can just use strcpy(). We also use -scsi_sprintf() for copying to SCSI structures, -with their special requirements. ---- - usr/mgmt.c | 9 +++++++-- - usr/smc.c | 9 +++++++-- - usr/spc.c | 9 ++++++--- - usr/tgtadm.c | 6 +++++- - 4 files changed, 25 insertions(+), 8 deletions(-) - -diff --git a/usr/mgmt.c b/usr/mgmt.c -index de23f1469494..00a4e08c01dc 100644 ---- a/usr/mgmt.c -+++ b/usr/mgmt.c -@@ -797,11 +797,16 @@ int ipc_init(void) - goto close_lock_fd; - } - -- snprintf(mgmt_path, sizeof(mgmt_path), "%s.%d", path, control_port); -+ snprintf(mgmt_path, sizeof(mgmt_path) - 1, "%s.%d", path, control_port); -+ if (strlen(mgmt_path) > (sizeof(addr.sun_path) - 1)) { -+ eprintf("managment path too long: %s\n", mgmt_path); -+ goto close_ipc_fd; -+ } - unlink(mgmt_path); - memset(&addr, 0, sizeof(addr)); - addr.sun_family = AF_LOCAL; -- strncpy(addr.sun_path, mgmt_path, sizeof(addr.sun_path)); -+ /* no need for strncpy because we already checked length */ -+ strcpy(addr.sun_path, mgmt_path); - - err = bind(fd, (struct sockaddr *) &addr, sizeof(addr)); - if (err) { -diff --git a/usr/smc.c b/usr/smc.c -index b80aba272909..bbc7b7fc7b88 100644 ---- a/usr/smc.c -+++ b/usr/smc.c -@@ -732,8 +732,13 @@ static tgtadm_err config_slot(struct scsi_lu *lu, struct tmp_param *tmp) - adm_err = TGTADM_SUCCESS; - break; - } -- strncpy(s->barcode, tmp->barcode, sizeof(s->barcode)); -- strncpy(s->volume_tag, tmp->volume_tag, sizeof(s->volume_tag)); -+ if (strlen(tmp->barcode) > sizeof(s->barcode) || -+ strlen(tmp->volume_tag) > sizeof(s->volume_tag)) { -+ eprintf("barcode or volume tag too large?"); -+ break; -+ } -+ strcpy(s->barcode, tmp->barcode); -+ strcpy(s->volume_tag, tmp->volume_tag); - set_slot_full(s, 0, NULL); - adm_err = TGTADM_SUCCESS; - break; -diff --git a/usr/spc.c b/usr/spc.c -index 82a6ec9ee863..902d5bf4a60b 100644 ---- a/usr/spc.c -+++ b/usr/spc.c -@@ -289,9 +289,12 @@ int spc_inquiry(int host_no, struct scsi_cmd *cmd) - data[7] = 0x02; - - memset(data + 8, 0x20, 28); -- strncpy((char *)data + 8, attrs->vendor_id, VENDOR_ID_LEN); -- strncpy((char *)data + 16, attrs->product_id, PRODUCT_ID_LEN); -- strncpy((char *)data + 32, attrs->product_rev, PRODUCT_REV_LEN); -+ scsi_sprintf((char *)data + 8, VENDOR_ID_LEN, "%-*s", -+ VENDOR_ID_LEN, attrs->vendor_id); -+ scsi_sprintf((char *)data + 16, PRODUCT_ID_LEN, "%-*s", -+ PRODUCT_ID_LEN, attrs->product_id); -+ scsi_sprintf((char *)data + 32, PRODUCT_REV_LEN, "%-*s", -+ PRODUCT_REV_LEN, attrs->product_rev); - - desc = (uint16_t *)(data + 58); - for (i = 0; i < ARRAY_SIZE(attrs->version_desc); i++) -diff --git a/usr/tgtadm.c b/usr/tgtadm.c -index 5572c3888a80..cb3eb1cd126f 100644 ---- a/usr/tgtadm.c -+++ b/usr/tgtadm.c -@@ -224,7 +224,11 @@ static int ipc_mgmt_connect(int *fd) - snprintf(mgmt_path, sizeof(mgmt_path), "%s.%d", - path, control_port); - -- strncpy(addr.sun_path, mgmt_path, sizeof(addr.sun_path)); -+ if (strlen(mgmt_path) > (sizeof(addr.sun_path) - 1)) { -+ eprintf("management path too long: %s\n", mgmt_path); -+ return EINVAL; -+ } -+ strcpy(addr.sun_path, mgmt_path); - - err = connect(*fd, (struct sockaddr *) &addr, sizeof(addr)); - if (err < 0) --- -2.16.4 - diff --git a/tgt-v1.0.82.tar.gz b/tgt-v1.0.82.tar.gz new file mode 100644 index 0000000..1bbf77a --- /dev/null +++ b/tgt-v1.0.82.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:063faa1db0585bd61d3610ca5e51c710a44c06329cf8fe316698aef9e5cba232 +size 313941 diff --git a/tgt.changes b/tgt.changes index 38f96a5..0d12e64 100644 --- a/tgt.changes +++ b/tgt.changes @@ -1,3 +1,42 @@ +------------------------------------------------------------------- +Tue Apr 5 19:01:02 UTC 2022 - Lee Duncan + +- Update to version v1.0.82 (from 1.0.74): + * tgt 1.0.82 + * README: minor improvement + * Fix FMK and other flags. sg return good length and sense len. Not needed, additional condition. LTO streamer not work with check only ILI flag, need check FMK and may be other. Without thois check working fine. Test on LTO1 and LTO5 streamers. + * tgt 1.0.81 + * README: use markdown format + * Add LICENSE file + * replace sourceforge with github + * tgt 1.0.80 + * scripts/checkpatch.pl: escape literal left braces + * Replace __packed with __attribute__(...) + * Avoid passing NULL pointer to printf + * set INFORMATION field on COMPARE AND WRITE miscompare + * add helper to fill sense INFORMATION field + * Clean up error handling + * target: replace bzero with memset + * CHAP_AUTH_STATE_RESPONSE belongs to auth_state + * After rewind option, la->tail may equal la->head. This causes the old logmsg to be lost + * tgt 1.0.79 + * fix coding style in log.h + * tgt 1.0.78 + * tgtd: support pid file for tgtd daemon + * iscsi_tcp: add support for listening on random port + * iscsi_tcp: fix compile warning + * iscsi_tcp: Replace deprecated valloc function + * tgt 1.0.77 + * spc: implement spc 0xb1 and support rotation rate + * tgt 1.0.76 + * fix segmentation fault caused by scsi_sprintf + * tgt 1.0.75 + * Fix gcc7 string truncation warnings. + * Update README + This removed the need for the following patch (in the code now): + * tgt-Fix-gcc7-string-truncation-warnings.patch + The SPEC file was also updated to match updated filenames. + ------------------------------------------------------------------- Wed Nov 24 15:09:05 UTC 2021 - Johannes Segitz diff --git a/tgt.spec b/tgt.spec index 763d467..7c4f6f6 100644 --- a/tgt.spec +++ b/tgt.spec @@ -1,7 +1,7 @@ # # spec file for package tgt # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -22,20 +22,19 @@ %endif Name: tgt -Version: 1.0.74 +Version: v1.0.82 Release: 0 Summary: Generic Linux target framework (tgt) License: GPL-2.0-only Group: System/Daemons URL: http://stgt.sourceforge.net/ -Source: https://github.com/fujita/%{name}/archive/v%{version}.tar.gz +Source: %{name}-%{version}.tar.gz Source1: %{name}d.service Source4: sysconfig.%{name} Patch1: %{name}-fix-build Patch2: setup-tgt-conf-d.patch Patch3: %{name}-include-sys-macros-for-major.patch -Patch4: %{name}-Fix-gcc7-string-truncation-warnings.patch -Patch5: harden_tgtd.service.patch +Patch5: harden_tgtd.service.patch BuildRequires: docbook-xsl-stylesheets BuildRequires: libaio-devel BuildRequires: libxslt @@ -59,7 +58,6 @@ user-space daemon and tools (i.e. they completely runs in user space). %patch1 -p1 %patch2 -p1 %patch3 -p1 -%patch4 -p1 %patch5 -p1 %build @@ -97,9 +95,10 @@ ln -sf service %{buildroot}/%{_sbindir}/rc%{name}d %config %attr(0644,root,root) %{_sysconfdir}/tgt/targets.conf %{_fillupdir}/sysconfig.tgt %{_unitdir}/%{name}d.service -%doc README doc/README.iscsi doc/README.iser doc/README.lu_configuration +%doc README.md doc/README.iscsi doc/README.iser doc/README.lu_configuration %doc doc/README.mmc doc/README.passthrough doc/README.sbcjukebox doc/README.ssc -%doc doc/README.rbd doc/tmf.txt +%doc doc/README.rbd doc/README.glfs doc/README.sheepdog doc/README.vtl +%doc doc/tmf.txt %doc %_defaultdocdir/%name/examples %doc %_defaultdocdir/%name/html %{_mandir}/man5/* diff --git a/v1.0.74.tar.gz b/v1.0.74.tar.gz deleted file mode 100644 index 5d36724..0000000 --- a/v1.0.74.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bfc202790d5326d7a18bd3928b4bb204ffb0acf443a5ec5c16a1a0fbc53be99f -size 296992