Code

Misplaced comment
[nagiosplug.git] / plugins / check_radius.c
index 2afe3c8897aecfe6e496144780c47311b4300fe8..5021a57a5422ff195dd8e6f4020cd89d625bc92e 100644 (file)
@@ -149,6 +149,9 @@ main (int argc, char **argv)
        bindtextdomain (PACKAGE, LOCALEDIR);
        textdomain (PACKAGE);
 
+       /* Parse extra opts if any */
+       argv=np_extra_opts (&argc, argv, progname);
+
        if (process_arguments (argc, argv) == ERROR)
                usage4 (_("Could not parse arguments"));
 
@@ -257,7 +260,13 @@ process_arguments (int argc, char **argv)
                        username = optarg;
                        break;
                case 'p':                                                                       /* password */
-                       password = optarg;
+                       password = strdup(optarg);
+
+                       /* Delete the password from process list */
+                       while (*optarg != '\0') {
+                               *optarg = 'X';
+                               optarg++;
+                       }
                        break;
                case 'n':                                                                       /* nas id */
                        nasid = optarg;
@@ -315,6 +324,7 @@ print_help (void)
        print_usage ();
 
        printf (_(UT_HELP_VRSN));
+       printf (_(UT_EXTRA_OPTS));
 
        printf (_(UT_HOST_PORT), 'P', myport);
 
@@ -339,11 +349,17 @@ print_help (void)
   printf ("%s\n", _("name and password. A configuration file may also be present. The format of"));
   printf ("%s\n", _("the configuration file is described in the radiusclient library sources."));
        printf ("%s\n", _("The password option presents a substantial security issue because the"));
-  printf ("%s\n", _("password can be determined by careful watching of the command line in"));
-  printf ("%s\n", _("a process listing.  This risk is exacerbated because nagios will"));
-  printf ("%s\n", _("run the plugin at regular predictable intervals.  Please be sure that"));
+  printf ("%s\n", _("password can possibly be determined by careful watching of the command line"));
+  printf ("%s\n", _("in a process listing. This risk is exacerbated because nagios will"));
+  printf ("%s\n", _("run the plugin at regular predictable intervals. Please be sure that"));
   printf ("%s\n", _("the password used does not allow access to sensitive system resources."));
 
+#ifdef NP_EXTRA_OPTS
+  printf ("\n");
+  printf ("%s\n", _("Notes:"));
+  printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
+
        printf (_(UT_SUPPORT));
 }