Nicolas Williams' source environment variables

Nicolas Williams Nicolas.Williams at
Wed Feb 2 15:34:46 GMT 2000

On Wed, Feb 02, 2000 at 07:25:34AM -0800, Dan Kaminsky wrote:
> > Sure. I think Samba could easily be modified to support multiple config
> > language options, so long the global/share parameter paradigm is kept as
> > it is.
> This is a good point--we should have ways of making explicit that an
> include either should or should not be able to escape the containing [*]
> construct...
> Incidentally, I absolutely love having a global config that I use as a
> skeleton for shares that lie within.

You do this too?

We have a global config file that sets a handful of globals (many, such
as 'netbios name', 'interfaces' and such from environment variables).

For standard home directories we have a standard sub-config file that
defines the home share stuff.

For all shares we have template sub-config files to setup various
different kinds of shares (private, group shared private, group shared

This approach is waht lead me to make that 'source environment' patch.

> > 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).
> Um, we don't need to be this complicated.  We just tell the OS to execute
> something.  If it's a compatible binary, it works.  If it's a #! style
> script, it works.  No need to bind the language to the platform.

Right. Doh. Well, we could change the include parameter to include from
a pipe if the value of the include parameter ends with a '|' character
(just like 'source environment' does).

BTW, 'source environment' is a global parameter and does not remember
files/pipes sourced whereas include does. I thought that feature could
be added later.

> > Hmmmm. I should buy an asbestos suit.
> Why?  I'm not advocating anything particularly shocking.

No, but I thought I was. :)

> > You can do this today with preexec and include.
> Preexec runs a command before a share is mounted...include will then
> operate upon the contents of a preexec modified, this is kinda
> workable, but A) Doesn't work for globals, B) Seems vulnerable to a race
> condition somewhere, and C) Qualifies as a gross'n'disgusting hack(not
> that there's anything *wrong* with that.


> Nice trick to know about, I must say.
> 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 mailing list