rm zzz_openEuler_history.sh
This commit is contained in:
parent
3760c6e8f9
commit
b9043c3348
@ -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'
|
||||
@ -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
|
||||
|
||||
@ -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 <buildteam@openEuler.org> - 2.0-1.48
|
||||
- rm zzz_openEuler_history.sh
|
||||
|
||||
* Fri May 29 2020 openEuler Buildteam <buildteam@openEuler.org> - 2.0-1.47
|
||||
- Move -- befora path
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user