2 * $Id: ocamlbotwrapper.c.in,v 1.2 2007/06/28 20:49:10 rjones Exp $
3 * SUID wrapper around ocaml program.
11 const char *new_environ[] = {
19 /* Don't worry about races here because we're just checking that
20 * the installation looks reasonable.
22 * Die if the init script does not exist. */
23 if (access ("@INITSCRIPT@", R_OK) == -1) {
24 perror ("@INITSCRIPT@");
28 /* Die if the ocaml program does not exist. */
29 if (access ("@OCAML@", R_OK|X_OK) == -1) {
34 /* Die if the chroot directory does not exist. */
35 if (access ("@CHROOTDIR@", R_OK|X_OK) == -1) {
36 perror ("@CHROOTDIR@");
40 /* Run the ocaml program with the correct args. */
41 execle ("@OCAML@", "@OCAML@",
42 "-init", "@INITSCRIPT@",
46 /* If it failed, die with an error message. */