[Kolab-devel] Kolab-CF and Template file handling

Thomas Lotterer thl at dev.de.cw.com
Fri Jan 23 23:12:19 CET 2004


On Thu, Jan 22, 2004, Stephan Buys wrote:

Re,

> - All template files will be stored under KOLABDIR/etc/kolab/templates
> - Each template file will contain a META data section at the top of the file
> Example main.cf.template:
> 
> START_KOLAB_META
> TEMPLATE_DEST = $prefix/etc/kolab/postfix/main.cf
> CHANGED_CMD = $prefix/etc/rc postfix reload
> END_KOLAB_META
> ....rest of main.cf.template follows as usual
> 
Sounds like a valid and easy to implement solution for a demanding
problem.

Take care of the template files' owner/group and permissions. Also
check the parent folders. We don't want anybody to set CHANGED_CMD to
something dangerous. I would suggest that the code that reads the meta
template and executes the CMD should be picky about the file system
permissions and refuse processing files violating obvious rules.

Where does $prefix come from? I would expect to see a @l_prefix@ in
the source package template to be substituted by "shtool subst" during
install and creation of the binary package. So the installed version
would have /kolab hardcoded. If you want to be prepared for post-install
relocation then the variable substitution mechanism should be explained,
so we would be prepared to "escape".

Without going too deep into the topic I see some more meta information
being required. One is a PRIORITY (easy) or DEPENDENCY (scope creep
dangerzone) setting to control template application order. The other is
something like EXECUID/EXECGID to allow processing with non-root rights.

Last but not least, there is a smoldering topic which is worth it's own
thread. So I'll go out and create one.

--
Thomas.Lotterer at cw.com, Cable & Wireless




More information about the devel mailing list