inverse-inc / packetfence

PacketFence is a fully supported, trusted, Free and Open Source network access control (NAC) solution. Boasting an impressive feature set including a captive-portal for registration and remediation, centralized wired and wireless management, powerful BYOD management options, 802.1X support, layer-2 isolation of problematic devices; PacketFence can be used to effectively secure networks small to very large heterogeneous networks.
https://packetfence.org
GNU General Public License v2.0
1.27k stars 275 forks source link

web admin: creating a role with a dot in name prevent access to switches menu #6018

Closed nqb closed 3 years ago

nqb commented 3 years ago

Describe the bug If you create a role with a dot ('.') in name, you're not able to access your Switches or Switch Groups anymore.

I create a different issue than https://github.com/inverse-inc/packetfence/issues/4851 because it's quite old but it looks to be the same.

This issue has been seen on a 10.1.0 setup.

To Reproduce Steps to reproduce the behavior:

  1. Create a role called "USR_HR_107.0"
  2. Try to display Switches or Switch Groups

=> You got an error

In packetfence.log:

Dec  7 07:14:56 pfcen7dev packetfence: pfperl-api(1923) ERROR: did not  find parent for field USR_HR_107.0Role at  /usr/share/perl5/vendor_perl/HTML/FormHandler/BuildFields.pm line 239.  (Mojolicious::Plugin::DefaultHelpers::_development)

Expected behavior Access Switches or Switch groups as usual or prevent creation of a role with a dot in name.

Additional context Role is correctly created in DB and in roles.conf.

If I query API, I got a correct answer.

jrouzierinverse commented 3 years ago

It is happening for the same reason as #4851 this is a limitation of the HTML::FormHandler.

nqb commented 3 years ago

@jrouzierinverse, perhaps we can workaround this issue by checking value of role name before we create it (on backend) ?