Re: [PATCH v3 01/16] Introduce a virFileDeleteTree method

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

 



On Wed, Apr 10, 2013 at 11:25:10AM -0600, Eric Blake wrote:
> On 04/10/2013 04:08 AM, Daniel P. Berrange wrote:
> > From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
> > 
> > Introduce a method virFileDeleteTree for recursively deleting
> > an entire directory tree
> > 
> > Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
> > ---
> > +
> > +/**
> > + * virFileDeleteTree:
> > + *
> > + * Recursively deletes all files / directories
> > + * starting from the directory @dir. Does not
> > + * follow symlinks
> 
> I would add a comment mentioning that this function is not efficient to
> use on arbitrarily large or deep hierarchies.  But I agree with Michal's
> ACK.

I added:

@@ -652,6 +652,11 @@ int virFileLoopDeviceAssociate(const char *file,
  * Recursively deletes all files / directories
  * starting from the directory @dir. Does not
  * follow symlinks
+ *
+ * NB the algorithm is not efficient, and is subject to
+ * race conditions which can be exploited by malicious
+ * code. It should not be used in any scenarios where
+ * performance is important, or security is critical.
  */



Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
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]