[pve-devel] [PATCH] spice migration

Alexandre DERUMIER aderumier at odiso.com
Mon Jul 22 08:29:04 CEST 2013


>>Seem you copied that code from somewhere? If so, please can you try 
>>to factor out the common pieces to avoid code duplication? 
>>
>>(something like read_x509_subject_spice($filename)) 

Yes, Indeed, as they are some things to fix, I'll refactor for v2.

I don't don't where is the best place to put it ? PVE::AccesControl ?


----- Mail original ----- 

De: "Dietmar Maurer" <dietmar at proxmox.com> 
À: "Alexandre Derumier" <aderumier at odiso.com>, pve-devel at pve.proxmox.com 
Envoyé: Lundi 22 Juillet 2013 08:03:58 
Objet: RE: [pve-devel] [PATCH] spice migration 

> + if($conf->{vga} eq 'qxl'){ 
> + my $rpcenv = PVE::RPCEnvironment::get(); 
> + my $authuser = $rpcenv->get_user(); 
> + 
> + my ($ticket, $proxyticket) = 
> PVE::AccessControl::assemble_spice_ticket($authuser, $vmid, $self- 
> >{node}); 
> + 
> + # read x509 subject 
> + my $filename = "/etc/pve/nodes/".$self->{node}."/pve-ssl.pem"; 
> + my $bio = Net::SSLeay::BIO_new_file($filename, 'r'); 
> + my $x509 = Net::SSLeay::PEM_read_bio_X509($bio); 
> + Net::SSLeay::BIO_free($bio); 
> + my $nameobj = Net::SSLeay::X509_get_subject_name($x509); 
> + my $subject = Net::SSLeay::X509_NAME_oneline($nameobj); 
> + Net::SSLeay::X509_free($x509); 
> + 
> + # remote-viewer wants comma as seperator (not '/') 
> + $subject =~ s!^/!!; 
> + $subject =~ s!/(\w+=)!,$1!g; 
> + 

Seem you copied that code from somewhere? If so, please can you try 
to factor out the common pieces to avoid code duplication? 

(something like read_x509_subject_spice($filename)) 



More information about the pve-devel mailing list