prlimit fix optional arguments parsing

This commit is contained in:
shangyibin 2022-03-16 14:11:16 +08:00
parent 92dba8f4ba
commit 96ee6a0c83
2 changed files with 40 additions and 2 deletions

View File

@ -0,0 +1,31 @@
From 1ad8db5521ec03d41a058674437f648d15ef8344 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Thu, 18 Mar 2021 10:23:36 +0100
Subject: [PATCH] prlimit: fix optional arguments parsing
$ prlimit -f=100:100
failed to parse FSIZE limit
Fixes: https://github.com/karelzak/util-linux/issues/1265
Signed-off-by: Karel Zak <kzak@redhat.com>
---
sys-utils/prlimit.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sys-utils/prlimit.c b/sys-utils/prlimit.c
index 6078490..17db3d8 100644
--- a/sys-utils/prlimit.c
+++ b/sys-utils/prlimit.c
@@ -451,6 +451,9 @@ static int parse_prlim(struct rlimit *lim, char *ops, size_t id)
rlim_t soft, hard;
int found = 0;
+ if (ops && *ops == '=')
+ ops++;
+
if (get_range(ops, &soft, &hard, &found))
errx(EXIT_FAILURE, _("failed to parse %s limit"),
prlimit_desc[id].name);
--
1.8.3.1

View File

@ -2,7 +2,7 @@
Name: util-linux
Version: 2.35.2
Release: 10
Release: 11
Summary: A random collection of Linux utilities
License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain
URL: https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git
@ -61,6 +61,7 @@ Patch6000: backport-CVE-2021-37600.patch
Patch6001: backport-add-ul_strtou64.patch
Patch6002: backport-CVE-2021-3995.patch
Patch6003: backport-CVE-2021-3996.patch
Patch6004: backport-prlimit-fix-optional-arguments-parsing.patch
Patch9000: Add-check-to-resolve-uname26-version-test-failed.patch
Patch9001: modify-rescuemode-chinese-error.patch
@ -410,7 +411,13 @@ fi
%{_mandir}/man8/{swapoff.8*,swapon.8*,switch_root.8*,umount.8*,wdctl.8.gz,wipefs.8*,zramctl.8*}
%changelog
* Tue Feb 15 2021 shangyibin<shangyibin1@h-partners.com> - 2.35.2-10
* Wed Mar 16 2022 shangyibin<shangyibin1@h-partners.com> - 2.35.2-11
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:prlimit fix optional arguments parsing
* Tue Feb 15 2022 shangyibin<shangyibin1@h-partners.com> - 2.35.2-10
- Type:CVE
- ID:CVE-2021-3995 CVE-2021-3996
- SUG:NA