help-cfengine
[Top][All Lists]
Advanced

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

RE: import a whole directory of files?


From: Martin, Jason H
Subject: RE: import a whole directory of files?
Date: Fri, 7 Oct 2005 12:53:14 -0700

I've seen several programs that support include'ing a directory and it
is quite handy. In many cases it is easier to add and remove files
easier then you can edit the contents of a top-level file. 

-Jason Martin

> -----Original Message-----
> From: 
> help-cfengine-bounces+jason.h.martin=cingular.com@gnu.org 
> [mailto:help-cfengine-bounces+jason.h.martin=cingular.com@gnu.
> org] On Behalf Of Russell Adams
> Sent: Thursday, October 06, 2005 6:57 PM
> To: help-cfengine@gnu.org
> Subject: Re: import a whole directory of files?
> 
> 
> I use an m4 macro to do that. Any .cf file that is executable 
> in the specified directory gets imported.
> 
> Since m4 compiles, that means the list is only generated at 
> compile time, not dynamically on each run, reducing the risk 
> of running a new file.
> 
> Russell
> 
> On Fri, Oct 07, 2005 at 11:08:27AM +1000, Matthew Palmer wrote:
> > Is there any way to import a whole directory of files with 
> one import 
> > line, that is, without having to list all of the filenames 
> > individually?  So far, I've tried:
> > 
> > import:
> >     hosts/*
> >     
> > Which produced "cfengine:: Can't open file /tmp/hosts/*"
> > 
> > and also:
> > 
> > import:
> >     hosts
> >     
> > Which produced the rather unpleasant error message "input in flex 
> > scanner failed".
> > 
> > That's my pool of immediate ideas expended.
> > 
> > I'm aware of the possible security implications of arbitrarily 
> > including files which you don't know at config time, but I 
> don't think 
> > it's worse than running files owned by another user (which cfagent 
> > does quite happily).  If you specify a directory which 
> other users can 
> > write to in your cfengine config file, then you pretty much 
> get what 
> > you ask for...
> > 
> > Assuming this functionality doesn't yet exist in cfengine, would a 
> > patch to provide it likely be accepted?  It would kill 
> several birds 
> > with one stone in a system I'm working on at the moment.  
> Which method 
> > would be preferred
> > -- wildcarding, or just specify a directory?  Wildcarding 
> seems like it'd be
> > more explicit, but it's probably a fair bit more coding... <grin>
> > 
> > - Matt
> 
> 
> 
> > _______________________________________________
> > Help-cfengine mailing list
> > Help-cfengine@gnu.org 
> > http://lists.gnu.org/mailman/listinfo/help-cfengine
> 
> ------------------------------------------------------------------
> Russell Adams                            RLAdams@AdamsInfoServ.com
> 
> PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/
> 
> Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3
> 




reply via email to

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