[PATCH v3 05/15] session: Update sessions on config updates

Chengyi Zhao zhaochengyi189 at gmail.com
Tue Nov 6 01:30:24 PST 2012


Hi All,

         I write about two items in this letter. one is about the error
that the passphrase contains spaces can not be received correctly, a module
is imported to resolve this error. The other is about a new error
discovered during testing simple-agent,luckily, this discovered error is
also kicked.
        simple-agent can not receive passwords that contains  spaces, for
example,  the following command:"./simple-agent Identity = ap, passphrase=
12345678 9 " will get errors, because the space between 8 and 9 is
recognized as the dividing sign of two different arguments. To solve this
problem, the getpass module is imported. The getpass module can receive any
character that gotten through the keyboard. The mainly changes are as below:
            1. import getpass

            2. print "%s Identity=<identity> need-Passphrase=yes
WPS=<wpspin>" % (sys.argv[0])

            3. if arg.startswith("need-Passphrase="):
                    passphrase = getpass.getpass('passphrase:')

            4. if arg.startswith("need-Password="):
                    response["Password"] = getpass.getpass('password:')

            5.  elif arg.startswith("need-Passphrase="):
                object.passphrase = getpass.getpass('passphrase:')

            6.  elif arg.startswith("need-Password="):
                object.password = getpass.getpass('password:')

so far,this problem is kicked, however, another error occurs. when running
the command "./simple-agent Identity=ap", the wifi cannot be connected
successfully. when running the command "./test-connman connect ******" to
connect wifi, repeated and continuous error information :
       RequestInput (/net/connman/service
/wifi_00dbdf140abe_6170_managed_psk,dbus.Dictionary({dbus.String(u'Passphrase'):
dbus.Dictionary({dbus.String(u'Requirement'): dbus.String(u'mandatory',
variant_level=1), dbus.String(u'Type'): dbus.String(u'psk',
variant_level=1)}, signature=dbus.Signature('sv'), variant_level=1)},
signature=dbus.Signature('sv')))
^CTraceback (most recent call last)
 occur in the terminal where the simple-agent script runs. That is to say
,at the beginning if only the argument of "Identity" is offered to
simple-agent without offering the passphrase argument( the command is
"./simple-agent Identity=ap") ,the program cannot run smoothly. This error
not only exists in the modified simple-agent script but also exists in the
original simple-agent script.  As for this problem, some codes are added to
the input_passphrase() function of simple-agent :
                                             if not self.passphrase:
                                       print "passphrase is needed."
                                       response["Passphrase"] =
getpass.getpass("passphrase:")


                                             if not self.identity:
                                       print "identity is needed,the format
is Identity=<identity>"
                                       response["Identity"] =
raw_input("answer:")
           Then, the script simple-agent can run smoothly,when run the
command "./simple-agent", the script can also receive the right passphrase.
when run the command "./simple-agent  Identity=ap", it will prompt you to
enter passphrase,no errors occur and the wifi can be connected.The changes
that have been made are all introduced as above.
           The modified script of simple-agent is attached.

Best Regards,
Chengyi Zhao



> ______________________________**_________________
> connman mailing list
> connman at connman.net
> http://lists.connman.net/**listinfo/connman<http://lists.connman.net/listinfo/connman>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: simple-agent-modified
Type: application/octet-stream
Size: 6281 bytes
Desc: not available
URL: <http://lists.01.org/pipermail/connman/attachments/20121106/71cf65ec/attachment.obj>


More information about the connman mailing list