File tree Expand file tree Collapse file tree
sagemaker-core/src/sagemaker/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -641,7 +641,7 @@ def _validate_source_directory(source_directory):
641641
642642 # Check if the source path is under any sensitive directory
643643 for sensitive_path in _SENSITIVE_SYSTEM_PATHS :
644- if abs_source .startswith (sensitive_path ):
644+ if abs_source != "/" and abs_source .startswith (sensitive_path ):
645645 raise ValueError (
646646 f"source_directory cannot access sensitive system paths. "
647647 f"Got: { source_directory } (resolved to { abs_source } )"
@@ -667,7 +667,7 @@ def _validate_dependency_path(dependency):
667667
668668 # Check if the dependency path is under any sensitive directory
669669 for sensitive_path in _SENSITIVE_SYSTEM_PATHS :
670- if abs_dependency .startswith (sensitive_path ):
670+ if abs_dependency != "/" and abs_dependency .startswith (sensitive_path ):
671671 raise ValueError (
672672 f"dependency path cannot access sensitive system paths. "
673673 f"Got: { dependency } (resolved to { abs_dependency } )"
You can’t perform that action at this time.
0 commit comments