-
Notifications
You must be signed in to change notification settings - Fork 43
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
Try USER variable to retrieve the username. #282
Try USER variable to retrieve the username. #282
Conversation
8d09ed2
to
54d9b66
Compare
Codecov Report
@@ Coverage Diff @@
## ign-transport11 #282 +/- ##
===================================================
- Coverage 89.07% 89.06% -0.02%
===================================================
Files 51 51
Lines 4769 4772 +3
===================================================
+ Hits 4248 4250 +2
- Misses 521 522 +1
Continue to review full report at Codecov.
|
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.
It looks good to me, thanks for the patch!
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.
Well, one little request. Could you rename user_variable
to userVariable
to be consistent with our style?
Signed-off-by: Ivor Wanders <[email protected]>
54d9b66
to
be37fcc
Compare
@caguero, certainly, I've pushed a new commit where we use |
🦟 Bug fix
Summary
This resolves a situation where gazebo is endlessly spamming:
In our case, this triggered because a system was configured with ldap, but at runtime the
libnss_systemd
library wasn't available. This meant the user name lookup through ldap failed, and the fallback by reading it from/etc/passwd
didn't work as the user wasn't present there. It can probably be reproduced by making thegetpwuid_r
always fail.Basically, all this complexity can be removed by just checking the
$USER
environment variable. That is unlikely to fail on any linux system. I left the old behaviour in place as a fallback for ifUSER
is not set, but I can't think of a situation where that would be.Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.