-
Notifications
You must be signed in to change notification settings - Fork 665
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
Map mounting user's uid/gid by default (Fixes #331) #433
Conversation
Codecov Report
@@ Coverage Diff @@
## master #433 +/- ##
==========================================
+ Coverage 66.28% 66.45% +0.16%
==========================================
Files 141 141
Lines 5374 5389 +15
==========================================
+ Hits 3562 3581 +19
+ Misses 1812 1808 -4
Continue to review full report at Codecov.
|
src/client/cmd/mount.cpp
Outdated
fmt::format("{}:{} {}(): adding default uid/gid mapping", __FILE__, __LINE__, __FUNCTION__)); | ||
auto uid_entry = request.add_uid_maps(); | ||
uid_entry->set_host_uid(getuid()); | ||
uid_entry->set_instance_uid(-2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This "-2" confused me until I read the sftp_server code. So -2 means no_id_info_available, ok. The idea of "set the instance id to: no id info available" is also peculiar. But I don't see a simple refactoring that will correct this.
For the short term can this magic "-2" be defined in a shared place as a constant, so we can type something like:
set_instance_uid(use_host_uid)
src/client/cmd/mount.cpp
Outdated
|
||
auto gid_entry = request.add_gid_maps(); | ||
gid_entry->set_host_gid(getgid()); | ||
gid_entry->set_instance_gid(-2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's ok. Am curious why -2 was used in favour of -1, but I see no obvious reason why. @townsend2010 might know. But +1 from me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please run clang-format on this...I noticed some of the braces are not consistent with the rest of our code:)
Other than that, lgtm.
baea33f
to
4974b7a
Compare
4974b7a
to
ac0b3cb
Compare
@townsend2010 done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors r+
433: Map mounting user's uid/gid by default (Fixes #331) r=townsend2010 a=Saviq Co-authored-by: Michał Sawicz <[email protected]>
Build succeeded |
No description provided.