File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
crates/polars-io/src/path_utils Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ pub static POLARS_TEMP_DIR_BASE_PATH: Lazy<Box<Path>> = Lazy::new(|| {
8080 {
8181 use std:: os:: unix:: fs:: PermissionsExt ;
8282
83- ( || {
83+ let result = ( || {
8484 std:: fs:: set_permissions ( path. as_ref ( ) , std:: fs:: Permissions :: from_mode ( 0o700 ) ) ?;
8585 let perms = std:: fs:: metadata ( path. as_ref ( ) ) ?. permissions ( ) ;
8686
@@ -102,7 +102,11 @@ pub static POLARS_TEMP_DIR_BASE_PATH: Lazy<Box<Path>> = Lazy::new(|| {
102102 path. as_ref( )
103103 ) ,
104104 )
105- } ) ?
105+ } ) ;
106+
107+ if std:: env:: var ( "POLARS_ALLOW_UNSECURED_TEMP_DIR" ) . as_deref ( ) != Ok ( "1" ) {
108+ result?;
109+ }
106110 }
107111
108112 std:: io:: Result :: Ok ( path)
@@ -112,7 +116,7 @@ pub static POLARS_TEMP_DIR_BASE_PATH: Lazy<Box<Path>> = Lazy::new(|| {
112116 e. kind ( ) ,
113117 format ! (
114118 "error initializing temporary directory: {} \
115- consider explicitly setting POLARS_TEMP_DIR ",
119+ consider explicitly setting POLARS_TEMP_DIR",
116120 e
117121 ) ,
118122 )
You can’t perform that action at this time.
0 commit comments