You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 1911 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: feature Category: ~DO NOT USE (was: OCaml general)
Bug description
I just had the following terminal dialogue:
lobus:/tmp> rm foo
lobus:/tmp> touch foo
lobus:/tmp> ls -l foo
-rw-rw-r-- 1 tim tim 0 Oct 31 09:45 foo
lobus:/tmp> cat foo.ml
let _ = Format.printf "Hi!\n@?";;
lobus:/tmp> /usr/bin/ocamlc foo.ml -o foo
lobus:/tmp> ls -l foo
-rw-rw-r-- 1 tim tim 56642 Oct 31 09:45 foo
^^^^^^^^^^ Wrong permissions
lobus:/tmp> ./foo
./foo: Permission denied. <<<Wrong, the program should run.
lobus:/tmp> rm foo
lobus:/tmp> /usr/bin/ocamlc foo.ml -o foo
lobus:/tmp> ./foo
Hi!
lobus:/tmp>
I think ocamlc should set the permissions on its executable output
file before writing it so it isn't confused by the permissions on the
output file if it already exists. For comparison, gcc apparently does
this:
lobus:/tmp> rm foo
lobus:/tmp> touch foo
lobus:/tmp> ls -l foo
-rw-rw-r-- 1 tim tim 0 Oct 31 09:47 foo
lobus:/tmp> cat foo.c
/* stdio.h is for printf. /
#include <stdio.h>
int main () {
printf "Hi!\n";
return 0;
}
lobus:/tmp> cc foo.c -o foo
lobus:/tmp> ls -l foo
-rwxrwxr-x 1 tim tim 5153 Oct 31 09:47 foo
^^^^^^^^^^ Right permissions.
lobus:/tmp> ./foo
Hi! <<< Right, the program runs.
lobus:/tmp>
--
Tim Freeman tim@fungible.com
GPG public key fingerprint ECDF 46F8 3B80 BB9E 575D 7180 76DF FE00 34B1 5C78
Computers don't like it when you anthropomorphize them. -- Chris Phoenix
The text was updated successfully, but these errors were encountered:
Original bug ID: 1911
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Bug description
I just had the following terminal dialogue:
lobus:/tmp> rm foo
lobus:/tmp> touch foo
lobus:/tmp> ls -l foo
-rw-rw-r-- 1 tim tim 0 Oct 31 09:45 foo
lobus:/tmp> cat foo.ml
let _ = Format.printf "Hi!\n@?";;
lobus:/tmp> /usr/bin/ocamlc foo.ml -o foo
lobus:/tmp> ls -l foo
-rw-rw-r-- 1 tim tim 56642 Oct 31 09:45 foo
^^^^^^^^^^ Wrong permissions
lobus:/tmp> ./foo
./foo: Permission denied. <<<Wrong, the program should run.
lobus:/tmp> rm foo
lobus:/tmp> /usr/bin/ocamlc foo.ml -o foo
lobus:/tmp> ./foo
Hi!
lobus:/tmp>
I think ocamlc should set the permissions on its executable output
file before writing it so it isn't confused by the permissions on the
output file if it already exists. For comparison, gcc apparently does
this:
lobus:/tmp> rm foo
lobus:/tmp> touch foo
lobus:/tmp> ls -l foo
-rw-rw-r-- 1 tim tim 0 Oct 31 09:47 foo
lobus:/tmp> cat foo.c
/* stdio.h is for printf. /
#include <stdio.h>
int main () {
printf "Hi!\n";
return 0;
}
lobus:/tmp> cc foo.c -o foo
lobus:/tmp> ls -l foo
-rwxrwxr-x 1 tim tim 5153 Oct 31 09:47 foo
^^^^^^^^^^ Right permissions.
lobus:/tmp> ./foo
Hi! <<< Right, the program runs.
lobus:/tmp>
--
Tim Freeman tim@fungible.com
GPG public key fingerprint ECDF 46F8 3B80 BB9E 575D 7180 76DF FE00 34B1 5C78
Computers don't like it when you anthropomorphize them. -- Chris Phoenix
The text was updated successfully, but these errors were encountered: