Repository navigation
Feature: add env PATH into hijack sudo function - #4
Conversation
xiulipan
left a comment
There was a problem hiding this comment.
simple question about sudo -E
|
@aiChaoSONG @libinyang @keqiaozhang Please help to review. |
|
When I submit patches to kernel, Pierre told me I should explain my patch clearly in commit message. It's a what, how and why steps. you should make it clear that what the problems is(why it need a fix), how you solve it, and why you solve it this way (safe? clarity? or ?). @Bin-QA I see what you did in this patch, but I didn't get the reason. could you please explain deeper? |
Root reason: hijack the 'sudo' command to match the differe system configure when user need to run the command with root permission but we also put some script which need root permission so when sudo load those script 'sudo' environment is miss the PATH for those script because sudo have own PATH Already try for 'sudo --preserve-env' option but it couldn't find the script in new PATH it is the reason use 'sudo env PATH="$PATH"' to passdown the PATH to sudo Now skip type 'sudo env PATH="PATH"' from case script instead of do this at hijack, so in the case script can direct to use sudo without setup 'env' for the root permission script Signed-off-by: Wu, BinX <binx.wu@intel.com>
xiulipan
left a comment
There was a problem hiding this comment.
LGTM, the comment is updated. @aiChaoSONG Please check the update comment in commit and approve if you think is OK.
aiChaoSONG
left a comment
There was a problem hiding this comment.
good to me, now I understand what you did and the reason you did it like this
Now skip type 'sudo env PATH="PATH"' from case command
Signed-off-by: Wu, BinX binx.wu@intel.com