Skip to content

Feature: add env PATH into hijack sudo function - #4

Merged
xiulipan merged 1 commit into
thesofproject:masterfrom
Bin-QA:feature
Jan 2, 2020
Merged

xiulipan merged 1 commit into
thesofproject:masterfrom
Bin-QA:feature

Conversation

@Bin-QA

@Bin-QA Bin-QA commented Dec 18, 2019

Copy link
Copy Markdown
Contributor

Now skip type 'sudo env PATH="PATH"' from case command

Signed-off-by: Wu, BinX binx.wu@intel.com

@xiulipan xiulipan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

simple question about sudo -E

Comment thread case-lib/hijack.sh Resolved
xiulipan
xiulipan previously approved these changes Dec 19, 2019
@xiulipan

Copy link
Copy Markdown
Contributor

@aiChaoSONG @libinyang @keqiaozhang Please help to review.

@aiChaoSONG

Copy link
Copy Markdown

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 ?).
I suggest to make our commit message more verbose, what do you think? @xiulipan @Bin-QA

@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 xiulipan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, the comment is updated. @aiChaoSONG Please check the update comment in commit and approve if you think is OK.

@aiChaoSONG aiChaoSONG left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

good to me, now I understand what you did and the reason you did it like this

@xiulipan
xiulipan merged commit 02caa5e into thesofproject:master Jan 2, 2020
@Bin-QA
Bin-QA deleted the feature branch January 14, 2020 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants