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

netmgr should validate dns_domains input character limit (if given more than 256 character , systemd will reject) #4

Open
suezzelur opened this issue Oct 10, 2018 · 0 comments

Comments

@suezzelur
Copy link

Two validations to be done.

  1. total character limit , (not more 256) . netmgr does not validate the limit and add directly into .network file , but systemd reject this.

    root@appcheck-vm [ /etc/systemd/network ]# netmgr dns_domains --set --domains abcdefoghijklimsgshsdabcdefoghijklimsgshsdabcdefoghijklimsgshsdabcdefoghijklimsgshsdabcdefoghijklimsgshsdabcdefoghijklimsgshsdabcdefoghijklimsgshsdabcdefoghijklimsgshsdabcdefoghijklimsgshsdabcdefoghijklimsgshsdabcdefoghijklimsgshsdabcdefoghijklimsgshsdabcdefoghijklimsgshsd.qe.local
    root@appcheck-vm [ /etc/systemd/network ]# netmgr dns_domains --get
    Error: value not found
    root@appcheck-vm [ /etc/systemd/network ]# cat /etc/systemd/network/00-eth0.network

[Match]
Name=eth0

[Network]
DHCP=yes
Domains=abcdefoghijklimsgshsdabcdefoghijklimsgshsdabcdefoghijklimsgshsdabcdefoghijklimsgshsdabcdefoghijklimsgshsdabcdefoghijklimsgshsdabcdefoghijklimsgshsdabcdefoghijklimsgshsdabcdefoghijklimsgshsdabcdefoghijklimsgshsdabcdefoghijklimsgshsdabcdefoghijklimsgshsdabcdefoghijklimsgshsd.qe.local

  1. total number of entries , (not more 6) , netmgr does not validates the limit and add directly into .network file , but systemd rejects all remaining .

root@appcheck-vm [ /etc/systemd/network ]# netmgr dns_domains --set --domains netmgmtqe1.local,netmgmtqe2.local,netmgmtqe3.local,netmgmtqe4.local,netmgmtqe5.local,netmgmtqe6.local,netmgmtqe7.local
root@appcheck-vm [ /etc/systemd/network ]# echo $?
0
root@appcheck-vm [ /etc/systemd/network ]# netmgr dns_domains --get
Domains=netmgmtqe1.local netmgmtqe2.local netmgmtqe3.local netmgmtqe4.local netmgmtqe5.local netmgmtqe6.local # Too many search domains configured, remaining ones ignored. # Total length of all search domains is too long, remaining ones ignored.

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

No branches or pull requests

1 participant