Commit f1f3775 1 parent 875829b commit f1f3775 Copy full SHA for f1f3775
File tree 1 file changed +7
-3
lines changed
crates/polars-io/src/path_utils
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(|| {
80
80
{
81
81
use std:: os:: unix:: fs:: PermissionsExt ;
82
82
83
- ( || {
83
+ let result = ( || {
84
84
std:: fs:: set_permissions ( path. as_ref ( ) , std:: fs:: Permissions :: from_mode ( 0o700 ) ) ?;
85
85
let perms = std:: fs:: metadata ( path. as_ref ( ) ) ?. permissions ( ) ;
86
86
@@ -102,7 +102,11 @@ pub static POLARS_TEMP_DIR_BASE_PATH: Lazy<Box<Path>> = Lazy::new(|| {
102
102
path. as_ref( )
103
103
) ,
104
104
)
105
- } ) ?
105
+ } ) ;
106
+
107
+ if std:: env:: var ( "POLARS_ALLOW_UNSECURED_TEMP_DIR" ) . as_deref ( ) != Ok ( "1" ) {
108
+ result?;
109
+ }
106
110
}
107
111
108
112
std:: io:: Result :: Ok ( path)
@@ -112,7 +116,7 @@ pub static POLARS_TEMP_DIR_BASE_PATH: Lazy<Box<Path>> = Lazy::new(|| {
112
116
e. kind ( ) ,
113
117
format ! (
114
118
"error initializing temporary directory: {} \
115
- consider explicitly setting POLARS_TEMP_DIR ",
119
+ consider explicitly setting POLARS_TEMP_DIR",
116
120
e
117
121
) ,
118
122
)
You can’t perform that action at this time.
0 commit comments