diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-10-18 08:41:46 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-10-18 13:13:30 +1100 |
commit | 734e5c521cb06a91e708226e0eb6d003175958c2 (patch) | |
tree | ed4441c4f533511d3af524d3ff80e39e64075b17 /lib/param/loadparm.c | |
parent | f8c6219188fa4ce39a35a8f192c649a6aa9c7ec1 (diff) | |
download | samba-734e5c521cb06a91e708226e0eb6d003175958c2.tar.gz samba-734e5c521cb06a91e708226e0eb6d003175958c2.tar.bz2 samba-734e5c521cb06a91e708226e0eb6d003175958c2.zip |
credentials: Prioritise command-line specified options above defaults from smb.conf
If a user specified -W or --realm on the command line, then this is
of level SPECIFIED, not UNINITIALISED, despite it going via the
loadparm system.
This helps us to ensure that -W server -Ulocaluser is parsed the
same as -Userver\localuser. This matters as otherwise we might
instead attempt to use kerberos to the realm from the smb.conf.
Andrew Bartlett
Diffstat (limited to 'lib/param/loadparm.c')
-rw-r--r-- | lib/param/loadparm.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c index c130a198df..e2dde453f8 100644 --- a/lib/param/loadparm.c +++ b/lib/param/loadparm.c @@ -2087,6 +2087,27 @@ void *lpcfg_parm_ptr(struct loadparm_context *lp_ctx, } /** + return the parameter pointer for a parameter +*/ +bool lpcfg_parm_is_cmdline(struct loadparm_context *lp_ctx, const char *name) +{ + int parmnum; + + if (lp_ctx->s3_fns) { + struct parm_struct *parm = lp_ctx->s3_fns->get_parm_struct(name); + if (parm) { + return parm->flags & FLAG_CMDLINE; + } + return false; + } + + parmnum = map_parameter(name); + if (parmnum == -1) return false; + + return lp_ctx->flags[parmnum] & FLAG_CMDLINE; +} + +/** * Find a service by name. Otherwise works like get_service. */ |