bugfix invalid variable name

This commit is contained in:
zhangtao2020 2021-06-16 15:00:57 +08:00
parent 2993c4beb0
commit 40601baaf9
2 changed files with 41 additions and 1 deletions

View File

@ -0,0 +1,36 @@
diff --git a/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh b/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh
index bcb8158..e207519 100755
--- a/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh
+++ b/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh
@@ -2355,6 +2355,9 @@ function hadoop_verify_user_perm
declare command=$2
declare uvar
+ if [[ $command =~ \. ]];then
+ return 1
+ fi
uvar=$(hadoop_build_custom_subcmd_var "${program}" "${command}" USER)
if [[ -n ${!uvar} ]]; then
@@ -2381,7 +2384,9 @@ function hadoop_need_reexec
declare uvar
# we've already been re-execed, bail
-
+ if [[ $command =~ \. ]];then
+ return 1
+ fi
if [[ "${HADOOP_REEXECED_CMD}" = true ]]; then
return 1
fi
@@ -2421,7 +2426,9 @@ function hadoop_subcommand_opts
if [[ -z "${program}" || -z "${command}" ]]; then
return 1
fi
-
+ if [[ $command =~ \. ]];then
+ return 1
+ fi
# bash 4 and up have built-in ways to upper and lower
# case the contents of vars. This is faster than
# calling tr.

View File

@ -12,7 +12,7 @@
%define _binaries_in_noarch_packages_terminate_build 0
Name: hadoop-3.1
Version: 3.1.4
Release: 1
Release: 2
Summary: A software platform for processing vast amounts of data
# The BSD license file is missing
# https://issues.apache.org/jira/browse/HADOOP-9849
@ -34,6 +34,8 @@ Source12: %{real_name}-mapred-site.xml
Source13: %{real_name}-yarn-site.xml
Patch1: 0001-sys_errlist-undeclared.patch
Patch2: 0002-bugfix-invalid-variable-name.patch
BuildRoot: %{_tmppath}/%{real_name}-%{version}-%{release}-root
BuildRequires: java-1.8.0-openjdk-devel maven hostname maven-local tomcat cmake snappy openssl-devel
@ -1111,5 +1113,7 @@ fi
%config(noreplace) %{_sysconfdir}/%{real_name}/container-executor.cfg
%changelog
* Wed Jun 16 2021 zhangtao <zhangtao221@huawei.com> - 3.1.4-2
- bugfix invalid variable name
* Thu May 13 2021 Ge Wang <wangge20@huawei.com> - 3.1.4-1
- Init package