Project

General

Profile

Bug #5049

Fix ValidatorConfig behavior with empty configuration

Added by Teng Liang 7 months ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Category:
Security
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:

Description

The current ValidationPolicyConfig throws an exception when loading empty config section. A better behavior would be:

  • allow loading an empty config file/section without throwing
  • fail any validation attempts when the configuration is empty

Related issues

Blocks NFD - Feature #5031: Make NFD work out of the boxIn ProgressTeng Liang

Actions
#1

Updated by Davide Pesavento 7 months ago

  • Tracker changed from Task to Bug
  • Category set to Security
#2

Updated by Davide Pesavento 7 months ago

  • Subject changed from Improve validator behavior: empty config section can be loaded but fails validation to Fix ValidatorConfig behavior with empty configuration
  • Description updated (diff)
#3

Updated by Davide Pesavento 7 months ago

Teng Liang wrote:

The current ValidationPolicyConfig throws an exception when loading empty config section, but then allows any validation.

I did not observe the second part of the behavior described above ("allows any validation"). @Teng, can you explain how to reproduce that?

#4

Updated by Davide Pesavento 7 months ago

  • Status changed from New to Code review
  • Assignee set to Davide Pesavento
  • Target version set to v0.7
#5

Updated by Davide Pesavento 7 months ago

#6

Updated by Teng Liang 7 months ago

Davide Pesavento wrote:

Teng Liang wrote:

The current ValidationPolicyConfig throws an exception when loading empty config section, but then allows any validation.

I did not observe the second part of the behavior described above ("allows any validation"). @Teng, can you explain how to reproduce that?

The test case in https://gerrit.named-data.net/c/NFD/+/5776/12/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp#182, the validation should fail but succeed.

#7

Updated by Davide Pesavento 7 months ago

Teng Liang wrote:

Davide Pesavento wrote:

Teng Liang wrote:

The current ValidationPolicyConfig throws an exception when loading empty config section, but then allows any validation.

I did not observe the second part of the behavior described above ("allows any validation"). @Teng, can you explain how to reproduce that?

The test case in https://gerrit.named-data.net/c/NFD/+/5776/12/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp#182, the validation should fail but succeed.

I still cannot reproduce (after applying the ndn-cxx patch of course, there's no way to test without it). Test cases behave as expected.

#8

Updated by Davide Pesavento 7 months ago

  • Description updated (diff)
  • Status changed from Code review to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF