Skip to content

19.0 - #32

Open
JedMeister wants to merge 19 commits into
turnkeylinux-apps:masterfrom
JedMeister:19.0
Open

19.0#32
JedMeister wants to merge 19 commits into
turnkeylinux-apps:masterfrom
JedMeister:19.0

Conversation

@JedMeister

Copy link
Copy Markdown
Member

Still needs testing...

JedMeister and others added 19 commits August 6, 2026 16:27
The segment length check used `len(bit) < 0`, which can never be true.
socket.inet_aton() accepted partial dotted forms such as "8" and "8.8" as
valid, so a malformed --join_ns value could pass validation and be written
into resolv.conf. Switch valid_ip() to ipaddress.IPv4Address, which requires
a full dotted-quad, and drop the now-unused socket import.
'hostname -I' emits every address on the host, space separated and including
IPv6, so on a multi-address host NET_IP was interpolated raw into samba's
'interfaces' option and the hosts file, producing malformed config. Take the
first valid IPv4 instead.
Supplying --join_ns expresses intent to join an existing domain, but the
interactive fallback branch set create = True, so a join request that fell
back to interactive mode (e.g. missing hostname) would create a brand new
domain instead. Set create = False, and clear an invalid join nameserver so
the interactive flow actually re-prompts for it rather than skipping the
prompt.
Replace the hardcoded Google DNS (8.8.8.8) forwarder with the host's existing
upstream nameserver, detected from /etc/resolv.conf before update_resolvconf()
repoints it at the local samba DNS. Skips loopback (and IPv6) entries and
falls back to 8.8.8.8 if no usable upstream is found, so behaviour is safe on
hosts with no external resolver configured.
update_resolvconf() used ping of the nameserver to check validity; now
it checks by attempting a TCP connection to nameserver via port 53.
'domain join' wrapped the option value in literal single quotes and
because run_command() execs samba-tool with shell=False the quotes are
passed verbatim. Samba then stores a quote-mangled "custom" option
rather than the intended "idmap_ldb:use rfc2307 = yes".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant