1 Star 0 Fork 49

李双全/systemd

forked from src-anolis-os/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
10020-fileio-add-explicit-flag-for-generating-world-execu.patch 1.51 KB
一键复制 编辑 原始数据 按行查看 历史
From 1e0dcd6fa1abea9c561f46556f7f7561b2a46e62 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Fri, 17 Jul 2020 11:53:22 +0200
Subject: [PATCH] fileio: add explicit flag for generating world executable
warning when reading file
(cherry picked from commit 684aa979f1c4ce5f75ccdc131f32fc0434999918)
Signed-off-by: Guorui Yu <GuoRui.Yu@linux.alibaba.com>
---
src/basic/fileio.c | 2 +-
src/basic/fileio.h | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/basic/fileio.c b/src/basic/fileio.c
index bb804e3afa..833c55b030 100644
--- a/src/basic/fileio.c
+++ b/src/basic/fileio.c
@@ -420,7 +420,7 @@ int read_full_stream_full(
if (st.st_size > 0)
n_next = st.st_size + 1;
- if (flags & READ_FULL_FILE_SECURE)
+ if (flags & READ_FULL_FILE_WARN_WORLD_READABLE)
(void) warn_file_is_world_accessible(filename, &st, NULL, 0);
}
}
diff --git a/src/basic/fileio.h b/src/basic/fileio.h
index 3e572dc0de..be10ac77b6 100644
--- a/src/basic/fileio.h
+++ b/src/basic/fileio.h
@@ -26,7 +26,8 @@ typedef enum {
} WriteStringFileFlags;
typedef enum {
- READ_FULL_FILE_SECURE = 1 << 0,
+ READ_FULL_FILE_SECURE = 1 << 0,
+ READ_FULL_FILE_WARN_WORLD_READABLE = 1 << 3,
} ReadFullFileFlags;
int write_string_stream_ts(FILE *f, const char *line, WriteStringFileFlags flags, struct timespec *ts);
--
2.39.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/shqli/systemd.git
git@gitee.com:shqli/systemd.git
shqli
systemd
systemd
a8

搜索帮助

0d507c66 1850385 C8b1a773 1850385