freeipmi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Freeipmi-devel] [PATCH 1/2] Check against password length of IPMI 2 int


From: Diego Elio Pettenò
Subject: [Freeipmi-devel] [PATCH 1/2] Check against password length of IPMI 2 intead of 1.5.
Date: Fri, 4 May 2012 23:33:24 -0700

For some commands, such as ipmi-console, there is no way to define the
driver to use, and if this is not used, longer passwords are refused.

When parsing command lines, passwords are always checked against IPMI
2 and not 1.5, so keep this consistent.

Signed-off-by: Diego Elio Pettenò <address@hidden>
---
 common/toolcommon/tool-cmdline-common.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/common/toolcommon/tool-cmdline-common.c 
b/common/toolcommon/tool-cmdline-common.c
index 5a796c2..0827b16 100644
--- a/common/toolcommon/tool-cmdline-common.c
+++ b/common/toolcommon/tool-cmdline-common.c
@@ -544,18 +544,16 @@ verify_common_cmd_args_outofband (struct common_cmd_args 
*cmd_args, int check_ho
       exit (1);
     }
 
-  /* We default to IPMI 1.5 if the user doesn't specify LAN vs. LAN_2_0 */
-
   if (((cmd_args->hostname
         && cmd_args->driver_type == IPMI_DEVICE_UNKNOWN)
-       || cmd_args->driver_type == IPMI_DEVICE_LAN)
+       || cmd_args->driver_type == IPMI_DEVICE_LAN
+       || cmd_args->driver_type == IPMI_DEVICE_LAN_2_0)
       && cmd_args->password
-      && strlen (cmd_args->password) > IPMI_1_5_MAX_PASSWORD_LENGTH)
+      && strlen (cmd_args->password) > IPMI_2_0_MAX_PASSWORD_LENGTH)
     {
       fprintf (stderr, "password too long\n");
       exit (1);
     }
-  /* else, 2_0 password length was checked in argp_parse() previously */
 
   if (cmd_args->retransmission_timeout > cmd_args->session_timeout)
     {
-- 
1.7.8.6




reply via email to

[Prev in Thread] Current Thread [Next in Thread]