FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora/Linux Management Tools

 
 
LinkBack Thread Tools
 
Old 11-25-2008, 02:08 PM
Andreas Schneider
 
Default Fix lookup pool by path

Hi,

attached is a patch for virtinst to fix the lookup_pool_by_path() function. It
removes the trailing slash to have a normalized path.


Cheers,


-- andreas

--
Andreas Schneider, SUSE Labs, http://www.suse.de/
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg)
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 11-28-2008, 12:47 PM
Andreas Schneider
 
Default Fix lookup pool by path

On Tuesday 25 November 2008 16:08:25 Andreas Schneider wrote:
> Hi,
>
> attached is a patch for virtinst to fix the lookup_pool_by_path() function.
> It removes the trailing slash to have a normalized path.
>

I've updated the patch. It works now


Best regards,


-- andreas

--
Andreas Schneider, SUSE Labs, http://www.suse.de/
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg)
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 12-01-2008, 02:07 PM
Cole Robinson
 
Default Fix lookup pool by path

Andreas Schneider wrote:
> On Tuesday 25 November 2008 16:08:25 Andreas Schneider wrote:
>> Hi,
>>
>> attached is a patch for virtinst to fix the lookup_pool_by_path() function.
>> It removes the trailing slash to have a normalized path.
>>
>
> I've updated the patch. It works now
>
>

Hmm, so your pool xml lists the target directory with a trailing slash?
I'm not seeing that. What version of libvirt are you using, and can you
provide the pools xml?

Thanks,
Cole

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 12-02-2008, 09:48 AM
Andreas Schneider
 
Default Fix lookup pool by path

On Monday 01 December 2008 16:07:45 Cole Robinson wrote:
> Hmm, so your pool xml lists the target directory with a trailing slash?
> I'm not seeing that. What version of libvirt are you using, and can you
> provide the pools xml?

Hi,

I'm using virt-manager to connect to a remote host, so if I create a pool I
have to specify the path to the pool manually.

This means you can enter as many trailing slashes as you want. So the
questions is, should the slashes be stripped during the creation of the pool
too?

<pool type='dir'>
<name>tmp</name>
<uuid>17e0c17a-3cd3-bc20-f1bc-7c9ffaceb255</uuid>
<capacity>0</capacity>
<allocation>0</allocation>
<available>0</available>
<source>
</source>
<target>
<path>/var/lib/libvirt/images/tmp/////</path>
<permissions>
<mode>0700</mode>
<owner>0</owner>
<group>0</group>
</permissions>
</target>
</pool>

>
> Thanks,
> Cole


Best regards,


-- andreas

--
Andreas Schneider, SUSE Labs, http://www.suse.de/
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg)
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 12-03-2008, 03:21 PM
Cole Robinson
 
Default Fix lookup pool by path

Andreas Schneider wrote:
> On Monday 01 December 2008 16:07:45 Cole Robinson wrote:
>> Hmm, so your pool xml lists the target directory with a trailing slash?
>> I'm not seeing that. What version of libvirt are you using, and can you
>> provide the pools xml?
>
> Hi,
>
> I'm using virt-manager to connect to a remote host, so if I create a pool I
> have to specify the path to the pool manually.
>
> This means you can enter as many trailing slashes as you want. So the
> questions is, should the slashes be stripped during the creation of the pool
> too?
>
> <pool type='dir'>
> <name>tmp</name>
> <uuid>17e0c17a-3cd3-bc20-f1bc-7c9ffaceb255</uuid>
> <capacity>0</capacity>
> <allocation>0</allocation>
> <available>0</available>
> <source>
> </source>
> <target>
> <path>/var/lib/libvirt/images/tmp/////</path>
> <permissions>
> <mode>0700</mode>
> <owner>0</owner>
> <group>0</group>
> </permissions>
> </target>
> </pool>
>

Hmm, yes, seems like libvirt should be sanitizing the target path when
the pool is defined (though virtinst could certainly do this too).

Looks like there could be arbitrary '/' in the middle of the path
though, so if you use something like os.path.abspath in your patch it
should sanitize everything appropriately.

Thank,
Cole

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 12-04-2008, 11:24 AM
Andreas Schneider
 
Default Fix lookup pool by path

On Wednesday 03 December 2008 17:21:47 Cole Robinson wrote:
> Andreas Schneider wrote:
> > On Monday 01 December 2008 16:07:45 Cole Robinson wrote:
> >> Hmm, so your pool xml lists the target directory with a trailing slash?
> >> I'm not seeing that. What version of libvirt are you using, and can you
> >> provide the pools xml?
> >
> > Hi,
> >
> > I'm using virt-manager to connect to a remote host, so if I create a pool
> > I have to specify the path to the pool manually.
> >
> > This means you can enter as many trailing slashes as you want. So the
> > questions is, should the slashes be stripped during the creation of the
> > pool too?
> >
> > <pool type='dir'>
> > <name>tmp</name>
> > <uuid>17e0c17a-3cd3-bc20-f1bc-7c9ffaceb255</uuid>
> > <capacity>0</capacity>
> > <allocation>0</allocation>
> > <available>0</available>
> > <source>
> > </source>
> > <target>
> > <path>/var/lib/libvirt/images/tmp/////</path>
> > <permissions>
> > <mode>0700</mode>
> > <owner>0</owner>
> > <group>0</group>
> > </permissions>
> > </target>
> > </pool>
>
> Hmm, yes, seems like libvirt should be sanitizing the target path when
> the pool is defined (though virtinst could certainly do this too).
>
> Looks like there could be arbitrary '/' in the middle of the path
> though, so if you use something like os.path.abspath in your patch it
> should sanitize everything appropriately.

Thanks, this was the function I was looking for. I've attached an updated
patch. I think it should be fixed in libvirt and virt-manager. Just to be sure
that you can't run into the problem again.

>
> Thank,
> Cole

Cheers,


-- andreas

--
Andreas Schneider, SUSE Labs, http://www.suse.de/
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg)
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 12-07-2008, 03:19 AM
Cole Robinson
 
Default Fix lookup pool by path

Andreas Schneider wrote:
> On Wednesday 03 December 2008 17:21:47 Cole Robinson wrote:
>
>>
>> Hmm, yes, seems like libvirt should be sanitizing the target path when
>> the pool is defined (though virtinst could certainly do this too).
>>
>> Looks like there could be arbitrary '/' in the middle of the path
>> though, so if you use something like os.path.abspath in your patch it
>> should sanitize everything appropriately.
>>
>
> Thanks, this was the function I was looking for. I've attached an updated
> patch. I think it should be fixed in libvirt and virt-manager. Just to be sure
> that you can't run into the problem again.
>

Agreed on the above point. I've committed your fix now:

http://hg.et.redhat.com/virt/applications/virtinst--devel?cs=b66d39a23988

Thanks for the contribution!

- Cole

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 

Thread Tools




All times are GMT. The time now is 07:10 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org