FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

src: avoid shadowed string in fs_permission by codebytere · Pull Request #51123 · nodejs/node · GitHub

/ node Public

src: avoid shadowed string in fs_permission - #51123

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
codebytere:copy-string-fix
Jan 3, 2024
Merged

src: avoid shadowed string in fs_permission#51123
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
codebytere:copy-string-fix

Conversation

Copy link
Copy Markdown
Member

Refs #44004

Addresses the following shadowing issue in fs_permission:

../../third_party/electron_node/src/permission/fs_permission.h:34:37: error: declaration shadows a field of 'node::permission::FSPermission::RadixTree::Node' [-Werror,-Wshadow]
   34 |       Node* CreateChild(std::string prefix) {
      |                                     ^
../../third_party/electron_node/src/permission/fs_permission.h:24:19: note: previous declaration is here
   24 |       std::string prefix;
      |                   ^
1 error generated.

Allows Electron to remove a patch.

codebytere requested a review from RafaelGSS December 11, 2023 20:09

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/security-wg

nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Dec 11, 2023
RafaelGSS added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 11, 2023
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 11, 2023

Copy link
Copy Markdown
Collaborator

Comment thread src/permission/fs_permission.h Outdated
codebytere force-pushed the copy-string-fix branch 2 times, most recently from 7161204 to 7d2c4c1 Compare December 12, 2023 09:59

Copy link
Copy Markdown
Member Author

Seeing test failures that i didn't see when running Electron's version against Node.js tests - looking into it 🤔

RafaelGSS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@codebytere this should fix your issue:

diff --git a/src/permission/fs_permission.h b/src/permission/fs_permission.h
index 4577a73c37d..642d2dbc6ea 100644
--- a/src/permission/fs_permission.h
+++ b/src/permission/fs_permission.h
@@ -43,7 +43,7 @@ class FSPermission final : public PermissionBase {

         Node* child = children[label];
         if (child == nullptr) {
-          children[label] = new Node(prefix);
+          children[label] = new Node(path_prefix);
           return children[label];
         }

Copy link
Copy Markdown
Member Author

@RafaelGSS done, thanks!

codebytere requested a review from RafaelGSS January 1, 2024 13:54
codebytere added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 2, 2024
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 2, 2024

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

RafaelGSS added author ready PRs that have at least one approval, no outstanding review comments, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. permission Issues and PRs related to the Permission Model labels Jan 3, 2024
nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 3, 2024
nodejs-github-bot merged commit 088f4cc into nodejs:main Jan 3, 2024

Copy link
Copy Markdown
Collaborator

Landed in 088f4cc

codebytere deleted the copy-string-fix branch January 3, 2024 13:54
targos pushed a commit that referenced this pull request Feb 15, 2024
PR-URL: #51123
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
marco-ippolito mentioned this pull request Mar 1, 2024
richardlau pushed a commit that referenced this pull request Mar 25, 2024
PR-URL: #51123
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
richardlau mentioned this pull request Mar 25, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. permission Issues and PRs related to the Permission Model

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL