Bug 15698 - samba-tool can not load the default configuration file
Summary: samba-tool can not load the default configuration file
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: AD: LDB/DSDB/SAMDB (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Jule Anger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-21 09:10 UTC by Pavel Filipenský
Modified: 2024-09-17 11:47 UTC (History)
1 user (show)

See Also:


Attachments
patch for v4-21-test (1.79 KB, patch)
2024-08-21 09:26 UTC, Pavel Filipenský
asn: review+
Details
patch for v4-20-test (1.79 KB, patch)
2024-08-21 09:28 UTC, Pavel Filipenský
asn: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Filipenský 2024-08-21 09:10:37 UTC
Creating this bug for backports to samba 4.20/4.21. Fix is ready:
https://gitlab.com/samba-team/samba/-/merge_requests/3769

Reported for Fedora https://bugzilla.redhat.com/show_bug.cgi?id=2248840:

$ sudo samba-tool domain provision --interactive

ERROR(runtime): uncaught exception - Unable to load default file
  File "/usr/lib64/python3.12/site-packages/samba/netcmd/__init__.py", line 279, in _run
    return self.run(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/site-packages/samba/netcmd/domain/provision.py", line 182, in run
    lp = sambaopts.get_loadparm()
         ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/site-packages/samba/getopt.py", line 120, in get_loadparm
    self._lp.load_default()
Comment 1 Pavel Filipenský 2024-08-21 09:26:52 UTC
Created attachment 18415 [details]
patch for v4-21-test
Comment 2 Pavel Filipenský 2024-08-21 09:28:32 UTC
Created attachment 18416 [details]
patch for v4-20-test
Comment 3 Pavel Filipenský 2024-08-21 09:52:35 UTC
Evaluation:
Python based command "samba-tool domain provision" is using C-code from lib/param/loadparm.c to process smb.conf. If smb.conf contains "include" for non-existing file, the whole processing fails.
Other samba components process smb.conf using C-code from source3/param/loadparm.c which allows "include" for non-existing files.
The fix is to allow it in lib/param/loadparm.c (and samba-tool) as well.
Comment 4 Jule Anger 2024-08-21 09:57:46 UTC
Pushed to autobuild-v4-{21,20}-test.
Comment 5 Samba QA Contact 2024-08-21 11:20:03 UTC
This bug was referenced in samba v4-21-test:

0d41094f1304777f1c414de97b6d691983033913
Comment 6 Samba QA Contact 2024-08-22 09:02:04 UTC
This bug was referenced in samba v4-20-test:

cccf0beb9f897a0b9508b45118512fbb373e7da4
Comment 7 Jule Anger 2024-08-22 09:14:24 UTC
Closing out bug report.

Thanks!
Comment 8 Samba QA Contact 2024-08-27 13:13:49 UTC
This bug was referenced in samba v4-21-stable (Release samba-4.21.0rc4):

0d41094f1304777f1c414de97b6d691983033913
Comment 9 Samba QA Contact 2024-09-17 11:47:06 UTC
This bug was referenced in samba v4-20-stable (Release samba-4.20.5):

cccf0beb9f897a0b9508b45118512fbb373e7da4