Skip to content

Conversation

@vojtechtrefny
Copy link
Member

@vojtechtrefny vojtechtrefny commented Jan 29, 2026

This reverts commit 80ba38c.

Unfortunately blivet depends on libblockdev returning this specific error message.

Summary by CodeRabbit

  • Bug Fixes
    • Implemented access control enforcement for Device Mapper functionality. The system now validates that users possess root or administrator privileges before permitting Device Mapper operations. All Device Mapper-related tasks and queries will be restricted from non-privileged users, with appropriate error messaging provided. This change improves security and prevents unauthorized access.

✏️ Tip: You can customize this high-level summary in your review settings.

This reverts commit 80ba38c.

Unfortunately blivet depends on libblockdev returning this
specific error message.
@coderabbitai
Copy link

coderabbitai bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

Adds a root user permission check to the bd_dm_map_exists function in the device-mapper plugin. If the effective user ID is not 0 (root), the function sets the BD_DM_ERROR_NOT_ROOT error and returns FALSE immediately before any DM operations proceed.

Changes

Cohort / File(s) Summary
Root user permission check
src/plugins/dm.c
Added precondition in bd_dm_map_exists to verify effective user ID is 0 (root). Returns early with BD_DM_ERROR_NOT_ROOT error if not running as root, preventing subsequent DM task operations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: reverting a previous commit that removed a root permission check.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Member

@tbzatek tbzatek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine with me 🐸

@vojtechtrefny vojtechtrefny merged commit ca0d586 into storaged-project:master Jan 29, 2026
40 of 43 checks passed
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