bug-cfengine
[Top][All Lists]
Advanced

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

Copy/purge bug!


From: Bas van der Vlies
Subject: Copy/purge bug!
Date: Fri, 5 Jul 2002 16:19:13 +0200

cfengine 2.0.3

The problem is in copy/purge action. If the destination directory contains
a directory that is not in source directory it will be removed. In this
cfengine version all files/directories inside the offending directory will
be removed, but NOT the top most directory. This error occurs on UNIX
platforms where you are not allowed to delete the current directory, eg:
        mkdir /var/tmp/a
        cd  /var/tmp/a
        rmdir /var/tmp/a 

This is allow on Linux, but not on IRIX, SOLARIS and AIX.

I made a quick patch to solve this problem:
void PurgeFiles()
....

        chdir(".."); /* HvB: Bas van der Vlies */
        if (rmdir(filename) == -1)

....

--
********************************************************************
*                                                                  *
*  Bas van der Vlies                     e-mail: address@hidden      *
*  SARA - Academic Computing Services    phone:  +31 20 592 8012   *
*  Kruislaan 415                         fax:    +31 20 6683167    *
*  1098 SJ Amsterdam                                               *
*                                                                  *
********************************************************************



reply via email to

[Prev in Thread] Current Thread [Next in Thread]