OSDN Git Service

Ver.1.5.9: Fixed errors at including many cookies and in retry.html
authorwatanaby <>
Fri, 13 May 2011 01:20:31 +0000 (01:20 +0000)
committerwatanaby <>
Fri, 13 May 2011 01:20:31 +0000 (01:20 +0000)
opengate/doc/Changes.html
opengate/javahtml/en/retry.html
opengate/javahtml/ja/retry.html
opengate/opengatesrv/comm-cgi.c

index 18fb715..ad7a437 100644 (file)
@@ -667,6 +667,10 @@ Opengate History</H3>
        Ver.1.5.8 at 2011.5.9
        </DT><DD>
         Fixed error on arp entry expiring [contributed by S.Horikawa]. 
+       </DD><DT>
+       Ver.1.5.9 at 2011.5.13
+       </DT><DD>
+        Fixed errors at including many cookies and in retry.html [contributed by S.Horikawa]. 
        </DD>
        </DL>
 <P>
index 8e81f35..654f770 100644 (file)
@@ -26,8 +26,8 @@ The authentication page is displayed automatically.</P>
 <P>If you do not need IPv4/IPv6 dual stack support, use one of the following links. This way, the system will only controls either IPv4 or IPv6.
 </P>
 <P>
-<a href="https://%%AUTHCGIURL%%?0-0-0&en">Network Authentication</a> 
-<a href="http://%%AUTHCGIURL%%?0-0-0&en">Network Authentication(Unuse SSL)</a>
+<a href="https://%%AUTHCGIURL%%?addr=0-0-0&lang=en">Network Authentication</a> 
+<a href="http://%%AUTHCGIURL%%?addr=0-0-0&lang=en">Network Authentication(Unuse SSL)</a>
 </P>
 </SMALL>
 </BODY>
index d3b50fb..98b8d9c 100644 (file)
@@ -26,7 +26,7 @@
 以下のリンクも使用できますが、IPv4とIPv6のどちらか一方のみを制御します。
 </P>
 <P>
-<a href="https://%%AUTHCGIURL%%?0-0-0&ja">ネットワーク利用者認証</a> <a href="http://%%AUTHCGIURL%%?0-0-0&ja">ネットワーク利用者認証(SSL非対応)</a>
+<a href="https://%%AUTHCGIURL%%?addr=0-0-0&lang=ja">ネットワーク利用者認証</a> <a href="http://%%AUTHCGIURL%%?addr=0-0-0&lang=ja">ネットワーク利用者認証(SSL非対応)</a>
 </P>
 </SMALL>
 </BODY>
index a5a42e1..7fcf2b9 100644 (file)
@@ -219,12 +219,18 @@ int getCookieData(char *userid, char *clientAddr4, int *duration, int *durationE
 /*********************************************/
 /* get HTTP-Cookie for OpengateAuth          */
 /*********************************************/
+  /* cookie string examples 
+  "OpengateAuth=de..ac1&Userid=user1"
+  "OpengateAuth=de..ac1&Userid=user1; xxx=..; yyy=.."
+  "xxx=..; yyy=..; OpengateAuth=de..ac1&Userid=user1"
+  */
 int getAuthCookie(char *cookie, char *userid){
   char content[BUFFMAXLN];
   char *name[1];
   char *value[1];
   char *next[1];
-  char *ptr;
+  char *ptr=NULL;
+  char *ptrNext=NULL;
 
   /* reset buffer */
   cookie[0]='\0';
@@ -235,8 +241,17 @@ int getAuthCookie(char *cookie, char *userid){
   strncpy(content, getenv("HTTP_COOKIE"), BUFFMAXLN);
   ptr=content;
 
+  /* search 'OpengateAuth' cookie string (terminated by ; or \0) */
+  while(ptr!=NULL){
+    if((ptrNext=strstr(ptr, "; "))==NULL) break;          /* search "; " */
+    *ptrNext='\0';                               /* overwrite string end */
+    ptrNext++;                                 /* pointer to next string */
+    while(!isNull(ptrNext)&&*ptrNext==' ') ptrNext++;     /* skip spaces */
+    if(strstr(ptr, COOKIENAME)==ptr) break;          /* exit at matching */
+    ptr=ptrNext;                                    /* check next string */
+  }
 
-  /* get valuses of cookie */
+  /* get valuses of cookie from "OpengateAuth=de..ac1&Userid=user1" */
   while(ptr!=NULL){
     split(ptr, name, value, next);