Nicolas Williams' source environment variables
Nicolas.Williams at wdr.com
Wed Feb 2 15:12:38 GMT 2000
On Wed, 2 Feb 2000, Dan Kaminsky wrote:
> Rather than turning smb.conf into YASL(Yet Another Scripting Language),
> perhaps it'd be better to keep it hook based, but with a twist:
Sure. I think Samba could easily be modified to support multiple config
language options, so long the global/share parameter paradigm is kept as
Basically all a scripting language for Samba configuration needs to
provide is methods for defaulting, setting and querying the value of
global and share parameters and methods for creating, deleting and
looking up shares.
Samba config language modules would need to provide a simple entry point
to Samba so that it can be called when including config files of that
langugae. And Samba needs to provide a registration mechanism so that
these modules can inform Samba of their existence (even if this were a
static, compile-time mechanism).
I have visions of an embedded Tcl configuration system...
There's only one serious issue: how to tell Samba the language type of
the config files. One way would be for Samba to check for '#!' as the
first two characters of a config file and use the basename of the path
that follows to index into the list of registered config language
modules (or load it if it exists and isn't loaded yet).
Hmmmm. I should buy an asbestos suit.
Mind you, I'm not advocating this idea (though I'd like it if it were
But I do like this approach better than extending the current config
parser to support more and more programmable features.
> Presently, we include outside files. Why not allow inclusion based upon
> outside executables? We can use environment variables to pass all of
> Samba's variables into the outside process, and with almost every existing
> scripting language able to parse environment variables, we automatically
> become compatible with whatever scripting language the user posseses.
> Include Exec would take two forms:
> 1) include exec = <executable which outputs valid smb.conf parameters>
> 2) parameter = `cat /etc/parameter`
You can do this today with preexec and include.
> #2 allows for cheap one liner perl scripts to do their work.
> Problems? Security's an issue, but I don't see all that much more of a
> threat than we already have...
> Yours Truly,
> Dan Kaminsky
> DoxPara Research
-DISCLAIMER: an automatically appended disclaimer may follow. By posting-
-to a public e-mail mailing list I hereby grant permission to distribute-
-and copy this message.-
This message contains confidential information and is intended only
for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.
E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses. The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission. If
verification is required please request a hard-copy version. This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.
More information about the samba-technical