cfengine-develop
[Top][All Lists]
Advanced

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

[Cfengine-develop] Patch for do.c


From: Luke A. Kanies
Subject: [Cfengine-develop] Patch for do.c
Date: Mon, 2 Feb 2004 14:16:16 -0600 (CST)

Hi Mark,

Here is a patch for do.c to allow wildcards to match both files and
directories in the 'files' action:

3269c3269
<       if (S_ISDIR(statbuf.st_mode) && WildMatch(extract,dp->d_name))
---
>       if ((S_ISREG(statbuf.st_mode) || S_ISDIR(statbuf.st_mode)) &&
WildMatch(extract,dp->d_name))
3273a3274
>

A very short patch, and very simple.

This causes the following action to behave as one would expect:

files:
        /home/luke/* m=750 action=warnall

Previously this only matched directories; this patch causes it to match
files, also.  Should it match more than files?  Could we just skip the
test and do the action on all types of files?  Maybe just skip certain
files, like links?

I don't know; I'll leave that up to you.  My main concern is that it
matches files.

Here, also, is a small patch to the documentation:

5691a5692,5697
>
> File objects can also contain wildcards using @file{?} and @file{*}.
The
> wildcard @file{*} matches zero or more characters, and @file{?} matches
zero
> or one character.  For instance, @file{/var/log/*.log.?} matches all
rotated
> logs that have a single character extension.
>

Luke

-- 
Of the thirty-six ways of avoiding disaster, running away is best.
                                             -- Chinese Proverb




reply via email to

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