macOS: fix random password loaded in the GUI

macOS puts a -psn_0_xxxxxx argument when running an app via GUI.
This argument was interpreted as a password (-p) and overloaded the
value stored in the settings. Catching the -psn argument explicitely
should prevent this.

See https://stackoverflow.com/questions/10242115/os-x-strange-psn-command-line-parameter-when-launched-from-finder
for further information about this legacy argument.
This commit is contained in:
Alberto Sottile 2019-05-11 00:25:49 +02:00
parent a2294d0916
commit b3545a35bb

View File

@ -490,6 +490,7 @@ class ConfigurationGetter(object):
self._argparser.add_argument('-r', '--room', metavar='room', type=str, nargs='?', help=getMessage("room-argument"))
self._argparser.add_argument('-p', '--password', metavar='password', type=str, nargs='?', help=getMessage("password-argument"))
self._argparser.add_argument('--player-path', metavar='path', type=str, help=getMessage("player-path-argument"))
self._argparser.add_argument('-psn', metavar='blackhole', type=str, help=argparse.SUPPRESS)
self._argparser.add_argument('--language', metavar='language', type=str, help=getMessage("language-argument"))
self._argparser.add_argument('file', metavar='file', type=str, nargs='?', help=getMessage("file-argument"))
self._argparser.add_argument('--clear-gui-data', action='store_true', help=getMessage("clear-gui-data-argument"))