Thanks Lars,<div><br><div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>Groups in conjunction with multiple config files made our job easy...</div><div><br></div><div>so, this is how we run :</div><div>
<br></div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><font size="4">csync2 -C module-A -G group-one -x</font></blockquote>
<div><br></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>Having said that it would still be beneficial to let users specify config files in sub directories of 'sysconfdir'; of course after taking enough precautions [like preventing file names starting with '/', preventing '..' character, rejecting environment variable, etc] to prevent execution of arbitrary commands. Relaxing the name of the config file to have '_' (underscore) may also help a bit [ most of the database systems allow defining a database or schema or a table with '_' ]</div>
<div><br></div><div>Anyway, I do not need these additional enhancements anymore since my use cases are met by the combination of -C and -G switches.</div><div><br></div><div>But if folks think that providing these options would be beneficial, then i may try submitting the patch over the weekend.</div>
<div><br></div></blockquote>Regards,<br>Samba</div><div><br></div><div>--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br>
<div class="gmail_quote">On Mon, Mar 19, 2012 at 9:47 PM, Lars Ellenberg <span dir="ltr"><<a href="mailto:lars.ellenberg@linbit.com">lars.ellenberg@linbit.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Mon, Mar 19, 2012 at 05:05:28PM +0530, Samba wrote:<br>
> Hi,<br>
><br>
> I would like to utilize modular configuration files which csync2 supports;<br>
> but have a curiosity to know why those additional configuration file names<br>
> are restricted to just alphanumeric characters ([a-z0-9]). This restriction<br>
> also prevents one from grouping those modular config files into subfolders,<br>
> like say, "essential", "optional", "large", etc which would have helped<br>
> schedule different intervals for different sets of configuration files.<br>
><br>
> If there is no technical reason to restrict csync2 config file name to just<br>
> alphanumeric characters, then would it be a good idea to patch to allow the<br>
> above mentioned usecases? i.e allow other characters like '_', '-', etc and<br>
> also allow config files to be put under subdirectories of 'sysconf' dir or<br>
> probably even allow specifying absolute path names...<br>
<br>
</div></div>Different "-C cfgname" will also use different databases,<br>
with the cfgname encoded in the database name.<br>
And those may have their own limitation.<br>
<br>
Also the to-be-used config file name is communicated over the connection,<br>
and you don't want some unpriviledged user to be able to trick your<br>
csync2 daemon to use some arbitrary crafted config file.<br>
<br>
There may be other reasons as well.<br>
<br>
So if you plan to relax that constraint, keep in mind that you may cause<br>
incompatibilities with current and future database backends, and<br>
probably need a few additional sanity checks before you allow a csync2<br>
daemon to even start looking at those config files.<br>
<br>
Are you aware of csync2 *groups*?<br>
<br>
You can have many different named groups in the same config file,<br>
and if you give them on the command line (-G groupname1,group2,group3)<br>
only those listed will be processed.<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
Lars<br>
<br>
--<br>
: Lars Ellenberg<br>
: LINBIT | Your Way to High Availability<br>
: DRBD/HA support and consulting <a href="http://www.linbit.com" target="_blank">http://www.linbit.com</a><br>
<br>
DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.<br>
_______________________________________________<br>
Csync2 mailing list<br>
<a href="mailto:Csync2@lists.linbit.com">Csync2@lists.linbit.com</a><br>
<a href="http://lists.linbit.com/mailman/listinfo/csync2" target="_blank">http://lists.linbit.com/mailman/listinfo/csync2</a><br>
</font></span></blockquote></div><br></div></div>