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

Stop faking current user uid/gid in extfs #4643

Open
mc-butler opened this issue Jan 30, 2025 · 5 comments
Open

Stop faking current user uid/gid in extfs #4643

mc-butler opened this issue Jan 30, 2025 · 5 comments
Assignees
Labels
area: vfs Virtual File System support prio: medium Has the potential to affect progress ver: 4.8.33 Reproducible in version 4.8.33
Milestone

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/4643
Reporter zaytsev (@zyv)

Currently, we have a completely inconsistent way of addressing uid / gid in our extfs scripts.

Here is an assortment of what we do in different cases:

  1. Fake current user uid/gid
  2. Fake current user uid, but set gid to 0
  3. Fake uid/gid from file stat
  4. Fake uid from file stat, set gid to 0
  5. Always return 0/0

Sometimes numeric and sometimes symbolic names are returned.

This makes testing difficult and in particular next to impossible to make the test suite run as root.

My suggestion is to always return 0/0, if the FS in question does not have information about uid/gid, instead of doing 1.-4. Only if the FS does have this information, try to translate it appropriately.

My understanding is that mc will take current user uid/gid upon copyout anyways, so faking is not necessary. Going for 0/0 doesn't present any disadvantage I can think of.

@mc-butler
Copy link
Author

Changed by zaytsev (@zyv) on Jan 30, 2025 at 18:05 UTC (comment 1)

  • Status changed from new to accepted
  • Owner set to zaytsev
  • Branch state changed from no branch to on review

Branch: 4643_stop_fake_uid_gid_extfs
Initial changeset: [d0f3e26]

@mc-butler
Copy link
Author

Changed by zaytsev (@zyv) on Jan 30, 2025 at 18:06 UTC

@mc-butler
Copy link
Author

Changed by zaytsev (@zyv) on Feb 3, 2025 at 10:19 UTC (comment 3)

  • Branch state changed from on review to on rework

@mc-butler
Copy link
Author

Changed by zaytsev (@zyv) on Feb 22, 2025 at 11:23 UTC

@mc-butler
Copy link
Author

Changed by zaytsev (@zyv) on Feb 22, 2025 at 14:13 UTC (comment 5)

@zyv zyv added the ver: 4.8.33 Reproducible in version 4.8.33 label Mar 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: vfs Virtual File System support prio: medium Has the potential to affect progress ver: 4.8.33 Reproducible in version 4.8.33
Development

No branches or pull requests

2 participants