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

Adding setuid permissions to ping binaries, so sudo is no longer needed #1765

Merged
merged 1 commit into from
Jun 5, 2018

Conversation

qiluo-msft
Copy link
Collaborator

- What I did
Fix ping tools permission so non root user can directly use them

- How I did it

- How to verify it

admin@sonic:~$ ls -la /bin/ping*
-rwsr-xr-x 1 root root 44104 Nov  8  2014 /bin/ping
-rwsr-xr-x 1 root root 44552 Nov  8  2014 /bin/ping6

admin@sonic:~$ ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.077 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.106 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.091 ms
^C

admin@sonic:~$ ping6 2a01:111:e210:3000:7efe:90ff:fe5e:6a9a
PING 2a01:111:e210:3000:7efe:90ff:fe5e:6a9a(2a01:111:e210:3000:7efe:90ff:fe5e:6a9a) 56 data bytes
64 bytes from 2a01:111:e210:3000:7efe:90ff:fe5e:6a9a: icmp_seq=1 ttl=64 time=0.043 ms
64 bytes from 2a01:111:e210:3000:7efe:90ff:fe5e:6a9a: icmp_seq=2 ttl=64 time=0.070 ms
64 bytes from 2a01:111:e210:3000:7efe:90ff:fe5e:6a9a: icmp_seq=3 ttl=64 time=0.074 ms
^C

- Description for the changelog

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

@qiluo-msft qiluo-msft merged commit d54a7ae into sonic-net:master Jun 5, 2018
@qiluo-msft qiluo-msft deleted the qiluo/sudoping branch June 5, 2018 04:01
vivekrnv pushed a commit to vivekrnv/sonic-buildimage that referenced this pull request Jan 6, 2022
Signed-off-by: Vivek Reddy Karri <[email protected]>

30f5dd6 Update the example for pfcwd start command (sonic-net#1984)
9e30871 [Auto Techsupport] Event driven Techsupport Bug Fixes (sonic-net#1986)
fbd565d Fix wrong help message for cable length setting (sonic-net#1978)
b3a5052 [GCU] Using simulated config instead of target config when validating replace operation in NoDependencyMoveValidator (sonic-net#1987)
35cb524 [GCU] Copying config_db before callding sonic_yang.loadData (sonic-net#1983)
a98858d [GCU] Different apply-patch runs should produce same sorted steps (sonic-net#1988)
8c81ae3 [breakout] Fix the check  when port is not present in BREAKOUT_CFG table (sonic-net#1765)
bc8fe7c [doc][DPB] Update DPB related interface breakout command Info (sonic-net#1438)
1a2a9a3 [config] Fix 'config reload -l' command to get filename by default (sonic-net#1611)
ed2fa69 [debug dump util] FDB debug dump util changes (sonic-net#1968)
3b642c9 [GCU] Loading yang-models only once (sonic-net#1981)
bb56fc2 Update swss_ready check to check per namespace swss service (sonic-net#1974)
4f39f9f [GCU] Moving PatchSorter unit-test to json file to make it easier to read/maintain (sonic-net#1977)
1a75870 [CLI][Help string] Changed the show command help text to be more consistent with each other.
818dcbf [GCU] Implementing DryRun by printing patch-sorter steps/imitating config_db (sonic-net#1973)
judyjoseph added a commit that referenced this pull request Jan 9, 2022
4236bc4 [config reload] Fixing config reload when timer based delayed services are disabled (#1967)
d2514e4 [GCU] Different apply-patch runs should produce same sorted steps (#1988)
2878adb [GCU] Using simulated config instead of target config when validating replace operation in NoDependencyMoveValidator (#1987)
fb8ca98 [GCU] Loading yang-models only once (#1981)
f88ee92 [GCU] Copying config_db before callding sonic_yang.loadData (#1983)
9ed0e91 [GCU] Implementing DryRun by printing patch-sorter steps/imitating config_db (#1973)
b36b5e3 [GCU] Moving PatchSorter unit-test to json file to make it easier to read/maintain (#1977)
c0fa28b [generic-config-updater] Improving CreateOnly validator and marking /LOOPBACK_INTERFACE/LOOPBACK#/vrf_name as create-only (#1969)
0559d04 [generic-config-updater] Adding non-strict mode (#1929)
b07f477 [debug dump util] FDB debug dump util changes (#1968)
6d8757a [warm/fast-reboot] Fix kexec portion to support platforms based on Device Tree (#1966)
cc1409e [Auto Techsupport] Event driven Techsupport Bug Fixes (#1986)
6c48bd5 Fix wrong help message for cable length setting (#1978)
c0bbbe3 [breakout] Fix the check  when port is not present in BREAKOUT_CFG table (#1765)
5bb8cad [doc][DPB] Update DPB related interface breakout command Info (#1438)
e6fd990 [config] Fix 'config reload -l' command to get filename by default (#1611)
bd8f7bb Update swss_ready check to check per namespace swss service (#1974)
5439f94 [soft-reboot] Add support for platforms based on Device Tree (#1963)
7c5810a [config] Add portchannel support  for static route  (#1857)
7cb6a1b preserve old order for config reload (#1964)
20bddbd [Auto-Techsupport] Issues related to Multiple Cores crashing handled (#1948)
@xumia xumia mentioned this pull request Jan 17, 2022
5 tasks
taras-keryk pushed a commit to taras-keryk/sonic-buildimage that referenced this pull request Apr 28, 2022
…le (sonic-net#1765)

#### What I did

This PR fixed issue for [show interface breakout](sonic-net#7957) issue

**Before this fix**
removed `Ethernet60` from breakout_cfg table for unit testing and got the issue
```
 
admin@lnos-x1-a-asw04:~$ sudo redis-cli -n 4 del "BREAKOUT_CFG|Ethernet60"
(integer) 1
admin@lnos-x1-a-asw04:~$ sudo redis-cli -n 4 hgetall "BREAKOUT_CFG|Ethernet60"
(empty array)
admin@lnos-x1-a-asw04:~$ show int breakout
Traceback (most recent call last):
  File "/usr/local/bin/show", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1114, in invoke
    return Command.invoke(self, ctx)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/show/interfaces/__init__.py", line 181, in breakout
    cur_brkout_mode = cur_brkout_tbl[port_name]["brkout_mode"]
KeyError: 'Ethernet60'

```

**After the fix**
```

admin@lnos-x1-a-asw04:~$ show int breakout current-mode Ethernet60
+-------------+-------------------------+
| Interface   | Current Breakout Mode   |
+=============+=========================+
| Ethernet60  | Not Available           |
+-------------+-------------------------+
```
#### How I did it
Gracefully handle the error when port/interface is not present in `BREAKOUT_CFG` table.

#### How to verify it
```
show interface breakout 
show int interface current-mode

```
**_Added unit test case for negetive Test case_**
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