Bug 15363 - "samba-tool domain provision" does not run interactive mode if no arguments are given
Summary: "samba-tool domain provision" does not run interactive mode if no arguments a...
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Python (show other bugs)
Version: 4.18.2
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Jule Anger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-25 14:00 UTC by Björn Baumbach
Modified: 2023-05-31 16:11 UTC (History)
1 user (show)

See Also:


Attachments
Patch backported to Samba 4.18 (1.12 KB, patch)
2023-05-17 01:02 UTC, Jo Sutton
abartlet: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Björn Baumbach 2023-04-25 14:00:01 UTC
In Samba 4.18 the provision command fails (if no args are given) with:

# samba-tool domain provision
ERROR: No domain set!

Before 4.18 it automatically started the interactive mode and asked for realm, domain, dns, etc.

Workaround:
Use the --interactive parameter.
# samba-tool domain provision --interactive
Realm []:

I didn't check this in detail, but I assume that this has been introduced somewhere around commit ed78786989779f31d97de2aa81b06ef0c0ad7f39

In python/samba/netcmd/domain.py cmd_domain_provision() the following is broken, since len(self.raw_argv) is now 0, not 1:

if len(self.raw_argv) == 1:
    interactive = True
Comment 1 Samba QA Contact 2023-05-17 00:25:06 UTC
This bug was referenced in samba master:

f1281b80c1ad68d380ce91c13076f6a60fbc627e
Comment 2 Jo Sutton 2023-05-17 01:02:53 UTC
Created attachment 17887 [details]
Patch backported to Samba 4.18
Comment 3 Andrew Bartlett 2023-05-17 02:02:04 UTC
Assigning to Jule for 4.18.next
Comment 4 Jule Anger 2023-05-23 07:08:12 UTC
Pushed to autobuild-v4-18-test.
Comment 5 Samba QA Contact 2023-05-26 13:30:12 UTC
This bug was referenced in samba v4-18-test:

74449f2afcc4559aeee1888c048965866cb3a4c2
Comment 6 Jule Anger 2023-05-26 14:38:46 UTC
Closing out bug report.

Thanks!
Comment 7 Samba QA Contact 2023-05-31 16:11:17 UTC
This bug was referenced in samba v4-18-stable (Release samba-4.18.3):

74449f2afcc4559aeee1888c048965866cb3a4c2