<?xml version="1.0"?>
-<Opengate version="1.4.5">
+<Opengate ConfigVersion="1.4.7">
<!-- #################################################
# ####### NEED TO MODIFY FOLLOWING PARAMETERS ##### -->
<JavaWatch>
<!-- HTTP_USER_AGENT ignoring java watch mode -->
<!-- defined by "POSIX Extended Regular Expression" -->
- <SkipAgentPattern></SkipAgentPattern>
+ <SkipAgentPattern>^$</SkipAgentPattern>
</JavaWatch>
<!-- IPFW rule number range used by opengate -->
### Forwarding http connection from unauth client
$fwcmd add 60000 fwd localhost tcp from ${inet}:${imask} to any 80
+$fwcmd add 60000 fwd localhost tcp from ${inet}:${imask} to any 443
+
### Allow TCP through if setup succeeded
$fwcmd add 60100 pass tcp from any to any established
<DD>\r
Change dir mode to install properly. Add mac check. Fix small bugs. \r
</DD>\r
+<DT>\r
+Ver.1.4.7 at 2006.11.18</DT>\r
+<DD>\r
+Fix small bugs and modify pages. Add processing time measurement for research.\r
+</DD>\r
\r
</DL>\r
<b>Please see CVS in SourceForge.net to check the file difference between versions.</b>\r
<table bgcolor="lightyellow" border="1">
<tr><td>
-Please leave this window as it is (or minimized), and work on another window.
-If another working window is not popped up,
-click <a href="%%STARTURL%%" target="_blank"><h3>[Start Page]</h3></a>
- to open.
-</td></tr>
-</table>
+<b>Please keep this window as it is or in minimized mode. </b>
+Start other browsers or other programs for network usage.
+Or click <a href="%%STARTURL%%" target="_blank"><b>[Start Page]</b></a>
+to start browsing (In some browsers,
+it is needed to push SHIFT or CTRL key to open new window.
+The window may be popped up automatically, if it is
+permited in the browser setting). </td></tr> </table>
</BODY>
</HTML>
<table bgcolor="lightyellow" border="1">
<tr><td>
-Please leave this window as it is (or minimized), and work on another window.
-If another working window is not popped up,
-click <a href="%%STARTURL%%" target="_blank"><h3>[Start Page]</h3></a>
- to open.
+<b>Please keep this window as it is or in minimized mode. </b>
+Start other browsers or other programs for network usage.
+Or click <a href="%%STARTURL%%" target="_blank"><b>[Start Page]</b></a>
+ to start browsing
+(In some browsers,
+it is needed to push SHIFT or CTRL key to open new window.
+The window may be popped up automatically, if it is
+permited in the browser setting).
</td></tr>
</table>
<table bgcolor="lightyellow" border="1">
<tr><td>
-This page can be closed. But it is recommended to save this page for termination request and work on another window.
-If another working window is not popped up,
-click <a href="%%STARTURL%%" target="_blank"><h3>[Start Page]</h3></a>
- to open.
+<b>This page can be closed.</b> But it is recommended to save this page for termination request.
+If possible, keep this window as it is or in minimized mode.
+And start other browsers or other programs for network usage.
+Or click <a href="%%STARTURL%%" target="_blank"><b>[Start Page]</b></a>
+ to start browsing
+(In some browsers,
+it is needed to push SHIFT or CTRL key to open new window.
+The window may be popped up automatically, if it is
+permited in the browser setting).
</td></tr>
</table>
-
</BODY>
</HTML>
<table bgcolor="lightyellow" border="1">
<tr><td>
-Please leave this window as it is (or minimized), and work on another window.
-If another working window is not popped up,
-click <a href="%%STARTURL%%" target="_blank"><h3>[Start Page]</h3></a>
- to open.
+<b>Please keep this window as it is or in minimized mode. </b>
+Start other browsers or other programs for network usage.
+Or click <a href="%%STARTURL%%" target="_blank"><b>[Start Page]</b></a>
+ to start browsing
+(In some browsers,
+it is needed to push SHIFT or CTRL key to open new window.
+The window may be popped up automatically, if it is
+permited in the browser setting).
</td></tr>
</table>
<hr>
-Watchdog (Change only when default is malfunctioned)<br />
+Watchdog (Change only when the network is closed frequently)<br />
<input type="radio" name="watchmode" value="H" %%CHECKHTTP%% >HTTP
<input type="radio" name="watchmode" value="J" %%CHECKJAVA%% >JAVA
<input type="radio" name="watchmode" value="T" %%CHECKTIME%% >
</TABLE>
<hr>
-Watchdog (Change only when the system is malfunctioned)<br />
+Watchdog (Change only when the network is closed frequently)<br />
<input type="radio" name="watchmode" value="H" %%CHECKHTTP%% >HTTP
<input type="radio" name="watchmode" value="J" %%CHECKJAVA%% >JAVA
<input type="radio" name="watchmode" value="T" %%CHECKTIME%% >
</div>
<hr />
-<p>\e$B>e$N\e(B2\e$BK\$N@~$N4V$K2+?'$N%P!<$,I=<($5$l$J$$>l9g!"\e(B<a href="%%TERMINATEURL%%"><b>\e$BMxMQCfCG\e(B</b></a>\e$B$r%/%j%C%/$7$F$+$i\e(B
+<p>\e$B>e$N\e(B2\e$BK\$N@~$N4V$K2+?'$N%P!<$,I=<($5$l$J$$>l9g!"\e(B
+<a href="%%TERMINATEURL%%"><b>\e$BMxMQCfCG\e(B</b></a>\e$B$r%/%j%C%/$7$F$+$i\e(B
\e$B%V%i%&%6$r=*N;$7$F$/$@$5$$!#\e(B
<script language="JavaScript">
<table bgcolor="lightyellow" border="1">
<tr><td>
-<b>\e$B$3$N%Z!<%8$O$3$N$^$^$K!JKt$O:G>/2=!K$7$F!"JL$N%&%$%s%I%&$G:n6H$7$F$/$@$5$$!#\e(B</b>
-\e$B:n6HMQ%&%#%s%I%&$,3+$+$J$$>l9g$K$O!"\e(B<a href="%%STARTURL%%" target="_blank"><h3>[\e$B%9%?!<%H%Z!<%8\e(B]</h3></a>\e$B$r%/%j%C%/$7$F$/$@$5$$!#\e(B
+<b>\e$B$3$N%Z!<%8$O$3$N$^$^$+!"Kt$O:G>/2=>uBV$K$7$F2<$5$$!#\e(B</b>
+\e$B%M%C%H%o!<%/MxMQ$O!"JL$K%V%i%&%6$=$NB>$N%M%C%H%o!<%/MxMQ%W%m%0%i%`$r5/F0$7$F9T$C$F$/$@$5$$!#\e(B
+\e$B$^$?$O!"\e(B<a href="%%STARTURL%%" target="_blank"><b>[\e$B%9%?!<%H%Z!<%8\e(B]
+</b></a>\e$B$+$i3+;O$7$F$/$@$5$$!J%V%i%&%6$K$h$C$F$O!"%7%U%H$^$?\e(B
+\e$B$O%3%s%H%m!<%k%-!<$r2!$7$J$,$i%/%j%C%/$9$kI,MW$,$"$j$^$9!#%]%C%W%"%C%W5v2D$K@_Dj$9$l$P<+F0I=<(2DG=$G$9!K!#\e(B
</td></tr>
</table>
<table bgcolor="lightyellow" border="1">
<tr><td>
-<b>\e$B$3$N%Z!<%8$O$3$N$^$^$K!JKt$O:G>/2=!K$7$F!"JL$N%&%$%s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"Kt$O:G>/2=>uBV$K$7$F2<$5$$!#\e(B
+\e$B%M%C%H%o!<%/MxMQ$O!"JL$K%V%i%&%6$=$NB>$N%M%C%H%o!<%/MxMQ%W%m%0%i%`$r5/F0$7$F9T$C$F$/$@$5$$!#\e(B
+\e$B$^$?$O!"\e(B<a href="%%STARTURL%%" target="_blank"><b>[\e$B%9%?!<%H%Z!<%8\e(B]
+</b></a>\e$B$+$i3+;O$7$F$/$@$5$$!J%V%i%&%6$K$h$C$F$O!"%7%U%H$^$?\e(B
+\e$B$O%3%s%H%m!<%k%-!<$r2!$7$J$,$i%/%j%C%/$9$kI,MW$,$"$j$^$9!#%]%C%W%"%C%W5v2D$K@_Dj$9$l$P<+F0I=<(2DG=$G$9!K!#\e(B</td></tr>
</table>
</body>
(<A HREF="http://webmailer.cc.saga-u.ac.jp/">\e$B%&%'%V%a%$%i!<\e(B</A>)
<A HREF="http://www.lib.saga-u.ac.jp/">\e$BBg3XImB0?^=q4[$N%Z!<%8\e(B</A>
<A HREF="http://job.admin.saga-u.ac.jp/">\e$BBg3X="?&AjCL<<$N%Z!<%8\e(B</A>
-<A HREF="http://www.sagadirect.net/index.php/">SAGA\e$B%@%$%l%/%H\e(B</A>
+<A HREF="http://www.sagadirect.net/index.php">SAGA\e$B%@%$%l%/%H\e(B</A>
</P>
<HR>
<P>\e$B8!:w%(%s%8%s\e(B&\e$B%]!<%?%k%5%$%H\e(B</P>
<table bgcolor="lightyellow" border="1">
<tr><td>
-<b>\e$B$3$N%Z!<%8$O$3$N$^$^$K!JKt$O:G>/2=!K$7$F!"JL$N%&%$%s%I%&$G:n6H$7$F$/$@$5$$!#\e(B</b>
-\e$B:n6HMQ%&%#%s%I%&$,3+$+$J$$>l9g$K$O!"\e(B
-<a href="%%STARTURL%%" target="_blank"><h3>[\e$B%9%?!<%H%Z!<%8\e(B]</h3></a>
-\e$B$r%/%j%C%/$7$F$/$@$5$$!#\e(B
-</td></tr>
+<b>\e$B$3$N%Z!<%8$O$3$N$^$^$+!"Kt$O:G>/2=>uBV$K$7$F2<$5$$!#\e(B</b>
+\e$B%M%C%H%o!<%/MxMQ$O!"JL$K%V%i%&%6$=$NB>$N%M%C%H%o!<%/MxMQ%W%m%0%i%`$r5/F0$7$F9T$C$F$/$@$5$$!#\e(B
+\e$B$^$?$O!"\e(B<a href="%%STARTURL%%" target="_blank"><b>[\e$B%9%?!<%H%Z!<%8\e(B]
+</b></a>\e$B$+$i3+;O$7$F$/$@$5$$!J%V%i%&%6$K$h$C$F$O!"%7%U%H$^$?\e(B
+\e$B$O%3%s%H%m!<%k%-!<$r2!$7$J$,$i%/%j%C%/$9$kI,MW$,$"$j$^$9!#%]%C%W%"%C%W5v2D$K@_Dj$9$l$P<+F0I=<(2DG=$G$9!K!#\e(B</td></tr>
</table>
<script type="text/JavaScript">
</table>
<hr>
-\e$B3+J|4F;k!JDL>o$O$3$N$^$^$G7k9=$G$9!#F0:n$,$*$+$7$$$H$-$KJQ99$7$F$/$@$5$$!#!K\e(B<br />
+\e$B3+J|4F;k!JDL>o$O$3$N$^$^$G7k9=$G$9!#IQHK$K@Z$l$k$H$-$OJQ99$7$F$/$@$5$$!#!K\e(B<br />
<input type="radio" name="watchmode" value="H" %%CHECKHTTP%% >HTTP
<input type="radio" name="watchmode" value="J" %%CHECKJAVA%% >JAVA
<input type="radio" name="watchmode" value="T" %%CHECKTIME%% >
</TABLE>
<hr>
-\e$B3+J|4F;k!JDL>o$O$3$N$^$^$G7k9=$G$9!#F0:n$,$*$+$7$$$H$-$KJQ99$7$F$/$@$5$$!#!K\e(B<br />
+\e$B3+J|4F;k!JDL>o$O$3$N$^$^$G7k9=$G$9!#IQHK$K@Z$l$k$H$-$OJQ99$7$F$/$@$5$$!#!K\e(B<br />
<input type="radio" name="watchmode" value="H" %%CHECKHTTP%% >HTTP
<input type="radio" name="watchmode" value="J" %%CHECKJAVA%% >JAVA
<input type="radio" name="watchmode" value="T" %%CHECKTIME%% >
<P>
\e$B<+F00\F0$G$-$J$$J}$O$3$A$i$r%/%j%C%/$7$F2<$5$$!#\e(B
<P>
-<a href="https://%%AUTHCGIURL%%?%%addr=ADDR4%%&lang=ja">\e$B%M%C%H%o!<%/MxMQ<TG'>Z\e(B</a><br>
-<a href="http://%%AUTHCGIURL%%?%%addr=ADDR4%%&lang=ja">\e$B%M%C%H%o!<%/MxMQ<TG'>Z!J\e(BSSL\e$BHsBP1~!K\e(B</a>
+<a href="https://%%AUTHCGIURL%%?addr=%%ADDR4%%&lang=ja">\e$B%M%C%H%o!<%/MxMQ<TG'>Z\e(B</a><br>
+<a href="http://%%AUTHCGIURL%%?addr=%%ADDR4%%&lang=ja">\e$B%M%C%H%o!<%/MxMQ<TG'>Z!J\e(BSSL\e$BHsBP1~!K\e(B</a>
<HR>
\e$B:42lBg3X\e(B
</BODY>
test-cgi.o: ${HDRS}
+
+
+
printf("Content-type: text/html\r\n\r\n\r\n");
while(fgets(buff, BUFFMAXLN, fp)!=NULL){
+ /* length check */
+ if(strlen(buff)>=BUFFMAXLN-1){
+ err_msg("ERR at %s#%d: too long line in %s",__FILE__,__LINE__,acceptdoc);
+ }
+
/* replace mark */
htmlReplace(buff, "%%OPENGATEDIR%%", opengateDir);
htmlReplace(buff, "%%OPENGATEPORT%%", portStr);
RemoveOverlapRule(overlapRule4,overlapRule6);
KillOverlapProcess(overlapRule4,overlapRule6,clientAddr4,clientAddr6);
- err_msg("INFO: user %s forces to close overlapped client", userid);
+ if(debug>0)err_msg("INFO: user %s forces to close overlapped client", userid);
PutClientMsg("Network is closed. Please End Web and Retry. ");
}
return FALSE;
#include "opengatesrv.h"
#include "../ezxml/ezxml.h"
-#define CONFFILE_VERSION "1.4.5"
+#define CONFIG_VERSION "1.4.7"
#define SEPARATOR "/"
int debug=0;
}
/* check the config file version */
- if(isNull(ezxml_attr(xmlRoot, "version"))||
- (strcmp(CONFFILE_VERSION, ezxml_attr(xmlRoot, "version"))!=0)){
+ if(isNull(ezxml_attr(xmlRoot, "ConfigVersion"))||
+ (strcmp(CONFIG_VERSION, ezxml_attr(xmlRoot, "ConfigVersion"))!=0)){
strncpy(buff, "<H3>Error: Opengate configuration file ",BUFFMAXLN);
strncat(buff, CONFIGFILE, BUFFMAXLN);
strncat(buff, " has mismatch version.<br> Please update it with ",BUFFMAXLN);
/* if not get, write error message */
if(isNull(pValue)){
+ /* AuthServer parameters (except Protocol) might be omitted */
if((strstr(name,"AuthServer")==name)&&
strstr(name,"AuthServer/Protocol")==NULL){
- /* AuthServer parameters (except Protocol) might be omitted */
- /* in some auth server setting such as pam */
-
}else{
/* other parameters must be set */
err_msg("ERR at %s#%d: cannot get %s from conf file",__FILE__,__LINE__,name);
while(fgets(buff,BUFFMAXLN,fp)!=NULL){
+ /* length check */
+ if(strlen(buff)>=BUFFMAXLN-1){
+ err_msg("ERR at %s#%d: too long line in %s",__FILE__,__LINE__,filename);
+ }
+
i=0;
while( strcmp(keys[i].name,"")!=0 ){
htmlReplace(buff, keys[i].name, keys[i].val);
char userProperty[BUFFMAXLN];
time_t timeIn, timeOut;
int connectionMode; /* client connect mode */
+/* variable to measuring processing time (in msec) */
+struct timeval timeBeginCgi, timeBeginWait, timeConnect, timeDisconnect;
+
char sessionId[BUFFMAXLN]; /* session ID */
void PutCloseMsg(time_t timeOut, time_t timeIn);
int ipStatus; /* flag for IPv4 or IPv6 */
char watchMode[WORDMAXLN]; /* client watch mode Http or Java or Timeout */
+ /* get time at the cgi starting (in msec) */
+ gettimeofday(&timeBeginCgi, NULL) ;
+
/* prepare config file */
if(OpenConfFile()==-1) return 0;
Pipe(dummyfd); /* connect dummy pipe for stdin and out */
+ /* get time at the client wait start (in msec) */
+ gettimeofday(&timeBeginWait, NULL) ;
+
/* wait connection from the client */
/* if no connection, close gate when duration is passed */
/* or ipaddr for the macAddr4 is changed */
connectionMode=WaitClientConnect(userid, userProperty, sessionId, clientAddr4, clientAddr6, duration, macAddr4, macAddr6, ipStatus, pClientAddr, language, port, parentpid);
+ /* get time at the client connection (in msec) */
+ gettimeofday(&timeConnect, NULL) ;
+
if(connectionMode==JAVACONNECT){
/* wait until the java applet quit */
void logConnectMode(char *userid)
{
char *mode[4]={"NONE","JAVA","HTTP","TIME"};
+ long time1sec,time2sec,time3sec;
+ long time1usec,time2usec,time3usec;
+
+ /* get time at the end of connection (in msec) */
+ gettimeofday(&timeDisconnect, NULL) ;
+
+ /* time difference (seconds(sec) and micro-seconds(usec)) */
+ time1sec=(timeBeginWait.tv_sec - timeBeginCgi.tv_sec);
+ time1usec=(timeBeginWait.tv_usec - timeBeginCgi.tv_usec);
+ if(time1usec<0){
+ time1usec += 1000000; time1sec--;
+ }
+ time2sec=(timeConnect.tv_sec - timeBeginWait.tv_sec);
+ time2usec=(timeConnect.tv_usec - timeBeginWait.tv_usec);
+ if(time2usec<0){
+ time2usec += 1000000; time2sec--;
+ }
+ time3sec=(timeDisconnect.tv_sec - timeConnect.tv_sec);
+ time3usec=(timeDisconnect.tv_usec - timeConnect.tv_usec);
+ if(time3usec<0){
+ time3usec += 1000000; time3sec--;
+ }
if(connectionMode<0 || connectionMode>3) connectionMode=0;
- if(debug>0) err_msg("INFO: user %s is watched by [%s]",userid, mode[connectionMode]);
+ if(debug>0) err_msg("INFO: user %s is watched by [%s] procsec(%ld.%ld,%ld.%ld,%ld.%ld)",
+ userid, mode[connectionMode],
+ time1sec,time1usec,
+ time2sec,time2usec,
+ time3sec,time3usec);
}
getenv("CONTENT_LENGTH"));
printf("<TR><TD>HTTP_REFERER</TD><TD>%s</TD></TR>\r\n",
getenv("HTTP_REFERER"));
+ printf("<TR><TD>HTTP_USER_AGENT</TD><TD>%s</TD></TR>\r\n",
+ getenv("HTTP_USER_AGENT"));
printf("</TABLE> \r\n");
printf("</BODY></HTML> \r\n\r\n");
while(fgets(buff, BUFFMAXLN, fp)!=NULL){
+ /* length check */
+ if(strlen(buff)>=BUFFMAXLN-1){
+ err_msg("ERR at %s#%d: too long line in %s",__FILE__,__LINE__,httpKeepDoc);
+ }
+
/* replace mark */
htmlReplace(buff, "%%HTTPHELLOINTERVAL%%", httpHelloInterval);
htmlReplace(buff, "%%HTTPHELLOURL%%", httpHelloUrl);