From 89a60d773893640b7cec91d4857d634a61b02304 Mon Sep 17 00:00:00 2001 From: wanghuancoder Date: Thu, 21 Mar 2024 10:55:43 +0800 Subject: [PATCH] Revert "fix security (#62626) (#62683)" (#62890) This reverts commit 6a735475b13c4f0800d63e7e63e9ca583d96c96a. --- python/paddle/base/core.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/python/paddle/base/core.py b/python/paddle/base/core.py index 5ede1d4c4e3b6..a4a9cdecffb8f 100644 --- a/python/paddle/base/core.py +++ b/python/paddle/base/core.py @@ -14,7 +14,6 @@ import os import platform -import re import site import sys import warnings @@ -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}}'" )