Bug 9826 – import doesn't work with absolute paths

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-03-28T13:48:20Z
Last change time
2024-12-13T18:05:29Z
Assigned to
No Owner
Creator
Timothee Cour
Moved to GitHub: dmd#18550 →

Comments

Comment #0 by timothee.cour2 — 2013-03-28T13:48:20Z
dmd -J. main.d //CT error dmd -J/ main.d //works main.d ---- void main(){enum x=import(__FILE__);} ----
Comment #1 by andrej.mitrovich — 2013-03-29T06:59:42Z
Which OS? I'm seeing the opposite effect: dmd -J. main.d // works dmd -J/ main.d // CT error
Comment #2 by andrej.mitrovich — 2013-03-29T06:59:59Z
(In reply to comment #1) > Which OS? I'm seeing the opposite effect: > > dmd -J. main.d // works > dmd -J/ main.d // CT error Mine using Win7.
Comment #3 by timothee.cour2 — 2013-03-29T10:26:53Z
(In reply to comment #2) > (In reply to comment #1) > > Which OS? I'm seeing the opposite effect: > > > > dmd -J. main.d // works > > dmd -J/ main.d // CT error > > Mine using Win7. OSX. also, I actually meant compile with absolute path to main.d given to dmd: dmd -J. /path/to/main.d //fails dmd -J/ /path/to/main.d //works so that __FILE__ is an absolute path
Comment #4 by timothee.cour2 — 2013-03-29T10:36:53Z
(In reply to comment #2) > (In reply to comment #1) > > Which OS? I'm seeing the opposite effect: > > > > dmd -J. main.d // works > > dmd -J/ main.d // CT error > > Mine using Win7. OSX. also, I actually meant compile with absolute path to main.d given to dmd: dmd -J. /path/to/main.d //fails dmd -J/ /path/to/main.d //works so that __FILE__ is an absolute path
Comment #5 by dlang-bugzilla — 2015-03-27T16:45:41Z
String-importing absolute paths to arbitrary files are forbidden by design, to prevent programs from capturing arbitrary files from the filesystem during compilation. The bug is that the compiler should realize that the absolute path, in fact, points to a file that is under the allowed string import path (-J.).
Comment #6 by robert.schadek — 2024-12-13T18:05:29Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18550 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB