help-cfengine
[Top][All Lists]
Advanced

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

Re: Relative imports.


From: Mark . Burgess
Subject: Re: Relative imports.
Date: Sat, 6 Sep 2003 07:59:38 +0200 (MEST)

That's right. Either you need to give a full path or define the directory
in which the files should lie. This is the only security-conscious defensible
way of doing things.  Otherwise someone might be able to insert their
own config. Relative file names have no fixed meaning,

M


On  5 Sep, Wheeler, John wrote:
> You should be able (I haven't tested this so I may be full of it) to just 
> define CFINPUTS in the control section:
> 
> CFINPUTS = ( /my/own/path )
> 
> I believe you should also be able to redefine CFINPUTS in subsequent import 
> files. So your value of CFINPUTS could be dependent on where you are in 
> parsing.
> 
> -----Original Message-----
> From: Hans Deragon [mailto:hans@deragon.biz] 
> Sent: Friday, September 05, 2003 8:12 AM
> To: help-cfengine@gnu.org
> Subject: Relative imports.
> 
> Greetings.
> 
> 
> Newbie here.  I have built many little cfengine scripts to modularize 
> fonctionnality.  The scripts are stored in subdirectories and import other
> scripts under other subdirectories.  There is however one thing I do not 
> really 
> like and that is that in the import statements, I have to provide the full 
> path 
> after $CFINPUTS.
> 
>    This is what I would like to be able to do:
> 
> File $CFINPUTS/A.cf:
> 
>    import:
> 
>       linux:: linux/B.cf
> 
> File $CFINPUTS/linux/B.cf:
> 
>    import:
> 
>       redhat:: redhat/C.cf
> 
> File $CFINPUTS/linux/redhat/C.cf:
> 
>    import:
> 
>      redhat_9::  9/D.cf
> 
> You get the picture?  For the moment, I must write file C.cf as:
> 
>    import:
> 
>       redhat_9::  linux/redhat/9/D.cf
> 
> ...but I would like to avoid having to prepend the import statement with 
> ¨linux/redhat¨.  The main reason is that as I work, I might want to 
> reorganise 
> later the directories.  For instance, I might move the scripts from 
> ¨linux/redhat/9¨ to ¨linux/redhat/i386/9¨.  But this would require me to edit 
> all the scripts under the ¨9¨ directory.
> 
> Is there any way to reassign CFINPUTS locally in a script?
> 
> 
> Best regards,
> Hans Deragon



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Work: +47 22453272            Email:  Mark.Burgess@iu.hio.no
Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





reply via email to

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