/* drop root privilege */
seteuid(getuid());
+ /* if this is executed in shell with '-v' option, show make dir */
+ if(argc>1 && strcmp(argv[1],"-v")==0){
+ printf("makedir: %s\n", MAKEDIR);
+ exit(0);
+ }
+
/* get time at the cgi starting (in msec) */
gettimeofday(&timeBeginCgi, NULL) ;
/* setup pointer to ExtraSet in config file */
SetupConfExtra(useridshort, extraId);
+ /* setup static variable value for SqLite3_busy_timeout from conf */
+ SetupSqliteBusyTimeoutValue();
+
/* get address of client from getenv. it might be IPv4 or IPv6. */
GetClientAddr(clientAddr6);
/* open firewall for the client */
if(OpenClientGate(clientAddr4,macAddr4,clientAddr6,macAddr6,
- userid,userProperty,ipStatus)==FALSE) return 0;
+ userid,userProperty,ipStatus)==FALSE){
+ PutClientMsg("Error: Close this browser and retry");
+ return 0;
+ }
timeIn=time(NULL);
/* set (ruleNumber,userid,clientAddr) in process title */
return 0;
}
-
/*******************************************/
/* calc connection duration and put it out */
/*******************************************/
time3usec += 1000000; time3sec--;
}
- if(debug>0) err_msg("INFO: user=%s watchmode=%s procsec=%ld.%06ld,%ld.%06ld,%ld.%06ld ipversion=%d useragent=%s",
+ if(debug>0) err_msg("INFO: user=%s watchmode=%s procsec=%ld.%06ld,%ld.%06ld,%ld.%06ld ipversion=%d ipaddr=%s,%s macaddr=%s ipfwrule=%s,%s useragent=%s",
userid, mode[conMode],
time1sec,time1usec,
time2sec,time2usec,
time3sec,time3usec,
- ipStatus, getenv("HTTP_USER_AGENT"));
+ ipStatus,
+ clientAddr4,clientAddr6,macAddr4,
+ ruleNumber4, ruleNumber6,
+ getenv("HTTP_USER_AGENT"));
}