[virt-tools-list] [PATCH virt-viewer v3] Do not print password in the debug log
Pavel Grunt
pgrunt at redhat.com
Tue Feb 7 16:38:55 UTC 2017
On Tue, 2017-02-07 at 17:23 +0100, Christophe Fergeau wrote:
> Acked-by: Christophe Fergeau <cfergeau at redhat.com>
>
Thanks, pushed
https://pagure.io/virt-viewer/c/b7f8644429e034523ec91ab18c53b82f7cceb5
53
Pavel
> On Tue, Jan 17, 2017 at 06:42:51PM +0100, Pavel Grunt wrote:
> > Do not show a length since it is sensitive info as well.
> >
> > Resolves: rhbz#1410030
> > ---
> > src/virt-viewer.c | 11 ++++++++++-
> > 1 file changed, 10 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/virt-viewer.c b/src/virt-viewer.c
> > index 1121146..1f99552 100644
> > --- a/src/virt-viewer.c
> > +++ b/src/virt-viewer.c
> > @@ -928,6 +928,11 @@
> > virt_viewer_auth_libvirt_credentials(virConnectCredentialPtr cred,
> > }
> >
> > for (i = 0 ; i < ncred ; i++) {
> > + const char *cred_type_to_str[] = {
> > + [VIR_CRED_USERNAME] = "Identity to act as",
> > + [VIR_CRED_AUTHNAME] = "Identify to authorize as",
> > + [VIR_CRED_PASSPHRASE] = "Passphrase secret",
> > + };
> > switch (cred[i].type) {
> > case VIR_CRED_AUTHNAME:
> > case VIR_CRED_USERNAME:
> > @@ -936,7 +941,11 @@
> > virt_viewer_auth_libvirt_credentials(virConnectCredentialPtr cred,
> > cred[i].resultlen = strlen(cred[i].result);
> > else
> > cred[i].resultlen = 0;
> > - g_debug("Got '%s' %d %d", cred[i].result,
> > cred[i].resultlen, cred[i].type);
> > + g_debug("Got %s '%s' %d",
> > + cred_type_to_str[cred[i].type],
> > + /* hide password */
> > + (cred[i].type == VIR_CRED_PASSPHRASE) ?
> > "*****" : cred[i].result,
> > + cred[i].type);
> > break;
> > }
> > }
> > --
> > 2.11.0
> >
> > _______________________________________________
> > virt-tools-list mailing list
> > virt-tools-list at redhat.com
> > https://www.redhat.com/mailman/listinfo/virt-tools-list
More information about the virt-tools-list
mailing list