Skip to content

Commit 8596673

Browse files
committed
src: avoid copying string in fs_permission
nodejs/node#47746
1 parent e11e59d commit 8596673

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

patches/node/src_avoid_copying_string_in_fs_permission.patch

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Subject: src: avoid copying string in fs_permission
66
Ref: https://github.com/nodejs/node/pull/47746/files
77

88
diff --git a/src/permission/fs_permission.cc b/src/permission/fs_permission.cc
9-
index fadf75968c779d5aee8d9d1ee27e7b4abf241240..ba0b8e7a6b545dd6b69dfa23fa75262987206775 100644
9+
index fadf75968c779d5aee8d9d1ee27e7b4abf241240..d407d440d74c66d9dc8ca4d4653096292c5adc4c 100644
1010
--- a/src/permission/fs_permission.cc
1111
+++ b/src/permission/fs_permission.cc
1212
@@ -199,18 +199,18 @@ bool FSPermission::RadixTree::Lookup(const std::string_view& s,
@@ -32,6 +32,15 @@ index fadf75968c779d5aee8d9d1ee27e7b4abf241240..ba0b8e7a6b545dd6b69dfa23fa752629
3232
current_node = current_node->CreateChild(node_path);
3333
}
3434

35+
@@ -222,7 +222,7 @@ void FSPermission::RadixTree::Insert(const std::string& path) {
36+
37+
if (UNLIKELY(per_process::enabled_debug_list.enabled(
38+
DebugCategory::PERMISSION_MODEL))) {
39+
- per_process::Debug(DebugCategory::PERMISSION_MODEL, "Inserting %s\n", path);
40+
+ per_process::Debug(DebugCategory::PERMISSION_MODEL, "Inserting %s\n", path_prefix);
41+
PrintTree(root_node_);
42+
}
43+
}
3544
diff --git a/src/permission/fs_permission.h b/src/permission/fs_permission.h
3645
index 244e95727ad48757995c6404f457f42a4ba33ccd..4b6aab197333928bfbd5143bea15b3a5abd6d4c0 100644
3746
--- a/src/permission/fs_permission.h

0 commit comments

Comments
 (0)