netlabel / netlabel_tools

Tools to manage the Linux NetLabel subsystem
GNU General Public License v2.0
27 stars 8 forks source link

BUG: netlabel-config doesn't handle IPv6 address properly #10

Closed hubertqc closed 2 years ago

hubertqc commented 2 years ago

https://github.com/netlabel/netlabel_tools/blob/b9776c02c65d5d7bd2353c095e3d7f8702ab18f2/netlabelctl/netlabel-config.in#L42

The last cut -d':' -f 2 will break any IPv6 address found in the running configuration. Indeed, it will only return the very first part of the IPv6 address before the very first : in the address. And thus the netlabel-config reset command will not be able to purge IPv6 based rules for the unlbl protocol.

I suggest using cut -d':' -f 2- instead.

pcmoore commented 2 years ago

That's a nice catch @hubertqc, thank you!

Any chance you would be interested in submitting a PR to fix the problem? If so, there are some basic guidelines in the CONTRIBUTING.md file, but I'm also happy to answer any questions you may have about the process.

hubertqc commented 2 years ago

Hi @pcmoore,

Thanks to you, I just submitted my very first PR on a public GitHub repo !

Hope I did it correctly.

pcmoore commented 2 years ago

Thanks @hubertqc, I appreciate the help!

pcmoore commented 2 years ago

This should be resolved with PR #11.