mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-08-31 06:46:24 +00:00
修复sudo 命令 小写all 引起的推送失败
This commit is contained in:
@@ -621,7 +621,7 @@ def perm_sudo_add(request):
|
||||
pattern = re.compile(r'[\n,\r]')
|
||||
deal_commands = list_drop_str(pattern.split(commands), u'')
|
||||
for command in deal_commands:
|
||||
if command.lower() == "all":
|
||||
if command.strip().lower() == "all":
|
||||
deal_commands.remove(command)
|
||||
deal_commands.append(command.upper())
|
||||
commands = ', '.join(deal_commands)
|
||||
@@ -663,7 +663,7 @@ def perm_sudo_edit(request):
|
||||
pattern = re.compile(r'[\n,\r]')
|
||||
deal_commands = list_drop_str(pattern.split(commands), u'')
|
||||
for command in deal_commands:
|
||||
if command.lower() == "all":
|
||||
if command.strip().lower() == "all":
|
||||
deal_commands.remove(command)
|
||||
deal_commands.append(command.upper())
|
||||
commands = ', '.join(deal_commands).strip()
|
||||
|
Reference in New Issue
Block a user