Some debug symbols later and with
(gdb) break open if strcmp($rdi,"/etc/samba/smb.conf") == 0
We see that code is mostly from ../../source3/param/loadparm.c:4076
lp_load_client
-> lp_load_global
-> lp_load
-> lp_load_ex
-> pm_process (lib/util/params.c:94)
-> tini_parse (lib/util/tini.c)
Real backtrace:
#5 0x00007ffff7808e74 in pm_process (filename=filename@entry=0x5555555c2810
"/etc/samba/smb.conf", sfunc=sfunc@entry=0x7ffff7a709f0 <lp_do_section>,
pfunc=pfunc@entry=0x7ffff7a678f0 <do_parameter>,
private_data=private_data@entry=0x5555555b73b0) at ../../lib/util/params.c:94
#6 0x00007ffff7a7273d in lp_load_ex (pszFname=0x7ffff7810caf
"/etc/samba/smb.conf", global_only=global_only@entry=true,
save_defaults=save_defaults@entry=false,
add_ipc=add_ipc@entry=false, reinit_globals=reinit_globals@entry=true,
allow_include_registry=allow_include_registry@entry=true,
load_all_shares=<optimized out>)
at ../../source3/param/loadparm.c:3911
#7 0x00007ffff7a73024 in lp_load (reinit_globals=true, add_ipc=false,
save_defaults=false, global_only=true, pszFname=<optimized out>) at
../../source3/param/loadparm.c:4048
#8 lp_load_global (file_name=<optimized out>) at
../../source3/param/loadparm.c:4048
#9 0x00007ffff7a73040 in lp_load_client (file_name=<optimized out>) at
../../source3/param/loadparm.c:4076
#10 0x00007ffff7c916c0 in popt_common_credentials_callback (data=<optimized
out>, arg=<optimized out>, opt=<optimized out>, reason=<optimized out>,
con=0x5555555b6950)
at ../../source3/lib/popt_common_cmdline.c:107
Compare that to the smbd service:
$ strace -rtT -f -o smbd.strace /usr/sbin/smbd --foreground --no-process-group
$ grep -Hrn -e 'open.*smb.conf' -e "open.*test" smbd.strace
smbd.strace:1747:12014 10:25:26 (+ 0.000049) openat(AT_FDCWD,
"/etc/samba/smb.conf", O_RDONLY) = 3 <0.000012>
smbd.strace:1833:12014 10:25:26 (+ 0.000041) openat(AT_FDCWD,
"/etc/samba/smb.conf", O_RDONLY) = 5 <0.000010>
smbd.strace:1840:12014 10:25:26 (+ 0.000037) openat(AT_FDCWD,
"/etc/samba/test1.conf", O_RDONLY) = 10 <0.000010>
smbd.strace:1845:12014 10:25:26 (+ 0.000040) openat(AT_FDCWD,
"/etc/samba/test1b.conf", O_RDONLY) = 11 <0.000009>
smbd.strace:1854:12014 10:25:26 (+ 0.000037) openat(AT_FDCWD,
"/etc/samba/test2.conf", O_RDONLY) = 10 <0.000009>
smbd.strace:1861:12014 10:25:26 (+ 0.000037) openat(AT_FDCWD,
"/etc/samba/test3.conf", O_RDONLY) = 10 <0.000009>
(gdb) break open if strcmp($rdi,"/etc/samba/smb.conf") == 0
(gdb) break open if strcmp($rdi,"/etc/samba/test1.conf") == 0
Breakpoint 1, __libc_open64 (file=0x5555555a2e40 "/etc/samba/smb.conf",
oflag=0) at ../sysdeps/unix/sysv/linux/open64.c:37
37 ../sysdeps/unix/sysv/linux/open64.c: No such file or directory.
(gdb) bt
#0 __libc_open64 (file=0x5555555a2e40 "/etc/samba/smb.conf", oflag=0) at
../sysdeps/unix/sysv/linux/open64.c:37
#1 0x00007ffff72ac196 in __GI__IO_file_open (fp=fp@entry=0x555555590c40,
filename=<optimized out>, posix_mode=<optimized out>, prot=prot@entry=438,
read_write=8, is32not64=<optimized out>)
at fileops.c:189
#2 0x00007ffff72ac45a in _IO_new_file_fopen (fp=fp@entry=0x555555590c40,
filename=filename@entry=0x5555555a2e40 "/etc/samba/smb.conf", mode=<optimized
out>, mode@entry=0x7ffff7f68047 "r",
is32not64=is32not64@entry=1) at fileops.c:281
#3 0x00007ffff729eb0e in __fopen_internal (is32=1, mode=0x7ffff7f68047 "r",
filename=0x5555555a2e40 "/etc/samba/smb.conf") at iofopen.c:75
#4 _IO_new_fopen (filename=filename@entry=0x5555555a2e40
"/etc/samba/smb.conf", mode=mode@entry=0x7ffff7f68047 "r") at iofopen.c:86
#5 0x00007ffff7f61e74 in pm_process (filename=filename@entry=0x5555555a2e40
"/etc/samba/smb.conf", sfunc=sfunc@entry=0x7ffff7b7d9f0 <lp_do_section>,
pfunc=pfunc@entry=0x7ffff7b748f0 <do_parameter>,
private_data=private_data@entry=0x5555555895e0) at ../../lib/util/params.c:94
#6 0x00007ffff7b7f73d in lp_load_ex (pszFname=0x7ffff7f69caf
"/etc/samba/smb.conf", global_only=global_only@entry=true,
save_defaults=save_defaults@entry=true, add_ipc=add_ipc@entry=false,
reinit_globals=reinit_globals@entry=true,
allow_include_registry=allow_include_registry@entry=false,
load_all_shares=<optimized out>) at ../../source3/param/loadparm.c:3911
#7 0x00007ffff7b7fff4 in lp_load_initial_only (pszFname=<optimized out>) at
../../source3/param/loadparm.c:4031
#8 0x000055555555c3f2 in main (argc=<optimized out>, argv=0x7fffffffe608) at
../../source3/smbd/server.c:1789
Breakpoint 2, __libc_open64 (file=0x5555555a6840 "/etc/samba/test1.conf",
oflag=0) at ../sysdeps/unix/sysv/linux/open64.c:37
37 ../sysdeps/unix/sysv/linux/open64.c: No such file or directory.
(gdb) bt
#0 __libc_open64 (file=0x5555555a6840 "/etc/samba/test1.conf", oflag=0) at
../sysdeps/unix/sysv/linux/open64.c:37
#1 0x00007ffff72ac196 in __GI__IO_file_open (fp=fp@entry=0x5555555a69e0,
filename=<optimized out>, posix_mode=<optimized out>, prot=prot@entry=438,
read_write=8, is32not64=<optimized out>)
at fileops.c:189
#2 0x00007ffff72ac45a in _IO_new_file_fopen (fp=fp@entry=0x5555555a69e0,
filename=filename@entry=0x5555555a6840 "/etc/samba/test1.conf", mode=<optimized
out>,
mode@entry=0x7ffff7f68047 "r", is32not64=is32not64@entry=1) at fileops.c:281
#3 0x00007ffff729eb0e in __fopen_internal (is32=1, mode=0x7ffff7f68047 "r",
filename=0x5555555a6840 "/etc/samba/test1.conf") at iofopen.c:75
#4 _IO_new_fopen (filename=filename@entry=0x5555555a6840
"/etc/samba/test1.conf", mode=mode@entry=0x7ffff7f68047 "r") at iofopen.c:86
#5 0x00007ffff7f61e74 in pm_process (filename=filename@entry=0x5555555a6840
"/etc/samba/test1.conf", sfunc=sfunc@entry=0x7ffff7b7d9f0 <lp_do_section>,
pfunc=pfunc@entry=0x7ffff7b748f0 <do_parameter>,
private_data=private_data@entry=0x5555555a3fc0) at ../../lib/util/params.c:94
#6 0x00007ffff7b7e098 in lp_include (lp_ctx=0x5555555a3fc0,
service=0x5555555a6020, pszParmValue=0x55555558bcaa "/etc/samba/test1.conf",
ptr=0x5555555a6108)
at ../../source3/param/loadparm.c:2460
#7 0x00007ffff7f56d1e in parse_param (private_data=0x5555555a3fc0,
pfunc=0x7ffff7b748f0 <do_parameter>, allow_empty_value=false,
buf=0x55555558bca0 "include") at ../../lib/util/tini.c:264
#8 tini_parse (f=f@entry=0x5555555a4740,
allow_empty_value=allow_empty_value@entry=false,
sfunc=sfunc@entry=0x7ffff7b7d9f0 <lp_do_section>,
pfunc=pfunc@entry=0x7ffff7b748f0 <do_parameter>,
private_data=private_data@entry=0x5555555a3fc0) at ../../lib/util/tini.c:309
#9 0x00007ffff7f61e8f in pm_process (filename=filename@entry=0x5555555a2f50
"/etc/samba/smb.conf", sfunc=sfunc@entry=0x7ffff7b7d9f0 <lp_do_section>,
pfunc=pfunc@entry=0x7ffff7b748f0 <do_parameter>,
private_data=private_data@entry=0x5555555a3fc0) at ../../lib/util/params.c:99
#10 0x00007ffff7b7f73d in lp_load_ex (pszFname=0x7ffff7f69caf
"/etc/samba/smb.conf", global_only=global_only@entry=false,
save_defaults=save_defaults@entry=false,
add_ipc=add_ipc@entry=true, reinit_globals=reinit_globals@entry=true,
allow_include_registry=allow_include_registry@entry=true,
load_all_shares=<optimized out>)
at ../../source3/param/loadparm.c:3911
#11 0x00007ffff7b80064 in lp_load (reinit_globals=true, add_ipc=true,
save_defaults=false, global_only=false, pszFname=<optimized out>) at
../../source3/param/loadparm.c:4062
#12 lp_load_with_shares (file_name=<optimized out>) at
../../source3/param/loadparm.c:4062
#13 0x00007ffff7d2ce58 in reload_services (sconn=0x0, snumused=0x0,
test=<optimized out>) at ../../source3/smbd/server_reload.c:141
#14 0x000055555555c440 in main (argc=<optimized out>, argv=0x7fffffffe608) at
../../source3/smbd/server.c:1831
They mostly go through the same functions initially
(lp_load/lp_load_ex/pm_process) but in the server case the includes are
followed.
Most related is this function "lp_include"
I found plenty of code like
2200 »···if (!bInGlobalSection && bGlobalOnly) {
2201 »···»···ret = true;
Which seems like "if not in global section right now, then ignore"
Also debug level 4 reports about config parsing...
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1893906
Title:
smbclient ignores included config files
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/samba/+bug/1893906/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs