Code

Allow rsyncing to local paths
[nagiosplug.git] / plugins / check_radius.c
index 7ce820a875301d6fb6e1d9060340f435d705e92e..57b7090d77d2ec7cd5e71b38c5725d0e069c5a37 100644 (file)
@@ -5,8 +5,6 @@
 * License: GPL
 * Copyright (c) 1999-2008 Nagios Plugins Development Team
 * 
-* Last Modified: $Date$
-* 
 * Description:
 * 
 * This file contains the check_radius plugin
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
-* $Id$
 * 
 *****************************************************************************/
 
 const char *progname = "check_radius";
-const char *revision = "$Revision$";
 const char *copyright = "2000-2008";
 const char *email = "nagiosplug-devel@lists.sourceforge.net";
 
@@ -169,8 +165,8 @@ main (int argc, char **argv)
                                (nasid==NULL || my_rc_avpair_add (&data.send_pairs, PW_NAS_IDENTIFIER, nasid, 0))))
                die (STATE_UNKNOWN, _("Out of Memory?"));
 
-       /* 
-        * Fill in NAS-IP-Address 
+       /*
+        * Fill in NAS-IP-Address
         */
 
        if ((client_id = my_rc_own_ipaddress ()) == 0)
@@ -239,7 +235,7 @@ process_arguments (int argc, char **argv)
                        print_help ();
                        exit (OK);
                case 'V':                                                                       /* version */
-                       print_revision (progname, revision);
+                       print_revision (progname, NP_VERSION);
                        exit (OK);
                case 'v':                                                                       /* verbose mode */
                        verbose = TRUE;
@@ -260,7 +256,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;
@@ -306,12 +308,12 @@ print_help (void)
        char *myport;
        asprintf (&myport, "%d", PW_AUTH_UDP_PORT);
 
-       print_revision (progname, revision);
+       print_revision (progname, NP_VERSION);
 
        printf ("Copyright (c) 1999 Robert August Vincent II\n");
        printf (COPYRIGHT, copyright, email);
 
-       printf("%s\n", _("Tests to see if a radius server is accepting connections."));
+       printf("%s\n", _("Tests to see if a RADIUS server is accepting connections."));
 
   printf ("\n\n");
 
@@ -338,14 +340,14 @@ print_help (void)
        printf (_(UT_TIMEOUT), timeout_interval);
 
   printf ("\n");
-  printf ("%s\n", _("This plugin tests a radius server to see if it is accepting connections."));
+  printf ("%s\n", _("This plugin tests a RADIUS server to see if it is accepting connections."));
   printf ("%s\n", _("The server to test must be specified in the invocation, as well as a user"));
   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