Skip to content

_auditd_config.py: do not check permissions on file that doesn't exist#65

Merged
amstewart merged 1 commit intoni:masterfrom
AlexHearnNI:error_reporting
Apr 3, 2025
Merged

_auditd_config.py: do not check permissions on file that doesn't exist#65
amstewart merged 1 commit intoni:masterfrom
AlexHearnNI:error_reporting

Conversation

@AlexHearnNI
Copy link
Copy Markdown
Collaborator

@AlexHearnNI AlexHearnNI commented Mar 31, 2025

Summary of Changes

avoid FileNotFoundError exception when running verify before configure

Justification

If /etc/audit/auditd.conf doesn't exist, then verify will print a stack trace and return error 1 rather than EX_CHECK_FAILURE.

AB#3067833

Testing

I ran nilrt-snac verify.

Procedure

  • This PR: changes user-visible behavior, fixes a bug, or impacts the project's security profile; and so it includes a CHANGELOG note.
  • I certify that the contents of this pull request complies with the Developer Certificate of Origin.

@AlexHearnNI AlexHearnNI marked this pull request as ready for review March 31, 2025 19:23
@AlexHearnNI AlexHearnNI requested review from a team and amstewart as code owners March 31, 2025 19:23
@amstewart

This comment was marked as resolved.

This change avoids a FileNotFoundError exception when running 'verify' if
auditd.conf doesn't exist. The exception causes 'verify' to print a stack trace
and return error 1 rather than EX_CHECK_FAILURE. auditd.conf is not on the
nilrt base system image; it's created by nilrt-snac. Thus, that exception would
always happen when running 'verify' before running 'configure'.

Signed-off-by: Alex Hearn <alex.hearn@ni.com>
@AlexHearnNI AlexHearnNI changed the title _common.py: avoid FileNotFoundError exceptions when running verify _auditd_config.py: do not check permissions on file that doesn't exist Apr 1, 2025
@AlexHearnNI AlexHearnNI requested a review from amstewart April 1, 2025 18:48
@amstewart amstewart merged commit edab2de into ni:master Apr 3, 2025
5 checks passed
@AlexHearnNI AlexHearnNI deleted the error_reporting branch April 7, 2025 15:36
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