2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-17 16:50:22 +00:00

Fix 3749, handle '+' and '-' in id when merging /etc/passwd (#3771)

* Fix 3749, handle '+' and '-' in id when merging /etc/passwd

* Add some comments
This commit is contained in:
Bin Xu
2017-08-25 15:13:51 +08:00
committed by yangsong
parent b0249c798f
commit 2991ec1e59

View File

@@ -76,7 +76,9 @@ for i in $*; do
delim="|"
for u in $removeusers
do
userlist=$userlist$u$delim
# For special char +/-, need to escape
[[ "${u:0:1}x" =~ ^\+|\-x ]] && uu="\\$u" || uu="$u"
userlist=$userlist$uu$delim
done
# remove the last delimiter
userlisttmp="${userlist%?}"