Skip to content

Add sudo check for TSA/B/C command execution#15288

Merged
lguohan merged 1 commit intosonic-net:masterfrom
tjchadaga:tsa_sudo_check
Jun 3, 2023
Merged

Add sudo check for TSA/B/C command execution#15288
lguohan merged 1 commit intosonic-net:masterfrom
tjchadaga:tsa_sudo_check

Conversation

@tjchadaga
Copy link
Copy Markdown
Contributor

Why I did it

TSA/B/C scripts invoke commands that require root permissions. If the user does not have sudo permissions, the scripts today execute until the command and throw a backtrace with error at the specific command. Added a check to ensure the operations check for root permissions upfront.

Work item tracking
  • Microsoft ADO (number only):

How I did it

Added check for sudo user at the start of the scripts

How to verify it

  • TSA/B/C without sudo should throw an error.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@tjchadaga tjchadaga marked this pull request as ready for review June 1, 2023 17:41
@tjchadaga tjchadaga requested a review from lguohan as a code owner June 1, 2023 17:41
@tjchadaga tjchadaga self-assigned this Jun 1, 2023
@tjchadaga tjchadaga requested a review from rlhui June 1, 2023 17:43
@lguohan lguohan merged commit 8058550 into sonic-net:master Jun 3, 2023
@gechiang gechiang added the Included in Chassis for 202205 Branch Indicate PR is already in MSFT repo 202205 branch label Jul 13, 2023
sonic-otn pushed a commit to sonic-otn/sonic-buildimage that referenced this pull request Sep 20, 2023
TSA/B/C scripts invoke commands that require root permissions. If the user does not have sudo permissions, the scripts today execute until the command and throw a backtrace with error at the specific command. Added a check to ensure the operations check for root permissions upfront.
mlok-nokia pushed a commit to mlok-nokia/sonic-buildimage that referenced this pull request Jun 5, 2024
TSA/B/C scripts invoke commands that require root permissions. If the user does not have sudo permissions, the scripts today execute until the command and throw a backtrace with error at the specific command. Added a check to ensure the operations check for root permissions upfront.
mlok-nokia pushed a commit to mlok-nokia/sonic-buildimage that referenced this pull request Jun 5, 2024
[bgp]: Add sudo check for TSA/B/C command execution (sonic-net#15288)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Chassis for 202205 branch PRs needed for 202205 branch in msft repo Included in Chassis for 202205 Branch Indicate PR is already in MSFT repo 202205 branch Request for 202211 Branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants