]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/plugins/radius/radius.c
add rc_avpair_copy() and use it when sending user-specified av's. This
[ppp.git] / pppd / plugins / radius / radius.c
index 53757abcbb1701f0b9952fbe64853b08c4e4b7fe..5e27ee0b24ac3869331ff9214b71521d9d3bec44 100644 (file)
@@ -24,7 +24,7 @@
 *
 ***********************************************************************/
 static char const RCSID[] =
-"$Id: radius.c,v 1.16 2002/10/01 08:36:49 fcusack Exp $";
+"$Id: radius.c,v 1.18 2002/11/13 18:19:26 fcusack Exp $";
 
 #include "pppd.h"
 #include "chap.h"
@@ -276,7 +276,7 @@ radius_pap_auth(char *user,
 
     /* Add user specified vp's */
     if (rstate.avp)
-       rc_avpair_insert(&send, NULL, rstate.avp);
+       rc_avpair_insert(&send, NULL, rc_avpair_copy(rstate.avp));
 
     if (rstate.authserver) {
        result = rc_auth_using_server(rstate.authserver,
@@ -428,12 +428,16 @@ radius_chap_auth(char *user,
        break;
     }
 #endif
+    }
 
+    if (*remote_number) {
+       rc_avpair_add(&send, PW_CALLING_STATION_ID, remote_number, 0,
+                      VENDOR_NONE);
     }
 
     /* Add user specified vp's */
     if (rstate.avp)
-       rc_avpair_insert(&send, NULL, rstate.avp);
+       rc_avpair_insert(&send, NULL, rc_avpair_copy(rstate.avp));
 
     /*
      * make authentication with RADIUS server
@@ -840,7 +844,7 @@ radius_acct_start(void)
 
     /* Add user specified vp's */
     if (rstate.avp)
-       rc_avpair_insert(&send, NULL, rstate.avp);
+       rc_avpair_insert(&send, NULL, rc_avpair_copy(rstate.avp));
 
     if (rstate.acctserver) {
        result = rc_acct_using_server(rstate.acctserver,
@@ -940,7 +944,7 @@ radius_acct_stop(void)
 
     /* Add user specified vp's */
     if (rstate.avp)
-       rc_avpair_insert(&send, NULL, rstate.avp);
+       rc_avpair_insert(&send, NULL, rc_avpair_copy(rstate.avp));
 
     if (rstate.acctserver) {
        result = rc_acct_using_server(rstate.acctserver,
@@ -1036,7 +1040,7 @@ radius_acct_interim(void *ignored)
 
     /* Add user specified vp's */
     if (rstate.avp)
-       rc_avpair_insert(&send, NULL, rstate.avp);
+       rc_avpair_insert(&send, NULL, rc_avpair_copy(rstate.avp));
 
     if (rstate.acctserver) {
        result = rc_acct_using_server(rstate.acctserver,