Skip to content

Commit

Permalink
Revert "fix security (#62626) (#62683)" (#62890)
Browse files Browse the repository at this point in the history
This reverts commit 6a73547.
  • Loading branch information
wanghuancoder authored Mar 21, 2024
1 parent 0348f3f commit 89a60d7
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 89a60d7

Please sign in to comment.