[Nagiosplug-devel] patch for check_radius

Ton Voon tonvoon at mac.com
Thu Mar 18 12:43:21 CET 2004


Alexander,

Thanks for the patch. I have applied to check_raidus.c v1.10. I don't 
have a radius device to check against - please can you verify from the 
CVS snapshot.

Ton

On 18 Mar, 2004, at 13:02, Alexander Kulak wrote:

> Hello.
>
>
> A trivial patch against today CVS snapshot
> for making check_radius fill in NAS-Identifier attribute on request.
> It was necessary for emulating pam_radius behaviour, which sends
> PAM_SERVICE in this attribute.
>
>
> -- 
> Alexander Kulak
> European Humanities University
> system administrator
>
> --- check_radius.c.orig	2004-03-18 13:43:18.000000000 +0200
> +++ check_radius.c	2004-03-18 14:28:44.000000000 +0200
> @@ -34,4 +34,5 @@
>  char *username = NULL;
>  char *password = NULL;
> +char *nasid = NULL;
>  char *expect = NULL;
>  char *config_file = NULL;
> @@ -120,5 +121,6 @@
>  	if (!(rc_avpair_add (&data.send_pairs, PW_SERVICE_TYPE, &service, 0) 
> &&
>  				rc_avpair_add (&data.send_pairs, PW_USER_NAME, username, 0) &&
> -				rc_avpair_add (&data.send_pairs, PW_USER_PASSWORD, password, 0)))
> +				rc_avpair_add (&data.send_pairs, PW_USER_PASSWORD, password, 0) &&
> +				(nasid==NULL || rc_avpair_add (&data.send_pairs, 
> PW_NAS_IDENTIFIER, nasid, 0))))
>  		die (STATE_UNKNOWN, _("Out of Memory?"));
>
> @@ -168,4 +170,5 @@
>  		{"username", required_argument, 0, 'u'},
>  		{"password", required_argument, 0, 'p'},
> +		{"nas-id", required_argument, 0, 'n'},
>  		{"filename", required_argument, 0, 'F'},
>  		{"expect", required_argument, 0, 'e'},
> @@ -203,5 +206,5 @@
>
>  	while (1) {
> -		c = getopt_long (argc, argv, "+hVvH:P:F:u:p:t:r:e:", longopts,
> +		c = getopt_long (argc, argv, "+hVvH:P:F:u:p:n:t:r:e:", longopts,
>  									 &option);
>
> @@ -243,4 +246,7 @@
>  			password = optarg;
>  			break;
> +		case 'n':									/* nas id */
> +			nasid = optarg;
> +			break;
>  		case 'F':									/* configuration file */
>  			config_file = optarg;
> @@ -295,4 +301,6 @@
>   -p, --password=STRING\n\
>      Password for autentication (SECURITY RISK)\n\
> + -n, --nas-id=STRING\n\
> +    NAS identifier\n\
>   -F, --filename=STRING\n\
>      Configuration file\n\
> @@ -329,5 +337,5 @@
>  {
>  	printf ("\
> -Usage: %s -H host -F config_file -u username -p password [-P port]\n\
> +Usage: %s -H host -F config_file -u username -p password [-n nas-id] 
> [-P port]\n\
>    [-t timeout] [-r retries] [-e expect]\n", progname);
>  	printf (_(UT_HLP_VRS), progname, progname);





More information about the Devel mailing list