Bug 15218 - samba-tool doesn’t support include = registry
Summary: samba-tool doesn’t support include = registry
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Tools (show other bugs)
Version: 4.17.1
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-31 09:18 UTC by Lev
Modified: 2022-10-31 09:18 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lev 2022-10-31 09:18:29 UTC
In handle_include() lp_ctx->s3_fns is NULL, so lp_include() is not called and handle_include() returns false()

# samba-tool ntacl get /export/nas3 -d2
lpcfg_load: refreshing parameters from /etc/samba/smb.conf
Can't find include file registry
ERROR(runtime): uncaught exception - Unable to load default file
  File "/usr/lib/python3/dist-packages/samba/netcmd/__init__.py", line 185, in _run
    return self.run(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/samba/netcmd/ntacl.py", line 168, in run
    lp = sambaopts.get_loadparm()
  File "/usr/lib/python3/dist-packages/samba/getopt.py", line 92, in get_loadparm
    self._lp.load_default()

Breakpoint 1, handle_include (lp_ctx=0xcef680, service=0x0, pszParmValue=0xd38aea "registry", ptr=0xcf0d30) at ../../lib/param/loadparm.c:1105
1105            if (lp_ctx->s3_fns) {
(gdb) bt
#0  handle_include (lp_ctx=0xcef680, service=0x0, pszParmValue=0xd38aea "registry", ptr=0xcf0d30) at ../../lib/param/loadparm.c:1105
#1  0x00007ffff4d5ec94 in set_variable (mem_ctx=0xd36700, service=0x0, parmnum=189, parm_ptr=0xcf0d30, pszParmName=0xd38ae0 "include", pszParmValue=0xd38aea "registry", lp_ctx=0xcef680, on_globals=true) at ../../lib/param/loadparm.c:1717
#2  0x00007ffff4d5f0a2 in lpcfg_do_global_parameter (lp_ctx=0xcef680, pszParmName=0xd38ae0 "include", pszParmValue=0xd38aea "registry") at ../../lib/param/loadparm.c:1776
#3  0x00007ffff4d5f4a5 in lpcfg_do_parameter (pszParmName=0xd38ae0 "include", pszParmValue=0xd38aea "registry", userdata=0xcef680) at ../../lib/param/loadparm.c:1846
#4  0x00007ffff4aec816 in parse_param (buf=0xd38ae0 "include", allow_empty_value=false, pfunc=0x7ffff4d5f466 <lpcfg_do_parameter>, private_data=0xcef680) at ../../lib/util/tini.c:264
#5  0x00007ffff4aec8f6 in tini_parse (f=0xd563c0, allow_empty_value=false, sfunc=0x7ffff4d5fe27 <do_section>, pfunc=0x7ffff4d5f466 <lpcfg_do_parameter>, private_data=0xcef680) at ../../lib/util/tini.c:309
#6  0x00007ffff4aef8a1 in pm_process_with_flags (filename=0xd561a0 "/etc/samba/smb.conf", allow_empty_values=false, sfunc=0x7ffff4d5fe27 <do_section>, pfunc=0x7ffff4d5f466 <lpcfg_do_parameter>, private_data=0xcef680) at ../../lib/util/params.c:111
#7  0x00007ffff4aef837 in pm_process (filename=0xd561a0 "/etc/samba/smb.conf", sfunc=0x7ffff4d5fe27 <do_section>, pfunc=0x7ffff4d5f466 <lpcfg_do_parameter>, private_data=0xcef680) at ../../lib/util/params.c:91
#8  0x00007ffff4d63348 in lpcfg_load_internal (lp_ctx=0xcef680, filename=0x7ffff4b38563 "/etc/samba/smb.conf", set_global=true) at ../../lib/param/loadparm.c:3199
#9  0x00007ffff4d6349b in lpcfg_load (lp_ctx=0xcef680, filename=0x7ffff4b38563 "/etc/samba/smb.conf") at ../../lib/param/loadparm.c:3234
#10 0x00007ffff4d631fe in lpcfg_load_default (lp_ctx=0xcef680) at ../../lib/param/loadparm.c:3166
#11 0x00007ffff5181d1f in py_lp_ctx_load_default (self=0x7ffff7eec5d0, unused=0x0) at ../../source4/param/pyparam.c:163
...

(gdb) p lp_ctx->s3_fns
$1 = (const struct loadparm_s3_helpers *) 0x0

(gdb) p pszParmValue
$2 = 0xd38aea "registry"