diff --git a/0001-Fix-crit-encode-TypeError.patch b/0001-Fix-crit-encode-TypeError.patch new file mode 100644 index 0000000000000000000000000000000000000000..145c5590714865dd59153d7bd93ed65810680615 --- /dev/null +++ b/0001-Fix-crit-encode-TypeError.patch @@ -0,0 +1,28 @@ +From d1c7216c4265c45bcb8b9380b8ad4e5ed69d014e Mon Sep 17 00:00:00 2001 +From: lingsheng +Date: Tue, 22 Sep 2020 14:36:55 +0800 +Subject: [PATCH 1/3] Fix crit encode TypeError + +--- + lib/py/cli.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/lib/py/cli.py b/lib/py/cli.py +index da34302..966dd4e 100755 +--- a/lib/py/cli.py ++++ b/lib/py/cli.py +@@ -16,7 +16,10 @@ def inf(opts): + + def outf(opts): + if opts['out']: +- return open(opts['out'], 'w+') ++ if getattr(opts['func'], '__name__') == 'encode': ++ return open(opts['out'], 'wb+') ++ else: ++ return open(opts['out'], 'w+') + else: + return sys.stdout + +-- +2.23.0 + diff --git a/0002-Fix-crit-info-struct-unpack-error.patch b/0002-Fix-crit-info-struct-unpack-error.patch new file mode 100644 index 0000000000000000000000000000000000000000..4bfe29d2b7cb0768fe0b8c90dd5f6c51d757989f --- /dev/null +++ b/0002-Fix-crit-info-struct-unpack-error.patch @@ -0,0 +1,25 @@ +From a1d4d678de01b0569e8d36894a8d60a8b75bb016 Mon Sep 17 00:00:00 2001 +From: lingsheng +Date: Tue, 22 Sep 2020 14:39:22 +0800 +Subject: [PATCH 2/3] Fix crit info struct unpack error + +--- + lib/py/images/images.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/py/images/images.py b/lib/py/images/images.py +index f4517d8..72205fe 100644 +--- a/lib/py/images/images.py ++++ b/lib/py/images/images.py +@@ -171,7 +171,7 @@ class entry_handler: + + while True: + buf = f.read(4) +- if buf == '': ++ if len(buf) == 0: + break + size, = struct.unpack('i', buf) + f.seek(size, 1) +-- +2.23.0 + diff --git a/0003-Fix-crit-x-UnicodeDecodeError.patch b/0003-Fix-crit-x-UnicodeDecodeError.patch new file mode 100644 index 0000000000000000000000000000000000000000..c59f2b7cd13db8825e35f65b4e9b8e4d34f88d4d --- /dev/null +++ b/0003-Fix-crit-x-UnicodeDecodeError.patch @@ -0,0 +1,25 @@ +From b2eea766a1f41553b76fef8d669e288ff552d0ed Mon Sep 17 00:00:00 2001 +From: lingsheng +Date: Tue, 22 Sep 2020 14:40:35 +0800 +Subject: [PATCH 3/3] Fix crit x UnicodeDecodeError + +--- + lib/py/cli.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/py/cli.py b/lib/py/cli.py +index 966dd4e..f7bda23 100755 +--- a/lib/py/cli.py ++++ b/lib/py/cli.py +@@ -25,7 +25,7 @@ def outf(opts): + + + def dinf(opts, name): +- return open(os.path.join(opts['dir'], name)) ++ return open(os.path.join(opts['dir'], name), 'rb') + + + def decode(opts): +-- +2.23.0 + diff --git a/criu.spec b/criu.spec index 142c42ff0ca1ba1d798e4f927ca6a98742381979..050ec050d9e54f48ab28452d9d92eaa0033c868d 100644 --- a/criu.spec +++ b/criu.spec @@ -1,6 +1,6 @@ Name: criu Version: 3.13 -Release: 6 +Release: 7 Provides: crtools = %{version}-%{release} Obsoletes: crtools <= 1.0-2 Summary: A tool of Checkpoint/Restore in User-space @@ -15,6 +15,10 @@ Requires: %{name} = %{version}-%{release} Provides: %{name}-libs = %{version}-%{release} Obsoletes: %{name}-libs < %{version}-%{release} +Patch0001: 0001-Fix-crit-encode-TypeError.patch +Patch0002: 0002-Fix-crit-info-struct-unpack-error.patch +Patch0003: 0003-Fix-crit-x-UnicodeDecodeError.patch + %description Checkpoint/Restore in Userspace(CRIU),is a software tool for the linux operating system. Using this tool,it is possible to freeze a running application (or part of it) and @@ -87,5 +91,8 @@ chmod 0755 %{buildroot}/run/%{name}/ %doc %{_mandir}/man1/{compel.1*,crit.1*} %changelog +* Tue Sep 22 2020 lingsheng - 3.13-7 +- Fix crit errors + * Fri Apr 24 2020 wutao - 3.13-6 - Package init