GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix for path.resolve containing relative path to another drive in windows by ankurp · Pull Request #57 · nodejs/node

Conversation

@ankurp

@ankurp ankurp commented Dec 4, 2014

Copy link
Copy Markdown

Fixes #50

Issue can be reproduced by running path.resolve in Windows as such path.resolve('C:/some/random/path', '../../../../../D:/another/random/path'); This outputs c:\D:\another\random\path where d: drive is not considered absolute.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@rvagg
rvagg force-pushed the v0.12 branch 4 times, most recently from d7e65ff to 185d11c Compare December 4, 2014 10:21
@rvagg

rvagg commented Dec 4, 2014

Copy link
Copy Markdown
Member

thanks @ankurp, could you rebase this off v0.12 please, you have some additional commit noise in here from 8868378 which makes this hard to review, aim for just showing your commits (and before it's merged it needs to be just one commit but you can squash later)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ankurp

ankurp commented Dec 4, 2014

Copy link
Copy Markdown
Author

I just added upstream git remote add upstream https://github.com/iojs/io.js and did a pull from git pull upstream v0.12 and merged

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ankurp

ankurp commented Dec 4, 2014

Copy link
Copy Markdown
Author

Seems like other people's commits got included. Is v0.12 the branch to pull from or master?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@indutny

indutny commented Dec 4, 2014

Copy link
Copy Markdown
Member

ok, you totally borked it out :)

git fetch upstream
git reset --hard upstream/v0.12
git cherry-pick 25e68db 1652761 1e42c96 143a03b
git push -f origin v0.12

Also I would recommend you to use feature branches next time, to ensure that this things won't happen. And do git fetch upstream && git rebase upstream/v0.12 or git pull --rebase upstream v0.12 instead of just git pull.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ankurp

ankurp commented Dec 4, 2014

Copy link
Copy Markdown
Author

Will do

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ankurp
ankurp force-pushed the v0.12 branch from efed963 to 62ec1db Compare December 5, 2014 04:50
@ankurp

ankurp commented Dec 5, 2014

Copy link
Copy Markdown
Author

Done cherry picked only my changes.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ankurp

ankurp commented Dec 6, 2014

Copy link
Copy Markdown
Author

Can we merge this. I thought this fork was more active than nodejs

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bnoordhuis

bnoordhuis commented Dec 6, 2014

Copy link
Copy Markdown
Member

@ankurp This needs a review from a Windows developer, maybe @seishun or @piscisaureus.

To expedient matters, can you squash the commits and write a nice commit log? See CONTRIBUTING.md for an example. Thanks.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@seishun

seishun commented Dec 6, 2014

Copy link
Copy Markdown
Contributor

@ankurp '../../../../../D:/another/random/path' doesn't look like a valid path to me. Can you name an example where this works as you would expect?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ankurp

ankurp commented Dec 6, 2014

Copy link
Copy Markdown
Author

I am squashing the commits. I found this bug when generating sourcemaps for a web project and the files being imported in sass were on a different Windows drive. If you do a path.relative from one drive to another it will go up using ../ until it reaches My Computer and then go to the letter drive.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ankurp

ankurp commented Dec 6, 2014

Copy link
Copy Markdown
Author

@seishun Try this please in io.js path.relative("c:/some/dir", "d:/some/fold") and you will get ../../../d:/some/fold

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ankurp
Update device regex starting with relative path
77b9487
paths starting with relative path to another drive for example `../../d:/some/dir/` are not resolved correctly. This regex update fixes it.

Adding and updating tests along with the fix.
@seishun

seishun commented Dec 6, 2014

Copy link
Copy Markdown
Contributor

This is a path.relative bug if anything. Relative path across drives doesn't make sense. See for example PathRelativePathTo: "On the other hand, "c:\FolderA\FolderB" and "a:\FolderA\FolderD do not share a common prefix, and the function will fail.".

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ankurp
ankurp force-pushed the v0.12 branch from 62ec1db to 77b9487 Compare December 6, 2014 21:55
@ankurp

ankurp commented Dec 6, 2014

Copy link
Copy Markdown
Author

@seishun The relative path is correct as in the drives are mounted at the root in Windows. You can follow along the relative path and get to that folder in other drive. I have also squashed the commit and updated the PR.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@seishun

seishun commented Dec 6, 2014

Copy link
Copy Markdown
Contributor

the drives are mounted at the root in Windows.

There is no single "root" in Windows. My Computer is purely a Windows Explorer concept.

You can follow along the relative path and get to that folder in other drive.

Actually no, cd won't even let you change drives without a /D switch. cd .. at the root of a drive does nothing.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ankurp

ankurp commented Dec 6, 2014

Copy link
Copy Markdown
Author

Then the fix is to throw an error if someone tries to do relative path across drives?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@seishun

seishun commented Dec 6, 2014

Copy link
Copy Markdown
Contributor

That sounds sane to me. It's a good translation of returning FALSE from PathRelativePathTo.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ankurp

ankurp commented Dec 6, 2014

Copy link
Copy Markdown
Author

Ok let me change the PR then.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@caineio caineio added needs info and removed needs info labels Dec 8, 2014
@piscisaureus

piscisaureus commented Dec 8, 2014

Copy link
Copy Markdown
Contributor

-1.

..\..\c:\etc\bla is always in invalid path.
If a path operation turns an invalid path into a valid path, that's a disaster or security issue waiting to happen.
I think "garbage in, garbage out" is wildly more preferrable.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@piscisaureus piscisaureus removed the need info label Dec 8, 2014
@ankurp

ankurp commented Dec 8, 2014

Copy link
Copy Markdown
Author

OK then I will throw an exception if there are ../ in the path to another lettered drive.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

dacappo added a commit to SAP-archive/node-rasp that referenced this pull request Nov 29, 2018
@dacappo
[GitHub] TaintNode.js specific PR template (nodejs#57)
444e1d0
* [GitHub] Fork specific PR template

* [GitHub] Check for SemVer and Windows test-taint goal
dacappo added a commit to SAP-archive/node-rasp that referenced this pull request Dec 3, 2018
@dacappo
[GitHub] TaintNode.js specific PR template (nodejs#57)
3635b5a
* [GitHub] Fork specific PR template

* [GitHub] Check for SemVer and Windows test-taint goal
dacappo added a commit to SAP-archive/node-rasp that referenced this pull request Jan 24, 2019
@dacappo
[GitHub] TaintNode.js specific PR template (nodejs#57)
5b933f9
* [GitHub] Fork specific PR template

* [GitHub] Check for SemVer and Windows test-taint goal
@joyeecheung joyeecheung mentioned this pull request Feb 20, 2020
repl: printing big strings results in OOM #25478
Closed
@wmertens wmertens mentioned this pull request Jun 19, 2020
uv__io_stop: Assertion `loop->watchers[w->fd] == w' failed. #33966
Closed
@silverwind silverwind mentioned this pull request Aug 20, 2020
https/http2: random crashes on macOS with simple server #34854
Closed
@avaly avaly mentioned this pull request Oct 29, 2020
ESM importing a CommonJS calls getters #35859
Closed
@puzpuzpuz puzpuzpuz mentioned this pull request Nov 11, 2020
async_hooks: async hook stack assertion shadows "Maximum call stack size exceeded" #36079
Closed
targos added a commit to targos/node that referenced this pull request Apr 27, 2021
@targos
deps: V8: cherry-pick 412ac52d8246
ca4c625
Original commit message:

    [bigint] Fix possibly-uninitialized leading digit on right shift

    (cherry picked from commit e82a3b4d47a93ab64f07d8c03e3cd17b6b961c3f)

    (cherry picked from commit 1162c460dee4218abd798b51b88926aef5c8bd61)

    No-Try: true
    No-Presubmit: true
    No-Tree-Checks: true
    Fixed: chromium:1151890
    Change-Id: I26f5c76494a9ff3f5a141f381e1c9a543e368571
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2561618
    Auto-Submit: Jakob Kummerow <[email protected]>
    Commit-Queue: Georg Neis <[email protected]>
    Reviewed-by: Georg Neis <[email protected]>
    Cr-Original-Original-Commit-Position: refs/heads/master@{#71422}
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2565245
    Reviewed-by: Jakob Kummerow <[email protected]>
    Cr-Original-Commit-Position: refs/branch-heads/8.7@{nodejs#57}
    Cr-Original-Branched-From: 0d81cd72688512abcbe1601015baee390c484a6a-refs/heads/8.7.220@{#1}
    Cr-Original-Branched-From: 942c2ef85caef00fcf02517d049f05e9a3d4b440-refs/heads/master@{#70196}
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2624611
    Commit-Queue: Victor-Gabriel Savu <[email protected]>
    Cr-Commit-Position: refs/branch-heads/8.6@{nodejs#54}
    Cr-Branched-From: a64aed2333abf49e494d2a5ce24bbd14fff19f60-refs/heads/8.6.395@{#1}
    Cr-Branched-From: a626bc036236c9bf92ac7b87dc40c9e538b087e3-refs/heads/master@{#69472}

Refs: v8/v8@412ac52
targos added a commit that referenced this pull request Apr 30, 2021
@targos
deps: V8: cherry-pick 412ac52d8246
931d31a
Original commit message:

    [bigint] Fix possibly-uninitialized leading digit on right shift

    (cherry picked from commit e82a3b4d47a93ab64f07d8c03e3cd17b6b961c3f)

    (cherry picked from commit 1162c460dee4218abd798b51b88926aef5c8bd61)

    No-Try: true
    No-Presubmit: true
    No-Tree-Checks: true
    Fixed: chromium:1151890
    Change-Id: I26f5c76494a9ff3f5a141f381e1c9a543e368571
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2561618
    Auto-Submit: Jakob Kummerow <[email protected]>
    Commit-Queue: Georg Neis <[email protected]>
    Reviewed-by: Georg Neis <[email protected]>
    Cr-Original-Original-Commit-Position: refs/heads/master@{#71422}
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2565245
    Reviewed-by: Jakob Kummerow <[email protected]>
    Cr-Original-Commit-Position: refs/branch-heads/8.7@{#57}
    Cr-Original-Branched-From: 0d81cd72688512abcbe1601015baee390c484a6a-refs/heads/8.7.220@{#1}
    Cr-Original-Branched-From: 942c2ef85caef00fcf02517d049f05e9a3d4b440-refs/heads/master@{#70196}
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2624611
    Commit-Queue: Victor-Gabriel Savu <[email protected]>
    Cr-Commit-Position: refs/branch-heads/8.6@{#54}
    Cr-Branched-From: a64aed2333abf49e494d2a5ce24bbd14fff19f60-refs/heads/8.6.395@{#1}
    Cr-Branched-From: a626bc036236c9bf92ac7b87dc40c9e538b087e3-refs/heads/master@{#69472}

Refs: v8/v8@412ac52

PR-URL: #38275
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Shelley Vohr <[email protected]>
@mertcanaltin mertcanaltin mentioned this pull request Apr 15, 2023
dev: merge HTTP chunks during chunked encoding #47575
Closed
@baophucct baophucct mentioned this pull request Jul 12, 2023
[Snyk] Fix for 1 vulnerabilities baophucct/node#36
Open
@zynda zynda mentioned this pull request Jul 13, 2023
[Snyk] Fix for 1 vulnerabilities zynda/node#10
Open
@vaibhavb vaibhavb mentioned this pull request Jul 13, 2023
[Snyk] Fix for 1 vulnerabilities vaibhavb/node#41
Open
@bumplzz69 bumplzz69 mentioned this pull request Jul 13, 2023
[Snyk] Fix for 1 vulnerabilities bumplzz69/node#52
Open
@AyushG3112 AyushG3112 mentioned this pull request Jul 13, 2023
[Snyk] Fix for 1 vulnerabilities AyushG3112/node#33
Open
@thakursachin467 thakursachin467 mentioned this pull request Jul 13, 2023
[Snyk] Fix for 1 vulnerabilities thakursachin467/node#26
Open
@Bhanditz Bhanditz mentioned this pull request Jul 14, 2023
[Snyk] Fix for 1 vulnerabilities Bhanditz/node#32
Open
@luke7oaks luke7oaks mentioned this pull request Jul 14, 2023
[Snyk] Fix for 1 vulnerabilities luke7oaks/node-1#36
Open
@nickfnblum nickfnblum mentioned this pull request Nov 30, 2023
[Snyk] Fix for 1 vulnerabilities nickfnblum/node#12
Open
@xphillyx xphillyx mentioned this pull request Nov 30, 2023
[Snyk] Fix for 1 vulnerabilities xphillyx/node#27
Open
@terrorizer1980 terrorizer1980 mentioned this pull request Dec 1, 2023
[Snyk] Fix for 3 vulnerabilities terrorizer1980/node-1#15
Open
@kaocher82 kaocher82 mentioned this pull request Dec 1, 2023
[Snyk] Fix for 1 vulnerabilities Xtuden-com/node#39
Open
@terrorizer1980 terrorizer1980 mentioned this pull request Dec 1, 2023
[Snyk] Fix for 1 vulnerabilities Exhorder6/node#24
Open
@gr00nd gr00nd mentioned this pull request Feb 5, 2024
[Snyk] Upgrade brace-expansion from 2.0.1 to 3.0.0 gr00nd/node#7
Open
@aamiaa aamiaa mentioned this pull request Feb 25, 2024
Creating a lot of worker threads at once doesn't fully release their memory once they're terminated #51868
Closed
@coderabbitai coderabbitai Bot mentioned this pull request May 8, 2026
Rewrite Bun in Rust oven-sh/bun#30412
Merged
@coderabbitai coderabbitai Bot mentioned this pull request Jun 17, 2026
refactor(utils): dedup backup helpers and document lock/exit conventions funkadelic/claude-nomad#308
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

8 participants

@ankurp @rvagg @indutny @bnoordhuis @seishun @piscisaureus @cjihrig @caineio
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.