smbclient config parsing in debug:

$ smbclient -d 4 -L 127.0.0.1 -U ubuntu%ubuntu
...
Processing section "[global]"
doing parameter workgroup = WORKGROUP
doing parameter comment = Test bug 1893906 - smb1.conf
doing parameter server string = %h server (Samba, Ubuntu)
doing parameter log file = /var/log/samba/log.%m
doing parameter max log size = 1000
doing parameter logging = file
doing parameter panic action = /usr/share/samba/panic-action %d
doing parameter server role = standalone server
doing parameter obey pam restrictions = yes
doing parameter unix password sync = yes
doing parameter passwd program = /usr/bin/passwd %u
doing parameter passwd chat = *Enter\snew\s*\spassword:* %n\n 
*Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
doing parameter pam password change = yes
doing parameter map to guest = bad user
doing parameter usershare allow guests = yes
pm_process() returned Yes
...


server
$ /usr/sbin/smbd -S -d 4 --foreground --no-process-group
...
Processing section "[global]"
doing parameter workgroup = WORKGROUP
doing parameter comment = Test bug 1893906 - smb1.conf
doing parameter server string = %h server (Samba, Ubuntu)
doing parameter log file = /var/log/samba/log.%m
doing parameter max log size = 1000
doing parameter logging = file
doing parameter panic action = /usr/share/samba/panic-action %d
doing parameter server role = standalone server
doing parameter obey pam restrictions = yes
doing parameter unix password sync = yes
doing parameter passwd program = /usr/bin/passwd %u
doing parameter passwd chat = *Enter\snew\s*\spassword:* %n\n 
*Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
doing parameter pam password change = yes
doing parameter map to guest = bad user
doing parameter usershare allow guests = yes
pm_process() returned Yes
get_current_groups: user is in 1 groups: 0
Registered MSG_REQ_POOL_USAGE
Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
lp_load_ex: refreshing parameters
Initialising global parameters
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[global]"
doing parameter workgroup = WORKGROUP
doing parameter comment = Test bug 1893906 - smb1.conf
doing parameter server string = %h server (Samba, Ubuntu)
doing parameter log file = /var/log/samba/log.%m
doing parameter max log size = 1000
doing parameter logging = file
doing parameter panic action = /usr/share/samba/panic-action %d
doing parameter server role = standalone server
doing parameter obey pam restrictions = yes
doing parameter unix password sync = yes
doing parameter passwd program = /usr/bin/passwd %u
doing parameter passwd chat = *Enter\snew\s*\spassword:* %n\n 
*Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
doing parameter pam password change = yes
doing parameter map to guest = bad user
doing parameter usershare allow guests = yes
Processing section "[printers]"
doing parameter comment = All Printers
doing parameter browseable = no
doing parameter path = /var/spool/samba
doing parameter printable = yes
doing parameter guest ok = no
doing parameter read only = yes
doing parameter create mask = 0700
Processing section "[print$]"
doing parameter comment = Printer Drivers
doing parameter path = /var/lib/samba/printers
doing parameter browseable = yes
doing parameter read only = yes
doing parameter guest ok = no
doing parameter include = /etc/samba/test1.conf
Processing section "[global]"
doing parameter client signing = mandatory
doing parameter comment = Test bug 1893906 - g1
doing parameter include = /etc/samba/test1b.conf
Processing section "[global]"
doing parameter comment = Test bug 1893906 - g1b
doing parameter client signing = mandatory
doing parameter include = /etc/samba/test2.conf
Processing section "[global]"
doing parameter comment = Test bug 1893906 - g2
doing parameter client signing = mandatory
doing parameter include = /etc/samba/test3.conf
Processing section "[global]"
doing parameter comment = Test bug 1893906 - g3
doing parameter client signing = mandatory
Processing section "[testshare]"
doing parameter path = /tmp/testshare
doing parameter browseable = yes
doing parameter read only = no
doing parameter create mask = 0700
doing parameter directory mask = 0700
doing parameter valid users = ubuntu
doing parameter guest ok = yes
pm_process() returned Yes
...


We again see the same code paths, but since "global-only" isn't set it reaches 
the includes.

Maybe we can trick this by moving the includes up from "before
[testshares] to the [global] section to then have (on parsing)
bInGlobalSection to be true when the include appears?

And yeah e voila - things work to set client related data now in the
included files.

rocessing section "[global]"
doing parameter workgroup = WORKGROUP
doing parameter comment = Test bug 1893906 - smb1.conf
doing parameter server string = %h server (Samba, Ubuntu)
doing parameter include = /etc/samba/test1.conf
Processing section "[global]"
doing parameter client signing = mandatory
doing parameter comment = Test bug 1893906 - g1
doing parameter include = /etc/samba/test1b.conf
Processing section "[global]"
doing parameter comment = Test bug 1893906 - g1b
doing parameter client signing = mandatory
doing parameter include = /etc/samba/test2.conf
Processing section "[global]"
doing parameter comment = Test bug 1893906 - g2
doing parameter client signing = mandatory
doing parameter include = /etc/samba/test3.conf
Processing section "[global]"
doing parameter comment = Test bug 1893906 - g3
doing parameter client signing = mandatory
doing parameter log file = /var/log/samba/log.%m
doing parameter max log size = 1000
doing parameter logging = file
doing parameter panic action = /usr/share/samba/panic-action %d
doing parameter server role = standalone server
doing parameter obey pam restrictions = yes
doing parameter unix password sync = yes
doing parameter passwd program = /usr/bin/passwd %u
doing parameter passwd chat = *Enter\snew\s*\spassword:* %n\n 
*Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
doing parameter pam password change = yes
doing parameter map to guest = bad user
doing parameter usershare allow guests = yes
pm_process() returned Yes

-- 
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

Reply via email to