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

Silent capsh error output #1133

Merged
merged 2 commits into from Jul 9, 2022
Merged

Silent capsh error output #1133

merged 2 commits into from Jul 9, 2022

Conversation

casperklein
Copy link
Contributor

Signed-off-by: Casper casperklein@users.noreply.github.com

Description

This fixes a little "regression" introduced with #1086.

Before the mentioned PR, there was no output because grep -q was used.

Now if a capability is not available, something like this is printed:

cap[cap_net_admin] not permitted

Motivation and Context

Restore old behaviour.

How Has This Been Tested?

Before:

# /sbin/capsh --has-p=cap_net_admin && CAP_STR+=',CAP_NET_ADMIN' || DHCP_READY='false'
cap[cap_net_admin] not permitted

After (no output):

# /sbin/capsh --has-p=cap_net_admin 2>/dev/null && CAP_STR+=',CAP_NET_ADMIN' || DHCP_READY='false'

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

casperklein and others added 2 commits July 9, 2022 01:59
Signed-off-by: Casper <casperklein@users.noreply.github.com>
@sonarcloud
Copy link

sonarcloud bot commented Jul 9, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@PromoFaux PromoFaux merged commit faf8e29 into pi-hole:dev Jul 9, 2022
@casperklein casperklein deleted the dev branch July 9, 2022 18:10
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.

None yet

2 participants