Re: [PATCH] add support for libssh2 password from auth file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/28/2013 01:41 PM, David Maciejak wrote:
>
>
>
> On Fri, Jun 28, 2013 at 1:03 PM, Michal Novotny <minovotn@xxxxxxxxxx
> <mailto:minovotn@xxxxxxxxxx>> wrote:
>
>
>     On 06/28/2013 12:28 PM, Peter Krempa wrote:
>     > On 06/27/13 14:31, David Maciejak wrote:
>     >> Hi,
>     >>
>     >> I was discussing with Daniel about the best way to pass the ssh
>     password
>     >> when using such kind of uri:
>     >> 'xen+libssh2://root@192.168.0.10?sshauth=password
>     <http://root@192.168.0.10?sshauth=password>
>     >> <http://root@192.168.0.10?sshauth=password>'
>     >>
>     >> As it seems passing the password in the uri is not a good
>     option, maybe we
>     >> can grab it from auth conf ? it seems it's not the case as now
>     (tell me
>     >> if i am wrong).
>     > I was planing on doing this stuff, but never managed to finish this.
>     >
>     >> So enclosed a patch to add this feature.
>     >>
>     >> As you can see in virnetclient.c there is no virAuthGetPassword
>     call, so
>     >> the authfile is never used.
>     >>
>     >> The patch enclosed is modifying the function prototype to add
>     >> virConnectPtr parameter (so remote_driver.c
>     virNetClientNewLibSSH2 call
>     >> has to be updated too and the corresponding .h too).
>     >>
>     >> Once we have access to virConnectPtr, as you will see in the
>     patch we
>     >> can check if authMethods is set to 'password' and grab the
>     password from
>     >> auth file by calling virAuthGetPassword.
>     >>
>     >>
>     > please use git format-patch and send-email in the future, it makes
>     > reviewing easier.
>     >
>     > See the attached patch for the review.
>     >
>     > Peter
>     >
>     >
>     >
>     > --
>     > libvir-list mailing list
>     > libvir-list@xxxxxxxxxx <mailto:libvir-list@xxxxxxxxxx>
>     > https://www.redhat.com/mailman/listinfo/libvir-list
>
>     Hi all,
>     Peter, you could have reformatted it for better replies on
>     separate code
>     hunks ;-) Like I did now ;-)
>
>
> Thanks for the review guys.
> ...
>
>
>     I suggest tokenizing it after commas, like I'm doing for my
>     personal projects
>
>
>
> I agree with Michal,  using strstr instead of strcmp has also some
> drawbacks.

Hi David,
if libvirt doesn't have the tokenizer support yet, it may be a good RFE
as I believe it could be really useful ;-)

Peter, do you know about anything libvirt supports to tokenize string?

Thanks,
Michal
>
>
> regards,
> david

-- 
Michal Novotny <minovotn@xxxxxxxxxx>, RHCE, Red Hat
Virtualization | libvirt-php bindings | php-virt-control.org

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]