Skip to content
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

Add timeout for rexec's get_password (#3484) #92

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

BYGX-wcr
Copy link
Collaborator

What I did

I added a timeout setting for the get_password function in rexec module so that automatic pipelines that does not expect password input will not get blocked. The current timeout setting is 10 sec.

How I did it

Add a SIGALRM signal before waiting for password input.

How to verify it

Run a "show ip bgp summary" on SONiC Chassis Supversior and does not input password until it times out.

Previous command output (if the output of a command-line utility has changed)

Before adding such a mechanism, if you do not input password when run "rexec -c " you will be blocked at the following output:

Since the current device is a chassis supervisor, this command will be executed remotely on all linecards
Password for username 'XXX':

New command output (if the output of a command-line utility has changed) After adding such a mechanism, if you do not input password when run "rexec -c " you will see a timeout message after 10 seconds.

Since the current device is a chassis supervisor, this command will be executed remotely on all linecards
Password for username 'XXX': 
Aborted! Timeout when waiting for password input.

### What I did

I added a timeout setting for the get_password function in rexec module so that automatic pipelines that does not expect password input will not get blocked. The current timeout setting is 10 sec.

#### How I did it

Add a SIGALRM signal before waiting for password input. 

#### How to verify it

Run a "show ip bgp summary" on SONiC Chassis Supversior and does not input password until it times out.

#### Previous command output (if the output of a command-line utility has changed)

Before adding such a mechanism, if you do not input password when run "rexec -c <cmd>" you will be blocked at the following output:
```
Since the current device is a chassis supervisor, this command will be executed remotely on all linecards
Password for username 'XXX':
```

#### New command output (if the output of a command-line utility has changed)
After adding such a mechanism, if you do not input password when run "rexec -c <cmd>" you will see a timeout message after 10 seconds.
```
Since the current device is a chassis supervisor, this command will be executed remotely on all linecards
Password for username 'XXX': 
Aborted! Timeout when waiting for password input.
```
@BYGX-wcr BYGX-wcr requested a review from gechiang August 21, 2024 03:25
@BYGX-wcr BYGX-wcr merged commit 947df4e into sonic-net:202205 Aug 21, 2024
3 checks passed
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.

2 participants