After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 737415 - nmcli: allow showing secrets
nmcli: allow showing secrets
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: nmcli
git master
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-09-26 09:47 UTC by Jiri Klimes
Modified: 2014-11-19 10:51 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jiri Klimes 2014-09-26 09:47:32 UTC
nmcli should be able to show secrets of connection profiles.
Comment 1 Jiri Klimes 2014-09-29 12:08:55 UTC
The code is in branch jk/cli-show-secrets.
Comment 2 Dan Williams 2014-10-01 16:55:15 UTC
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?
Comment 3 Jiri Klimes 2014-10-02 09:59:52 UTC
(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.
Comment 4 Dan Williams 2014-10-02 20:30:06 UTC
Fixup looks good to me.
Comment 5 Thomas Haller 2014-10-29 19:49:40 UTC
Added bash-completion as a fixup! commit.


For some reason, edit mode does not show the secrets for me. Does it work for you?
Comment 6 Jiri Klimes 2014-10-30 08:40:39 UTC
(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'
Comment 7 Thomas Haller 2014-10-30 09:54:08 UTC
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.
Comment 8 Jiri Klimes 2014-11-18 15:20:02 UTC
(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.
Comment 9 Thomas Haller 2014-11-18 20:53:00 UTC
(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.
Comment 10 Dan Williams 2014-11-19 00:06:12 UTC
LGTM
Comment 11 Jiri Klimes 2014-11-19 10:51:14 UTC
Pushed to master:
6fd8afd cli: fix showing secrets in nmcli editor (bgo #737415)