Skip to content

Commit b9cec00

Browse files
dsherretbartlomieju
authored andcommitted
fix: remove permission check in op_require_node_module_paths (#26645)
1 parent 0e2a731 commit b9cec00

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

ext/node/ops/require.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,6 @@ where
131131
normalize_path(current_dir.join(from))
132132
};
133133

134-
let from = ensure_read_permission::<P>(state, &from)
135-
.map_err(RequireError::Permission)?;
136-
137134
if cfg!(windows) {
138135
// return root node_modules when path is 'D:\\'.
139136
let from_str = from.to_str().unwrap();
@@ -154,7 +151,7 @@ where
154151
}
155152

156153
let mut paths = Vec::with_capacity(from.components().count());
157-
let mut current_path = from.as_ref();
154+
let mut current_path = from.as_path();
158155
let mut maybe_parent = Some(current_path);
159156
while let Some(parent) = maybe_parent {
160157
if !parent.ends_with("node_modules") {

0 commit comments

Comments
 (0)