2012-02-04 10:16:01 -07:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
const char *basepath = "/usr/share/IlohaMail/source";
|
|
|
|
|
|
|
|
int
|
|
|
|
main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
char *pathinfo = getenv("PATH_INFO");
|
|
|
|
char filename[512];
|
|
|
|
|
2012-05-26 21:27:34 -06:00
|
|
|
if ((! pathinfo) ||
|
|
|
|
(! strcmp(pathinfo, "/")) ||
|
|
|
|
(0 == strcmp(pathinfo, "/index.html"))) {
|
2012-02-04 10:16:01 -07:00
|
|
|
pathinfo = "/index.php";
|
|
|
|
}
|
|
|
|
snprintf(filename, sizeof filename, "%s%s", basepath, pathinfo);
|
|
|
|
setenv("SCRIPT_FILENAME", filename, 1);
|
|
|
|
execl("/usr/bin/php-cgi", filename, NULL);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|