Skip to content

Commit

Permalink
Revert "fix security (PaddlePaddle#62626) (PaddlePaddle#62683)"
Browse files Browse the repository at this point in the history
This reverts commit 6a73547.
  • Loading branch information
hanhaowen-mt committed May 13, 2024
1 parent 80b5a02 commit 3491af5
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 @@ -195,18 +194,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 3491af5

Please sign in to comment.