Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inhibit DNS service if Samba is installed #21

Merged
merged 6 commits into from
Dec 12, 2024
Merged

Inhibit DNS service if Samba is installed #21

merged 6 commits into from
Dec 12, 2024

Conversation

DavidePrincipi
Copy link
Member

  • If a Samba instance appears on the local node, DNSMasq stops to be a DNS server to avoid conflict with Samba DC.
  • Fix SELinux error with /dev/stdout logging.
  • Fix Podman container name to reflect the unit name.

Refs NethServer/dev#7210

Ausearch output:

----
time->Wed Dec 11 16:41:50 2024
type=PROCTITLE msg=audit(1733935310.713:13358): proctitle="dnsmasq"
type=SYSCALL msg=audit(1733935310.713:13358): arch=c000003e syscall=93 success=no exit=-13 a0=9 a1=fffe a2=ffffffff a3=1000 items=0 ppid=46966 pid=46968 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="dnsmasq" exe="/usr/local/sbin/dnsmasq" subj=system_u:system_r:container_t:s0:c148,c738 key=(null)
type=AVC msg=audit(1733935310.713:13358): avc:  denied  { setattr } for  pid=46968 comm="dnsmasq" name="" dev="pipefs" ino=220247 scontext=system_u:system_r:container_t:s0:c148,c738 tcontext=system_u:system_r:container_runtime_t:s0 tclass=fifo_file permissive=0

In logs:

Dec 11 16:41:50 rl1 dnsmasq[46966]: Dec 11 16:41:50 dnsmasq[1]: warning: failed to change owner of /dev/stdout: Permission denied

- Put config file generation in "expand-config" helper command. Handle
  the special case when the configuration does not exist with an
  hardcoded default.

- Invoke the helper in create-module and at every service startup.

- Restart (and reconfigure) DNSMasq if a Samba instance appears on the
  local node.
If Samba DC is configured on the local node, inhibit our DNS service.
@DavidePrincipi DavidePrincipi self-assigned this Dec 11, 2024
Send logs to host /dev/log (journald Syslog transport).
If Samba gets removed, DNS service can be enabled again.
Restart only if dnsmasq is already configured and running.
@Tbaile Tbaile self-requested a review December 12, 2024 09:57
@DavidePrincipi DavidePrincipi merged commit 5947555 into main Dec 12, 2024
1 check passed
@DavidePrincipi DavidePrincipi deleted the feat-7210 branch December 12, 2024 10:08
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.

2 participants