GNOME Bugzilla – Bug 737415
nmcli: allow showing secrets
Last modified: 2014-11-19 10:51:14 UTC
nmcli should be able to show secrets of connection profiles.
The code is in branch jk/cli-show-secrets.
Maybe make macro for returning the secret or <hidden>? Perhaps something like: #define GET_SECRET (show, setting, func) \ show ? func (setting) : g_strdup (_("<hidden>")) so that there's one place that the logic is done?
(In reply to comment #2) > Maybe make macro for returning the secret or <hidden>? Perhaps something like: > > #define GET_SECRET (show, setting, func) \ > show ? func (setting) : g_strdup (_("<hidden>")) > > so that there's one place that the logic is done? Good idea. Done.
Fixup looks good to me.
Added bash-completion as a fixup! commit. For some reason, edit mode does not show the secrets for me. Does it work for you?
(In reply to comment #5) > Added bash-completion as a fixup! commit. > Thanks. > > For some reason, edit mode does not show the secrets for me. Does it work for > you? Yes, it does work for me. The secrets are hidden by default. Maybe you didn't switch it on. nmcli> nmcli show-secrets yes Commits in master: 85fcfd1 merge: show connection secrets in nmcli when required (bgo #737415) 45590f8 cli: allow showing secrets in the editor b4e013a cli: display '<hidden>' string for secret properties 2a40acc cli/bash-completion: update bash completion for '--show-secrets' option 1a64683 cli: add '--show-secrets' option for 'nmcli connection show'
For me it still doesn't work. the following works as expected: nmcli connection show ID nmcli connection show -s ID in edit mode, the `nmcli show-secrets no` mode also works as expected. But for `nmcli show-secrets yes` the password is not shown to me. Maybe it is, because my password is saved systemwide? "psk-flags = 0" Reopening bug.
(In reply to comment #7) > For me it still doesn't work. > > in edit mode, the `nmcli show-secrets no` mode also works as expected. > But for `nmcli show-secrets yes` the password is not shown to me. > A fix is available in jk/nmcli-editor-secrets-fix.
(In reply to comment #8) > (In reply to comment #7) > > For me it still doesn't work. > > > > in edit mode, the `nmcli show-secrets no` mode also works as expected. > > But for `nmcli show-secrets yes` the password is not shown to me. > > > > A fix is available in jk/nmcli-editor-secrets-fix. LGTM, and it fixes the issue for me.
LGTM
Pushed to master: 6fd8afd cli: fix showing secrets in nmcli editor (bgo #737415)