Compare commits
10 Commits
6b0691445f
...
0d5ca40a7b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d5ca40a7b | ||
|
|
b1a0241609 | ||
|
|
0c09206658 | ||
|
|
4b116dbd7a | ||
|
|
8753226a16 | ||
|
|
74dc5cf832 | ||
|
|
d2d2a1edd8 | ||
|
|
f4863df394 | ||
|
|
5215822e04 | ||
|
|
626067bc9e |
@ -1,21 +0,0 @@
|
||||
commit ed5ff9b9505e50b545e86dfbdd32077f0ddda0cb
|
||||
Author: Taylor Jakobson <tjakobs@us.ibm.com>
|
||||
Date: Thu Feb 1 14:44:32 2018 -0600
|
||||
|
||||
Use signed char instead of char
|
||||
|
||||
Python3 does not have the "character" type, use signed char instead.
|
||||
|
||||
diff --git a/targetcli/ui_backstore.py b/targetcli/ui_backstore.py
|
||||
index 3a2db10..5af448f 100644
|
||||
--- a/targetcli/ui_backstore.py
|
||||
+++ b/targetcli/ui_backstore.py
|
||||
@@ -536,7 +536,7 @@ class UIBlockBackstore(UIBackstore):
|
||||
except (OSError, IOError):
|
||||
raise ExecutionError("Could not open %s" % dev)
|
||||
# ioctl returns an int. Provision a buffer for it
|
||||
- buf = array.array('c', [chr(0)] * 4)
|
||||
+ buf = array.array('b', [0] * 4)
|
||||
try:
|
||||
fcntl.ioctl(f, BLKROGET, buf)
|
||||
except (OSError, IOError):
|
||||
25
Avoild-print-error-stack.patch
Normal file
25
Avoild-print-error-stack.patch
Normal file
@ -0,0 +1,25 @@
|
||||
From b4632c05d8c0a51460fb84ea70820f5136105fff Mon Sep 17 00:00:00 2001
|
||||
From: Mingzhe Zou <zoumingzhe@qq.com>
|
||||
Date: Mon, 27 Mar 2023 16:42:43 +0800
|
||||
Subject: [PATCH] targetcli: avoild Ctrl+C print error stack
|
||||
|
||||
---
|
||||
scripts/targetcli | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/scripts/targetcli b/scripts/targetcli
|
||||
index f00bffc..89a8188 100755
|
||||
--- a/scripts/targetcli
|
||||
+++ b/scripts/targetcli
|
||||
@@ -326,4 +326,7 @@ def main():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
- main()
|
||||
+ try:
|
||||
+ main()
|
||||
+ except KeyboardInterrupt:
|
||||
+ pass
|
||||
--
|
||||
2.27.0
|
||||
|
||||
48
Fix-changing-savedir-directory-mode.patch
Normal file
48
Fix-changing-savedir-directory-mode.patch
Normal file
@ -0,0 +1,48 @@
|
||||
From b8eb1933d4fdcbe806edead8cfa94879d0fc2015 Mon Sep 17 00:00:00 2001
|
||||
From: Lee Duncan <lduncan@suse.com>
|
||||
Date: Mon, 24 Apr 2023 10:34:39 -0700
|
||||
Subject: [PATCH] Fix changing savedir directory mode
|
||||
|
||||
Commit 9f5764dac39b ("saveconfig: set right perms on /etc/target/ dir")
|
||||
fixed CVE-2020-13867 by ensuring that the mode of the target
|
||||
meta-data directory (/etc/target) was always mode 0600. But users
|
||||
can specify a different directory, such as "/tmp", and we don't
|
||||
want targetcli changing the mode of such directories to 0600. So
|
||||
only change the mode of the directory, when saving a config file,
|
||||
if the directory is /etc/target.
|
||||
|
||||
---
|
||||
targetcli/ui_root.py | 10 ++++++----
|
||||
1 file changed, 6 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/targetcli/ui_root.py b/targetcli/ui_root.py
|
||||
index 39e5ee9..79ee985 100644
|
||||
--- a/targetcli/ui_root.py
|
||||
+++ b/targetcli/ui_root.py
|
||||
@@ -34,8 +34,9 @@ from .ui_backstore import complete_path, UIBackstores
|
||||
from .ui_node import UINode
|
||||
from .ui_target import UIFabricModule
|
||||
|
||||
-default_save_file = "/etc/target/saveconfig.json"
|
||||
-universal_prefs_file = "/etc/target/targetcli.conf"
|
||||
+default_target_dir = "/etc/target"
|
||||
+default_save_file = os.path.join(default_target_dir, "saveconfig.json")
|
||||
+universal_prefs_file = os.path.join(default_target_dir, "targetcli.conf")
|
||||
|
||||
class UIRoot(UINode):
|
||||
'''
|
||||
@@ -112,8 +113,9 @@ class UIRoot(UINode):
|
||||
finally:
|
||||
os.umask(umask_original)
|
||||
else:
|
||||
- if (os.stat(dirname).st_mode & 0o777) != mode:
|
||||
- os.chmod(dirname, mode)
|
||||
+ if dirname == default_target_dir:
|
||||
+ if (os.stat(dirname).st_mode & 0o777) != mode:
|
||||
+ os.chmod(dirname, mode)
|
||||
|
||||
def _save_backups(self, savefile):
|
||||
'''
|
||||
--
|
||||
2.23.0
|
||||
|
||||
BIN
targetcli-fb-2.1.54.tar.gz
Normal file
BIN
targetcli-fb-2.1.54.tar.gz
Normal file
Binary file not shown.
@ -1,14 +1,15 @@
|
||||
Name: targetcli
|
||||
Version: 2.1.fb48
|
||||
Release: 9
|
||||
License: ASL 2.0
|
||||
Summary: Generic SCSI target CLI shell
|
||||
Version: 2.1.54
|
||||
Release: 3
|
||||
URL: https://github.com/open-iscsi/targetcli-fb
|
||||
Source: https://github.com/open-iscsi/targetcli-fb/archive/v2.1.fb48.tar.gz
|
||||
Patch0000: 0000-signed-char.patch
|
||||
Source: https://github.com/open-iscsi/targetcli-fb/archive/v%{version}/targetcli-fb-%{version}.tar.gz
|
||||
Patch01: Fix-changing-savedir-directory-mode.patch
|
||||
Patch02: Avoild-print-error-stack.patch
|
||||
BuildArch: noarch
|
||||
BuildRequires: python3-devel python3-setuptools
|
||||
Requires: python3-rtslib target-restore python3-configshell python3-six python3-dbus python3-gobject
|
||||
BuildRequires: python3-devel python3-setuptools systemd
|
||||
Requires: python3-rtslib target-restore python3-configshell python3-six python3-dbus python3-gobject-base
|
||||
|
||||
%description
|
||||
Targetcli is an administration tool for managing storage targets
|
||||
@ -24,24 +25,41 @@ Help document for the %{name} package.
|
||||
%autosetup -n targetcli-fb-%{version} -p1
|
||||
|
||||
%build
|
||||
%{__python3} setup.py build
|
||||
gzip --stdout targetcli.8 > targetcli.8.gz
|
||||
%py3_build
|
||||
|
||||
%install
|
||||
%{__python3} setup.py install --skip-build --root %{buildroot}
|
||||
install -d %{buildroot}%{_sysconfdir}/target/backup
|
||||
install -D -m 644 targetcli.8.gz %{buildroot}%{_mandir}/man8/targetcli.8.gz
|
||||
%py3_install
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/target/backup
|
||||
mkdir -p %{buildroot}%{_mandir}/man8/
|
||||
install -m 644 targetcli*.8 %{buildroot}%{_mandir}/man8/
|
||||
mkdir -p %{buildroot}%{_unitdir}/
|
||||
install -m 644 systemd/* %{buildroot}%{_unitdir}/
|
||||
|
||||
%files
|
||||
%doc COPYING README.md
|
||||
%{python3_sitelib}/*
|
||||
%doc README.md
|
||||
%license COPYING
|
||||
%{python3_sitelib}/targetcli*
|
||||
%{_bindir}/targetcli
|
||||
%{_bindir}/targetclid
|
||||
%{_unitdir}/*
|
||||
%dir %{_sysconfdir}/target
|
||||
%dir %{_sysconfdir}/target/backup
|
||||
|
||||
%files help
|
||||
%{_mandir}/man8/targetcli.8.gz
|
||||
%{_mandir}/man8/targetcli*.8*
|
||||
|
||||
%changelog
|
||||
* Mon Apr 8 2024 yanshuai <yanshuai@kylinos.cn> - 2.1.54-3
|
||||
- avoild Ctrl+C print error stack
|
||||
|
||||
* Sun Apr 7 2024 yanshuai <yanshuai@kylinos.cn> - 2.1.54-2
|
||||
- Fix changing savedir directory mode
|
||||
|
||||
* Wed Dec 29 2021 wulei <wulei80@huawei.com> - 2.1.54-1
|
||||
- Package update
|
||||
|
||||
* Wed Jul 15 2020 wangyue <wangyue92@huawei.com> - 2.1.fb48-10
|
||||
- fix unexpected error raised when adding luns
|
||||
|
||||
* Fri Feb 14 2020 lingsheng <lingsheng@huawei.com> - 2.1.fb48-9
|
||||
- Package int
|
||||
|
||||
4
targetcli.yaml
Normal file
4
targetcli.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
version_control: github
|
||||
src_repo: open-iscsi/targetcli-fb
|
||||
tag_prefix: ^v
|
||||
seperator: .
|
||||
BIN
v2.1.fb48.tar.gz
BIN
v2.1.fb48.tar.gz
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user