bug-gnu-radius
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gnu-radius] link problem when SQL is disabled


From: Ilguiz Latypov
Subject: [Bug-gnu-radius] link problem when SQL is disabled
Date: Fri, 19 Jul 2002 09:23:43 -0400 (EDT)

When no options are supplied to ./configure in gnu-radius, SQL database 
access is not compiled in.  However, rad_sql_shutdown is still referred to 
by radiusd.  I made that conditional on USE_SQL macro and this allowed me 
to link radiusd.  See the patch below.

Is this a right solution?

Ilguiz

Index: include/radiusd.h
===================================================================
RCS file: /cvsroot/radius/radius/include/radiusd.h,v
retrieving revision 1.73
diff -u -r1.73 radiusd.h
--- include/radiusd.h   17 Jul 2002 12:34:09 -0000      1.73
+++ include/radiusd.h   19 Jul 2002 13:13:29 -0000
@@ -505,3 +505,6 @@
 /* checkrad.c */
 int checkrad(NAS *nas, struct radutmp *up);
 
+/* sql.c */
+void radiusd_sql_shutdown();
+
 
Index: radiusd/radiusd.c
===================================================================
RCS file: /cvsroot/radius/radius/radiusd/radiusd.c,v
retrieving revision 1.104
diff -u -r1.104 radiusd.c
--- radiusd/radiusd.c   17 Jul 2002 12:40:08 -0000      1.104
+++ radiusd/radiusd.c   19 Jul 2002 13:13:44 -0000
@@ -60,14 +60,15 @@
 int rad_req_cmp(RADIUS_REQ *a, RADIUS_REQ *b);
 int rad_req_setup(REQUEST *radreq);
 void rad_req_xmit(int type, int code, void *data, int fd);
+void rad_cleanup(int type, RADIUS_REQ *req);
 
 struct request_class request_class[] = {
         { "AUTH", 0, MAX_REQUEST_TIME, CLEANUP_DELAY, 
           rad_req_setup, rad_authenticate, rad_req_xmit, rad_req_cmp,
-          rad_req_free, rad_req_drop, rad_sql_cleanup },
+          rad_req_free, rad_req_drop, rad_cleanup },
         { "ACCT", 0, MAX_REQUEST_TIME, CLEANUP_DELAY,
           rad_req_setup, rad_accounting, rad_req_xmit, rad_req_cmp,
-          rad_req_free, rad_req_drop, rad_sql_cleanup },
+          rad_req_free, rad_req_drop, rad_cleanup },
         { "PROXY",0, MAX_REQUEST_TIME, CLEANUP_DELAY,
           NULL, rad_proxy, rad_req_xmit, rad_req_cmp,
           rad_req_free, proxy_retry, NULL },
@@ -824,7 +825,9 @@
        radiusd_flush_queues();
        radlog(L_CRIT, _("Normal shutdown."));
 
+#ifdef USE_SQL
         radiusd_sql_shutdown();
+#endif
         exit(0);
 }
 
@@ -865,7 +868,9 @@
         
         /* Flush request queues */
         radiusd_flush_queues();
+#ifdef USE_SQL
         radiusd_sql_shutdown();
+#endif
 
        return radiusd_primitive_restart(0);
 }
@@ -1690,6 +1695,17 @@
                 break;
         }
         return 0;
+}
+
+/*ARGSUSED*/
+void
+rad_cleanup(type, req)
+        int type;
+        RADIUS_REQ *req; /* Unused */
+{
+#ifdef USE_SQL
+        rad_sql_cleanup(type, req);
+#endif
 }
 
 /* ************************************************************************* */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]