Skip to content

fix: Solve bug when changing permissions with no modification right#4107

Open
pkrog wants to merge 7 commits intomamba-org:mainfrom
nwhpc:solve-bug-when-changing-permissions-with-no-modification-right
Open

fix: Solve bug when changing permissions with no modification right#4107
pkrog wants to merge 7 commits intomamba-org:mainfrom
nwhpc:solve-bug-when-changing-permissions-with-no-modification-right

Conversation

@pkrog
Copy link

@pkrog pkrog commented Nov 27, 2025

Description

When trying to set execution mode for a file or setting permissions to cache directory, an error may occur if we have no modification right on the parent folder.
This error occurs regardless of the current permissions on the targeted file or folder.
Thus, even if we already have the required permissions on the targeted file or folder, the error occurs.

This pull request introduces a function has_permissions() that tests if we already have the wanted permissions on a file or folder.
This new function is used at the two places described above, in order to avoid a useless setting of permissions that would lead to an error.

Type of Change

  • Bugfix
  • Feature / enhancement
  • CI / Documentation
  • Maintenance

Checklist

  • My code follows the general style and conventions of the codebase, ensuring consistency
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have run pre-commit run --all locally in the source folder and confirmed that there are no linter errors.
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes

@github-actions github-actions bot added the release::bug_fixes For PRs fixing bugs label Nov 27, 2025
@codecov
Copy link

codecov bot commented Nov 27, 2025

Codecov Report

❌ Patch coverage is 89.47368% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.23%. Comparing base (4d706ef) to head (ca648c8).
⚠️ Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
libmamba/src/core/subdir_index.cpp 84.61% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4107      +/-   ##
==========================================
+ Coverage   51.21%   51.23%   +0.02%     
==========================================
  Files         239      239              
  Lines       28669    28677       +8     
  Branches     3008     3012       +4     
==========================================
+ Hits        14684    14694      +10     
+ Misses      13982    13980       -2     
  Partials        3        3              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pkrog
Copy link
Author

pkrog commented Nov 27, 2025

Codecov Report

❌ Patch coverage is 97.14286% with 2 lines in your changes missing coverage. Please review. ✅ Project coverage is 63.63%. Comparing base (c641811) to head (ad237ab).
Files with missing lines Patch % Lines
libmamba/src/core/subdir_index.cpp 84.61% 2 Missing ⚠️
Additional details and impacted files

☔ View full report in Codecov by Sentry. 📢 Have feedback on the report? Share it here.
🚀 New features to boost your workflow:

Note that I am not responsible for the two lines in question. They were here before, thus already not tested.

@jjerphan jjerphan changed the title Solve bug when changing permissions with no modification right fix: Solve bug when changing permissions with no modification right Nov 28, 2025
Copy link
Member

@Klaim Klaim left a comment

Choose a reason for hiding this comment

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

LGTM in essence but I would need a bit more documentation of the function.

As for the CI error on Windows, I'm not totally sure but I suspect the specific check is about a kind of permission not supported by that OS? Not sure.

@pkrog pkrog force-pushed the solve-bug-when-changing-permissions-with-no-modification-right branch from ad237ab to 612e056 Compare February 17, 2026 07:17
@pkrog pkrog force-pushed the solve-bug-when-changing-permissions-with-no-modification-right branch from 7e649b1 to ca648c8 Compare February 17, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release::bug_fixes For PRs fixing bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants