From b9043c33483842bca59afca6360ae7c1907ea5bc Mon Sep 17 00:00:00 2001 From: guoxiaoqi Date: Fri, 3 Jul 2020 16:01:17 +0800 Subject: [PATCH] rm zzz_openEuler_history.sh --- security-tool-2.0/zzz_openEuler_history.csh | 17 ------- security-tool-2.0/zzz_openEuler_history.sh | 54 --------------------- security-tool.spec | 9 ++-- 3 files changed, 4 insertions(+), 76 deletions(-) delete mode 100644 security-tool-2.0/zzz_openEuler_history.csh delete mode 100644 security-tool-2.0/zzz_openEuler_history.sh diff --git a/security-tool-2.0/zzz_openEuler_history.csh b/security-tool-2.0/zzz_openEuler_history.csh deleted file mode 100644 index 85042a3..0000000 --- a/security-tool-2.0/zzz_openEuler_history.csh +++ /dev/null @@ -1,17 +0,0 @@ -####################################################################################### -# -# Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. -# security-tool licensed under the Mulan PSL v2. -# You can use this software according to the terms and conditions of the Mulan PSL v2. -# You may obtain a copy of Mulan PSL v2 at: -# http://license.coscl.org.cn/MulanPSL -# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR -# PURPOSE. -# See the Mulan PSL v2 for more details. -# Description: Append the history list to the history file. -# -####################################################################################### - -set LastComandNum_for_history -alias precmd 'source /etc/csh.precmd' diff --git a/security-tool-2.0/zzz_openEuler_history.sh b/security-tool-2.0/zzz_openEuler_history.sh deleted file mode 100644 index 02296de..0000000 --- a/security-tool-2.0/zzz_openEuler_history.sh +++ /dev/null @@ -1,54 +0,0 @@ -####################################################################################### -# -# Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. -# security-tool licensed under the Mulan PSL v2. -# You can use this software according to the terms and conditions of the Mulan PSL v2. -# You may obtain a copy of Mulan PSL v2 at: -# http://license.coscl.org.cn/MulanPSL -# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR -# PURPOSE. -# See the Mulan PSL v2 for more details. -# Description: Append the history list to the history file. -# -####################################################################################### - -function openEuler_history() -{ - local result=$? - local result_str="" - if [ ${result} -eq 0 ];then - result_str="return code=[0], execute success" - else - result_str="return code=[${result}], execute failed" - fi - history -a - local user=$(whoami) - local user_id=$(id -ur $user) - local login=$(who -m | awk '{print $2" "$NF}') - local msg=$(history 1 | { read x y; echo "$y"; }) - local num=$(history 1 | { read x y; echo "$x"; }) - if [ "${num}" != "${LastComandNum_for_history}" ] && [ "${LastComandNum_for_history}" != "" -o "${num}" == "1" ];then - logger -t "[${SHELL}]" "[${msg}]" "${result_str}" "by [${user}(uid=$user_id)] from [$login]" - fi - LastComandNum_for_history=${num} -} - -function openEuler_variable_readonly() -{ - local var="$1" - local val="$2" - local ret=$(readonly -p | grep -w "${var}" | awk -F "${var}=" '{print $NF}') - if [ "${ret}" = "\"${val}\"" ] - then - return - else - export "${var}"="${val}" - readonly "${var}" - fi -} - -export HISTCONTROL='' -openEuler_variable_readonly HISTTIMEFORMAT "" -openEuler_variable_readonly PROMPT_COMMAND openEuler_history - diff --git a/security-tool.spec b/security-tool.spec index c98ab04..ca31514 100644 --- a/security-tool.spec +++ b/security-tool.spec @@ -1,7 +1,7 @@ Summary: openEuler Security Tool Name : security-tool Version: 2.0 -Release: 1.47 +Release: 1.48 Source0: %{name}-%{version}.tar.bz2 Source1: security Source2: security.conf @@ -41,8 +41,6 @@ install -d -m0755 $RPM_BUILD_ROOT/%{_sbindir} install -m0500 %{SOURCE3} $RPM_BUILD_ROOT/%{_sbindir}/security-tool.sh install -m0644 csh.precmd $RPM_BUILD_ROOT%{_sysconfdir}/csh.precmd install -d -m0755 $RPM_BUILD_ROOT/%{_sysconfdir}/profile.d -install -m0644 zzz_openEuler_history.csh $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/zzz_openEuler_history.csh -install -m0644 zzz_openEuler_history.sh $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/zzz_openEuler_history.sh install -d -m0755 $RPM_BUILD_ROOT/%{_sysconfdir}/pam.d install -m0644 password-auth-crond $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/password-auth-crond install -m0644 su-local $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/su-local @@ -116,14 +114,15 @@ fi %attr(0400,root,root) %config %{_sysconfdir}/openEuler_security/security.conf %attr(0600,root,root) %config %{_sysconfdir}/openEuler_security/usr-security.conf %attr(0644,root,root) %{_sysconfdir}/csh.precmd -%attr(0644,root,root) %{_sysconfdir}/profile.d/zzz_openEuler_history.csh -%attr(0644,root,root) %{_sysconfdir}/profile.d/zzz_openEuler_history.sh %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/pam.d/password-auth-crond %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/pam.d/su-local %attr(0644,root,root) %{_unitdir}/openEuler-security.service %attr(0500,root,root) %{_sbindir}/security-tool.sh %changelog +* Fri Jul 3 2020 openEuler Buildteam - 2.0-1.48 +- rm zzz_openEuler_history.sh + * Fri May 29 2020 openEuler Buildteam - 2.0-1.47 - Move -- befora path