[Nagiosplug-devel] 1.4.10 Release

Holger Weiss holger at CIS.FU-Berlin.DE
Tue Sep 25 19:40:32 CEST 2007


* Matthias Eble <matthias.eble at mailing.kaufland-informationssysteme.com> [2007-09-24 18:33]:
> just want to tell that I committed all my planned changes for 1.4.10.

Me too.

> Maybe someone wants to fix option processing in check_radius before
> releasing. I'd also recommend to change or drop positional argument
> support for check_radius. It's just too confusing if you ask me.

Indeed.  Does anyone have an idea why it was added in the first place?
The first revision in SVN already has it, and there's no comment in the
code.  It's not documented in the --help output, so I'd tend to simply
removing it.  Any objections against the attached patch (which also
checks whether all required arguments have been specified as suggested
by Thomas in #1218438)?

> Although it's no showstopper for me.

Agreed.

Holger
-------------- next part --------------
Index: check_radius.c
===================================================================
--- check_radius.c	(revision 1798)
+++ check_radius.c	(working copy)
@@ -228,27 +228,6 @@
 	if (argc < 2)
 		return ERROR;
 
-	if (argc == 9) {
-		config_file = argv[1];
-		username = argv[2];
-		password = argv[3];
-		if (is_intpos (argv[4]))
-			timeout_interval = atoi (argv[4]);
-		else
-			usage2 (_("Timeout interval must be a positive integer"), optarg);
-		if (is_intpos (argv[5]))
-			retries = atoi (argv[5]);
-		else
-			usage4 (_("Number of retries must be a positive integer"));
-		server = argv[6];
-		if (is_intpos (argv[7]))
-			port = atoi (argv[7]);
-		else
-			usage4 (_("Port must be a positive integer"));
-		expect = argv[8];
-		return OK;
-	}
-
 	while (1) {
 		c = getopt_long (argc, argv, "+hVvH:P:F:u:p:n:t:r:e:", longopts,
 									 &option);
@@ -309,6 +288,16 @@
 			break;
 		}
 	}
+
+	if (server == NULL)
+		usage4 (_("Host not specified"));
+	if (username == NULL)
+		usage4 (_("User not specified"));
+	if (password == NULL)
+		usage4 (_("Password not specified"));
+	if (config_file == NULL)
+		usage4 (_("Configuration file not specified"));
+
 	return OK;
 }
 


More information about the Devel mailing list