[PATCH] cli: fix description of --pin argument in --enable-pin help message
Aleksander Morgado
aleksander at lanedo.com
Thu Sep 26 00:44:44 PDT 2013
On 09/26/2013 09:37 AM, Ben Chan wrote:
> The original help message for --enable-pin implies that it expects the
> existing PIN to be specified via the --pin argument, which seems
> confusing as it actually expects the PIN to be set.
> ---
> This is based on the conversation between Dan and me on IRC.
>
What? --enable-pin will enable the PIN lock if the lock was disabled;
but it doesn't change the PIN. --pin needs to be used to pass the
current PIN. Changing the PIN is done with --change-pin=NEW --pin=OLD.
See e.g. this flow (current PIN is 1234):
$ sudo mmcli -i 0 --pin=1234
successfully sent PIN code to the SIM
$ sudo mmcli -i 0 --disable-pin --pin=1234
successfully disabled PIN code request in the SIM
$ sudo mmcli -i 0 --enable-pin --pin=0000
error: couldn't enable PIN code request in the SIM:
'GDBus.Error:org.freedesktop.ModemManager1.Error.MobileEquipment.IncorrectPassword:
Couldn't enable PIN: QMI protocol error (12): 'IncorrectPin''
(incorrect PIN passed with --enable-pin)
$ sudo mmcli -i 0 --enable-pin --pin=1234
successfully enabled PIN code request in the SIM
$ sudo mmcli -i 0 --change-pin=0000 --pin=1234
successfully changed PIN code in the SIM
$ sudo mmcli -i 0 --disable-pin --pin=0000
successfully disabled PIN code request in the SIM
$ sudo mmcli -i 0 --enable-pin --pin=0000
successfully enabled PIN code request in the SIM
$ sudo mmcli -i 0 --change-pin=1234 --pin=0000
successfully changed PIN code in the SIM
> cli/mmcli-sim.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/cli/mmcli-sim.c b/cli/mmcli-sim.c
> index 085f335..6441195 100644
> --- a/cli/mmcli-sim.c
> +++ b/cli/mmcli-sim.c
> @@ -61,7 +61,7 @@ static GOptionEntry entries[] = {
> "[PUK]"
> },
> { "enable-pin", 0, 0, G_OPTION_ARG_NONE, &enable_pin_flag,
> - "Enable PIN request in a given SIM (must send the current PIN with --pin).",
> + "Enable PIN request in a given SIM (must send the new PIN with --pin).",
> NULL
> },
> { "disable-pin", 0, 0, G_OPTION_ARG_NONE, &disable_pin_flag,
>
--
Aleksander
More information about the ModemManager-devel
mailing list