[PATCH] cli: fix description of --pin argument in --enable-pin help message
Dan Williams
dcbw at redhat.com
Thu Sep 26 09:35:21 PDT 2013
On Thu, 2013-09-26 at 09:44 +0200, Aleksander Morgado wrote:
> 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.
So Ben's patch was suggested by me, because I couldn't find out how to
set a PIN for my SIM which currently didn't have one enabled. To make
things worse, I have no idea what the "default" PIN code is, so even
trying to enable the PIN I don't have any clue what to send for some
cards. Apparently it's 0000 or 1111 (AT&T) or 12345, and apparently
it's sometimes in the manuals that come with the phone. What a mess.
So chalk this up to my ignorance on how to enable PIN codes. Maybe we
could expand the help slightly to indicate that the SIM *always* has a
PIN set, even if it's not enabled.
Dan
> 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,
> >
>
>
More information about the ModemManager-devel
mailing list