Skip to content

Commit

Permalink
Revert "fix security (#62626)" (#62889)
Browse files Browse the repository at this point in the history
This reverts commit 0952498.
  • Loading branch information
wanghuancoder committed Mar 21, 2024
1 parent 7da058c commit 58e5fa2
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions python/paddle/base/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import os
import platform
import re
import site
import sys
import warnings
Expand Down Expand Up @@ -194,18 +193,8 @@ def run_shell_command(cmd):
return out.decode('utf-8').strip()


def is_valid_filename(filename):
pattern = re.compile(r'^[a-zA-Z0-9_.-]+$')
if pattern.match(filename):
return True
else:
return False


def get_dso_path(core_so, dso_name):
if core_so and dso_name:
assert is_valid_filename(core_so), 'core_so must be a file name.'
assert is_valid_filename(dso_name), 'dso_name must be a file name.'
return run_shell_command(
f"ldd {core_so}|grep {dso_name}|awk '{{print $3}}'"
)
Expand Down

0 comments on commit 58e5fa2

Please sign in to comment.