ideas for multiple group macro expansion

Nicolas Williams Nicolas.Williams at wdr.com
Wed Mar 17 20:54:30 GMT 1999


On Thu, Mar 18, 1999 at 07:36:52AM +1100, Andy Bakun wrote:
> Every day samba gets closer to having more complete NT acl and group
> support, and it would be nice to be able to do things on the samba side
> that take greater advantage of multiple groups.  One area I think is
> lacking is the expansion of the group macros %g and %G, which only expand
> to the primary group.  It would be nice to have expansions for all the
> groups.  Here are a few ideas.
> 
[...]
> 
> A new macro, call it %X, that expands and duplicates the current parameter
> for each group that the user is in.
> 
> include = smb.conf.group.%X
> 
> Expands to the following set of includes:
> 
> include = smb.conf.group.frank
> include = smb.conf.group.sysadmin
> include = smb.conf.group.develop
> include = smb.conf.group.rmgmt
> include = smb.conf.group.archive
> include = smb.conf.group.job_num
> 
> Of course, the %X macro would only be valid in the include parameter (that
> is, it wouldn't be included in standard_sub_basic).
> 
> Another method might be to allow the output of a script to be parsed as a
> configuration file.  To borrow perl's syntax:
> 
> include = make_samba_conf %U |
> 
> Where the trailing pipe is a signal that the argument should be executed
> and the input read.  Another parameter, such as 'include output of =' might
> make more sense here.  Either way, the end result is the same.
> 
> I think the first method is more efficient, since an external program
> doesn't need to be invoked at every conf file reread, but the second offers
> greater flexiblity.
> 
> Any comments, questions, or suggestions?  I could put something like this
> to good use, but I'd like to get some input before I really start
> implementing it.

Yes.

We make much use of %$(env var name) syntax in smb.conf.

Here's an idea:

A new parameter called "source environment" that would take a file name
or a pipeline (ending with a '|') whose contents/output would be a set
of variable="value" pairs that would then be set in the environment.

Those environment variables would then be available for use via %$()
syntax after the 'source environment' parameter.

Of course, the various standard % macros could be used in 'source
environment' parameters as well.

Oh, and fix the 'netbios name' parameter to allow %$() syntax. I've done
this for Samba 1.9.18p10, which we use here.  :)

> Andy Bakun
> 

Nico


More information about the samba-technical mailing list