[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Freeipmi-devel] [PATCH 1/2] Check against password length of IPMI 2
From: |
Al Chu |
Subject: |
Re: [Freeipmi-devel] [PATCH 1/2] Check against password length of IPMI 2 intead of 1.5. |
Date: |
Sat, 05 May 2012 07:29:52 -0700 |
Hey Diego,
Good catch. To be consistent to some other code in FreeIPMI, I fixed it
a slightly different way.
Index: ipmiconsole/ipmiconsole-argp.c
===================================================================
--- ipmiconsole/ipmiconsole-argp.c (revision 8805)
+++ ipmiconsole/ipmiconsole-argp.c (working copy)
@@ -237,6 +237,11 @@
init_common_cmd_args_admin (&(cmd_args->common));
+ /* ipmiconsole differences */
+ cmd_args->common.driver_type = IPMI_DEVICE_LAN_2_0;
+ cmd_args->common.session_timeout = 60000;
+ cmd_args->common.retransmission_timeout = 500;
+
cmd_args->escape_char = '&';
cmd_args->dont_steal = 0;
cmd_args->deactivate = 0;
@@ -248,10 +253,6 @@
cmd_args->noraw = 0;
#endif /* NDEBUG */
- /* special case to ipmiconsole, different timeout defaults */
- cmd_args->common.session_timeout = 60000;
- cmd_args->common.retransmission_timeout = 500;
-
argp_parse (&cmdline_config_file_argp,
argc,
argv,
Al
On Fri, 2012-05-04 at 23:33 -0700, Diego Elio Pettenò wrote:
> 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)
> {
--
Albert Chu
address@hidden
Computer Scientist
High Performance Systems Division
Lawrence Livermore National Laboratory