[Nagiosplug-checkins] CVS: nagiosplug/plugins check_radius.c,1.9,1.10

Ton Voon tonvoon at users.sourceforge.net
Thu Mar 18 12:42:30 CET 2004


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30591

Modified Files:
	check_radius.c 
Log Message:
Option to fill in NAS-identifier to Emulate pam_radius behaviour (Alexander Kulak)


Index: check_radius.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_radius.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** check_radius.c	22 Aug 2003 06:22:38 -0000	1.9
--- check_radius.c	18 Mar 2004 20:31:52 -0000	1.10
***************
*** 34,37 ****
--- 34,38 ----
  char *username = NULL;
  char *password = NULL;
+ char *nasid = NULL;
  char *expect = NULL;
  char *config_file = NULL;
***************
*** 120,124 ****
  	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)))
  		die (STATE_UNKNOWN, _("Out of Memory?"));
  
--- 121,126 ----
  	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) &&
! 				(nasid==NULL || rc_avpair_add (&data.send_pairs, PW_NAS_IDENTIFIER, nasid, 0))))
  		die (STATE_UNKNOWN, _("Out of Memory?"));
  
***************
*** 168,171 ****
--- 170,174 ----
  		{"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,207 ****
  
  	while (1) {
! 		c = getopt_long (argc, argv, "+hVvH:P:F:u:p:t:r:e:", longopts,
  									 &option);
  
--- 206,210 ----
  
  	while (1) {
! 		c = getopt_long (argc, argv, "+hVvH:P:F:u:p:n:t:r:e:", longopts,
  									 &option);
  
***************
*** 243,246 ****
--- 246,252 ----
  			password = optarg;
  			break;
+ 		case 'n':									/* nas id */
+ 			nasid = optarg;
+ 			break;
  		case 'F':									/* configuration file */
  			config_file = optarg;
***************
*** 295,298 ****
--- 301,306 ----
   -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,333 ****
  {
  	printf ("\
! Usage: %s -H host -F config_file -u username -p password [-P port]\n\
    [-t timeout] [-r retries] [-e expect]\n", progname);
  	printf (_(UT_HLP_VRS), progname, progname);
--- 337,341 ----
  {
  	printf ("\
! 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 Commits mailing list