Skip to content

Commit 58e5fa2

Browse files
Revert "fix security (#62626)" (#62889)
This reverts commit 0952498.
1 parent 7da058c commit 58e5fa2

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

python/paddle/base/core.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
import os
1616
import platform
17-
import re
1817
import site
1918
import sys
2019
import warnings
@@ -194,18 +193,8 @@ def run_shell_command(cmd):
194193
return out.decode('utf-8').strip()
195194

196195

197-
def is_valid_filename(filename):
198-
pattern = re.compile(r'^[a-zA-Z0-9_.-]+$')
199-
if pattern.match(filename):
200-
return True
201-
else:
202-
return False
203-
204-
205196
def get_dso_path(core_so, dso_name):
206197
if core_so and dso_name:
207-
assert is_valid_filename(core_so), 'core_so must be a file name.'
208-
assert is_valid_filename(dso_name), 'dso_name must be a file name.'
209198
return run_shell_command(
210199
f"ldd {core_so}|grep {dso_name}|awk '{{print $3}}'"
211200
)

0 commit comments

Comments
 (0)