| | @@ -1205,11 +1205,11 @@ |
| 1205 | 1205 | ** |
| 1206 | 1206 | ** The noJail flag means that the chroot jail is not entered. But |
| 1207 | 1207 | ** privileges are still lowered to that of the user-id and group-id |
| 1208 | 1208 | ** of the repository file. |
| 1209 | 1209 | */ |
| 1210 | | -static char *enter_chroot_jail(char *zRepo, int noJail){ |
| 1210 | +char *enter_chroot_jail(char *zRepo, int noJail){ |
| 1211 | 1211 | #if !defined(_WIN32) |
| 1212 | 1212 | if( getuid()==0 ){ |
| 1213 | 1213 | int i; |
| 1214 | 1214 | struct stat sStat; |
| 1215 | 1215 | Blob dir; |
| | @@ -1396,10 +1396,18 @@ |
| 1396 | 1396 | g.zRepositoryName = g.argv[2]; |
| 1397 | 1397 | } |
| 1398 | 1398 | g.httpOut = stdout; |
| 1399 | 1399 | repo_list_page(); |
| 1400 | 1400 | } |
| 1401 | + |
| 1402 | +/* |
| 1403 | +** Called whenever a crash is encountered while processing a webpage. |
| 1404 | +*/ |
| 1405 | +void sigsegv_handler(int x){ |
| 1406 | + fossil_errorlog("Segfault"); |
| 1407 | + exit(1); |
| 1408 | +} |
| 1401 | 1409 | |
| 1402 | 1410 | /* |
| 1403 | 1411 | ** Preconditions: |
| 1404 | 1412 | ** |
| 1405 | 1413 | ** * Environment variables are set up according to the CGI standard. |
| | @@ -1429,10 +1437,14 @@ |
| 1429 | 1437 | const char *zPathInfo = PD("PATH_INFO", ""); |
| 1430 | 1438 | char *zPath = NULL; |
| 1431 | 1439 | int i; |
| 1432 | 1440 | const CmdOrPage *pCmd = 0; |
| 1433 | 1441 | const char *zBase = g.zRepositoryName; |
| 1442 | + |
| 1443 | +#if !defined(_WIN32) |
| 1444 | + signal(SIGSEGV, sigsegv_handler); |
| 1445 | +#endif |
| 1434 | 1446 | |
| 1435 | 1447 | /* Handle universal query parameters */ |
| 1436 | 1448 | if( PB("utc") ){ |
| 1437 | 1449 | g.fTimeFormat = 1; |
| 1438 | 1450 | }else if( PB("localtime") ){ |
| 1439 | 1451 | |