Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Relative paths are relative to Atom's $PWD, not the project root #219

Open
Bruno02468 opened this issue Jul 14, 2020 · 0 comments
Open

Relative paths are relative to Atom's $PWD, not the project root #219

Bruno02468 opened this issue Jul 14, 2020 · 0 comments

Comments

@Bruno02468
Copy link

Suppose I invoke Atom from dmenu (making it start under /home/bruno), and it auto-reopens my last project, under /home/bruno/Git/project. Upon saving, linter-gcc should run gcc from /home/bruno/Git/project as said in the package description ("Paths are expanded relative to the project that contains the file being linted.").

However, gcc runs under /home/bruno, thus breaking all the relative include paths specified in .gcc-flags.json., among other things.

In order to reproduce/prove, edit the config file and replace /usr/bin/gcc with a path to some shell script that reports its own $PWD, such as one containing the command xmessage "at: $PWD --- args: $*" &, which will simply open a pop-up with its $PWD and parameters. Then, just launch atom from any folder, letting it reopen the last project, save a C source file, and wait for it.

The linter is therefore unusable unless I start Atom from the exact project folder every time (not convenient) or specify absolute paths everywhere (not portable). Besides, this is arguably a security flaw too, since broken relative paths can be made to lead to files the user does not intend on compiling... keep in mind the C preprocessor alone can do arbitrary computation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant