Original bug ID: 6081 Reporter: talex Status: closed (set by @damiendoligez on 2015-01-16T22:45:14Z) Resolution: fixed Priority: normal Severity: minor Version: 4.00.1 Target version: 4.03.0+dev / +beta1 Fixed in version: 4.03.0+dev / +beta1 Category: ~DO NOT USE (was: OCaml general) Tags: patch Parent of:#7347 Monitored by:@gasche@hcarty
Bug description
When 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.
Original bug ID: 6081
Reporter: talex
Status: closed (set by @damiendoligez on 2015-01-16T22:45:14Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.00.1
Target version: 4.03.0+dev / +beta1
Fixed in version: 4.03.0+dev / +beta1
Category: ~DO NOT USE (was: OCaml general)
Tags: patch
Parent of: #7347
Monitored by: @gasche @hcarty
Bug description
When 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 information
My attempt at a patch is here:
talex5@a0b7d7e
gasche asked me to report this here:
http://roscidus.com/blog/blog/2013/07/07/ocaml-binary-compatibility/
File attachments
The text was updated successfully, but these errors were encountered: