1 Star 0 Fork 25

池鱼/util-linux

forked from src-anolis-os/util-linux 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0002-losetup-keep-f-and-devname-mutually-exclusive.patch 1.13 KB
一键复制 编辑 原始数据 按行查看 历史
张彬琛 提交于 2021-01-20 14:01 . import util-linux-2.32.1-22.el8.src.rpm
From 315960fa9a89248e9d56682c1915567d38fef431 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Thu, 7 Jun 2018 12:05:08 +0200
Subject: [PATCH 2/6] losetup: keep -f and <devname> mutually exclusive
losetup tries to blindly use specified device as well as search for
the first free device, the result is:
# losetup /dev/loop1 -f /tmp/tfile_loop1
losetup: /dev/loop1: failed to set up loop device: Invalid argument
fixed version:
# losetup /dev/loop10 -f img
losetup: unexpected arguments
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1614364
Upstream: http://github.com/karelzak/util-linux/commit/c3f5a0f1d47dbc47f6d21da232d4eb1cfb7905db
Signed-off-by: Karel Zak <kzak@redhat.com>
---
sys-utils/losetup.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sys-utils/losetup.c b/sys-utils/losetup.c
index 9c479c02d..e80ceacce 100644
--- a/sys-utils/losetup.c
+++ b/sys-utils/losetup.c
@@ -749,6 +749,9 @@ int main(int argc, char **argv)
*/
act = A_CREATE;
file = argv[optind++];
+
+ if (optind < argc)
+ errx(EXIT_FAILURE, _("unexpected arguments"));
}
if (list && !act && optind == argc)
--
2.14.4
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zxy19951122/util-linux.git
git@gitee.com:zxy19951122/util-linux.git
zxy19951122
util-linux
util-linux
a8

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385