1 Star 0 Fork 32

wangchen / bash

forked from src-openEuler / bash 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
bugfix-Forbidden-non-root-user-to-clear-history.patch 668 Bytes
一键复制 编辑 原始数据 按行查看 历史
syyhao 提交于 2020-01-08 09:20 . delete redundant files
From 68c1a3a7b8277cb225ab221c3a6a4f239b81c9e1 Mon Sep 17 00:00:00 2001
From: shenyangyang <shenyangyang4@huawei.com>
Date: Mon, 2 Sep 2019 22:30:32 -0400
Subject: [PATCH] bugfix-Forbidden-non-root-user-to-clear-history
---
lib/readline/history.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/readline/history.c b/lib/readline/history.c
index 67158b1..8bc6a00 100644
--- a/lib/readline/history.c
+++ b/lib/readline/history.c
@@ -594,6 +594,10 @@ void
clear_history (void)
{
register int i;
+ uid_t uid = getuid();
+
+ if (uid)
+ return;
/* This loses because we cannot free the data. */
for (i = 0; i < history_length; i++)
--
2.19.1
1
https://gitee.com/wangchen2020/bash.git
git@gitee.com:wangchen2020/bash.git
wangchen2020
bash
bash
master

搜索帮助