Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006081OCamlOCaml generalpublic2013-07-19 11:182014-09-24 00:07
Reportertalex 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusacknowledgedResolutionopen 
PlatformOSOS Version
Product Version4.00.1 
Target Versionafter-4.02.1Fixed in Version 
Summary0006081: ocaml should add script's directory to search path, not current directory
DescriptionWhen running "ocaml /path/to/script.ml", OCaml searches the current directory first for libraries. This is probably not useful, and can be a security risk. It would make more sense to add the script's directory to the search path instead, as e.g. Python does.
Steps To Reproduce$ cat /usr/local/bin/show_home
#!/usr/bin/ocaml
#load "unix.cma";;
print_endline (Unix.getenv "HOME")

$ touch /tmp/unix.cma

$ cd /
$ show_home
/home/tal

$ cd /tmp
$ show_home
Fatal error: exception End_of_file
Additional InformationMy attempt at a patch is here:

https://github.com/talex5/ocaml/commit/a0b7d7ea9d4f330e0e0c239c89989b769872d27f [^]

gasche asked me to report this here:

http://roscidus.com/blog/blog/2013/07/07/ocaml-binary-compatibility/ [^]
Tagspatch
Attached Filespatch file icon a0b7d7ea9d4f330e0e0c239c89989b769872d27f.patch [^] (4,888 bytes) 2014-01-17 16:12 [Show Content]

- Relationships

-  Notes
(0010201)
doligez (administrator)
2013-08-19 16:55

Makes sense, but I don't think it has anything to do with the runtime system.
(0010807)
doligez (administrator)
2014-01-17 16:13

Got the patch from github and uploaded it here.

(hint: just add ".patch" to github's commit URL to get the raw patch file)

- Issue History
Date Modified Username Field Change
2013-07-19 11:18 talex New Issue
2013-08-19 16:55 doligez Note Added: 0010201
2013-08-19 16:55 doligez Category OCaml runtime system => OCaml general
2013-08-19 16:55 doligez Status new => acknowledged
2013-08-19 16:55 doligez Target Version => 4.01.1+dev
2014-01-17 16:11 doligez Tag Attached: patch
2014-01-17 16:12 doligez File Added: a0b7d7ea9d4f330e0e0c239c89989b769872d27f.patch
2014-01-17 16:13 doligez Note Added: 0010807
2014-05-25 20:20 doligez Target Version 4.01.1+dev => 4.02.0+dev
2014-07-24 22:59 doligez Target Version 4.02.0+dev => 4.02.1+dev
2014-09-04 00:25 doligez Target Version 4.02.1+dev => undecided
2014-09-24 00:07 doligez Target Version undecided => after-4.02.1


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker