Initial version.
[xavierbot.git] / ocamlbotwrapper.c.in
1 /* -*- C -*-
2  * $Id: ocamlbotwrapper.c.in,v 1.1 2007/06/28 19:47:26 rjones Exp $
3  * SUID wrapper around ocaml program.
4  */
5
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <unistd.h>
9 #include <errno.h>
10
11 const char *new_environ[] = {
12   "PATH=/usr/bin",
13   NULL
14 };
15
16 int
17 main ()
18 {
19   /* Run the ocaml program with the correct args. */
20   execle ("@OCAML@", "@OCAML@", "-init", "@INITSCRIPT@", NULL, new_environ);
21
22   /* If it failed, die with an error message. */
23   perror ("@OCAML@");
24   exit (1);
25 }