bug-cfengine
[Top][All Lists]
Advanced

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

Re: [CFENGINE] tidy circular links?


From: Bas van der Vlies
Subject: Re: [CFENGINE] tidy circular links?
Date: Mon, 11 Nov 2002 08:45:51 +0100

Andreas,

 I had the same problem with cfengine 2.0.4 that links did not get 
 deleted. I have patched tidy.c so links will be deleted:

    if (S_ISLNK(statbuf.st_mode) && (statbuf.st_mode != getuid()))
         {
         snprintf(OUTPUT,bufsize,"File %s is an untrusted link. cfagent
will not follow it with a destructive operation (tidy)",pcwd);
         continue;
         }
      }


 This is a bug, must be:
      if (S_ISLNK(statbuf.st_mode) && (statbuf.st_uid != getuid()))

If you run as root then only links for root are deleted. I removed this
check completely and now all links get deleted. It did not break anything
as far as i have experienced.

> Hi:
> 
> I was trying to tidy my labs' /tmp directory and came up with the
> following type error: 
> 
>  cfengine:calvin: Non-empty directory /tmp/Directory, skipping..
> 
> It turns out the directory contained a circular symbolic link, for
> example: 
> 
>  /tmp/Directory:
>  total 0
>  lrwxrwxrwx    1 root     wheel          12 Nov  8 17:42 CircularLink ->
> CircularLink
> 
> I just want to remove the /tmp/Directory and its entire contents.
> 
> Below is an example cfengine script which demonstrates the above
> problem:
> 
> Thanks for any help,
> 
> -Andreas Boschke
> -andreas @ cs.ucsb.edu
> 
> =
> <<<script>>>
> ##############################################
> # 
> #  cfagent.conf
> #
> #  Demonstrates problem with 'tidying' circular links' 
> #
> ##############################################
> 
> control:
> 
>       actionsequence = ( tidy )
> 
> tidy:
> 
>       /tmp    pat=*       recurse=inf   age=0 rmdirs=true dirlinks=delete
> links=tidy
> 
> # END cfagent.conf
> #
> ###
> 
> <<<output snippets>>>
> % ./cfagent -qKvf cfagent.conf 
> 
> GNU Configuration Engine - 
> 2.0.5pre
> Free Software Foundation 1994-2001
> Donated by Mark Burgess, Faculty of Engineering,
> Oslo University College, 0254 Oslo, Norway
> 
> ------------------------------------------------------------------------
> 
> Host name is: calvin
> Operating System Type is linux
> Operating System Release is 2.4.18-10smp
> Architecture = i686
> 
> ---------------------------------------------------------------------
> Tidying by directory
> ---------------------------------------------------------------------
> 
> Directory /tmpj
> cfengine:calvin: Non-empty directory /tmp/Directory, skipping..
> cfengine:calvin: Non-empty directory /tmp, skipping..
> No home patterns to search
> 
> =
> 
> 
> 
> _______________________________________________
> Bug-cfengine mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-cfengine
> _______________________________________________
> Cfengine mailing list
> address@hidden
> http://mailgate.sara.nl/mailman/listinfo/cfengine


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