-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Control usage of unix socket on DB read. #7002
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Else use tcp socket.
tahmed-dev
approved these changes
Mar 10, 2021
lguohan
approved these changes
Mar 10, 2021
lguohan
pushed a commit
that referenced
this pull request
Mar 10, 2021
…sing sudo. (#7002) Closes issue #6982. The issue was root caused as we were using the unix_socket for reading from DB as a default mechanism (#5250). The redis unix socket is created as follows. admin@str--acs-1:~$ ls -lrt /var/run/redis/redis.sock srwxrw---- 1 root redis 0 Mar 6 01:57 /var/run/redis/redis.sock So it used to work fine for the user "root" or if user is part of redis group ( admin was made part of redis group by default ) Check if the user is with sudo permissions then use the redis unix socket, else fallback to tcp socket.
abdosi
pushed a commit
that referenced
this pull request
Mar 10, 2021
…sing sudo. (#7002) Closes issue #6982. The issue was root caused as we were using the unix_socket for reading from DB as a default mechanism (#5250). The redis unix socket is created as follows. admin@str--acs-1:~$ ls -lrt /var/run/redis/redis.sock srwxrw---- 1 root redis 0 Mar 6 01:57 /var/run/redis/redis.sock So it used to work fine for the user "root" or if user is part of redis group ( admin was made part of redis group by default ) Check if the user is with sudo permissions then use the redis unix socket, else fallback to tcp socket.
raphaelt-nvidia
pushed a commit
to raphaelt-nvidia/sonic-buildimage
that referenced
this pull request
May 23, 2021
…sing sudo. (sonic-net#7002) Closes issue sonic-net#6982. The issue was root caused as we were using the unix_socket for reading from DB as a default mechanism (sonic-net#5250). The redis unix socket is created as follows. admin@str--acs-1:~$ ls -lrt /var/run/redis/redis.sock srwxrw---- 1 root redis 0 Mar 6 01:57 /var/run/redis/redis.sock So it used to work fine for the user "root" or if user is part of redis group ( admin was made part of redis group by default ) Check if the user is with sudo permissions then use the redis unix socket, else fallback to tcp socket.
carl-nokia
pushed a commit
to carl-nokia/sonic-buildimage
that referenced
this pull request
Aug 7, 2021
…sing sudo. (sonic-net#7002) Closes issue sonic-net#6982. The issue was root caused as we were using the unix_socket for reading from DB as a default mechanism (sonic-net#5250). The redis unix socket is created as follows. admin@str--acs-1:~$ ls -lrt /var/run/redis/redis.sock srwxrw---- 1 root redis 0 Mar 6 01:57 /var/run/redis/redis.sock So it used to work fine for the user "root" or if user is part of redis group ( admin was made part of redis group by default ) Check if the user is with sudo permissions then use the redis unix socket, else fallback to tcp socket.
abdosi
added a commit
to abdosi/sonic-py-swsssdk
that referenced
this pull request
Apr 1, 2022
…s unix socket is given to the redis group members. Many of sonic-util commands (especially in multi-asic) case use redis unix socket to connect to DB and thus those comamnd fails without providing sudo. This PR is continuation of PR: sonic-net/sonic-buildimage#7002 where we default to use TCP for Redis if user is not root Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
abdosi
added a commit
to sonic-net/sonic-py-swsssdk
that referenced
this pull request
Apr 1, 2022
What I did: Changes to Use Redis Unix Socket if the user is root else default to TCP Why I did: With the changes in PR:sonic-net/sonic-buildimage#5289 access to redis unix socket is given to the redis group members or to the root. Many of sonic-util commands (especially in multi-asic) case use redis unix socket to connect to DB and thus those comamnd fails without providing sudo. This PR is continuation of PR: sonic-net/sonic-buildimage#7002 where we default to use TCP for Redis if user is not root in sonic-cfggen. This should fix: sonic-net/sonic-buildimage#8501
abdosi
added a commit
to sonic-net/sonic-py-swsssdk
that referenced
this pull request
Apr 1, 2022
…s unix socket is given to the redis group members. Many of sonic-util commands (especially in multi-asic) case use redis unix socket to connect to DB and thus those comamnd fails without providing sudo. This PR is continuation of PR: sonic-net/sonic-buildimage#7002 where we default to use TCP for Redis if user is not root Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
abdosi
added a commit
that referenced
this pull request
Apr 1, 2022
9ce4d19d5a199cffe2933d80e343a80ded398b4a (HEAD -> 201911, origin/201911) With the changes in PR:#5289 access to redis unix socket is given to the redis group members. Many of sonic-util commands (especially in multi-asic) case use redis unix socket to connect to DB and thus those comamnd fails without providing sudo. This PR is continuation of PR: #7002 where we default to use TCP for Redis if user is not root Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
abdosi
added a commit
to abdosi/sonic-buildimage
that referenced
this pull request
Apr 1, 2022
78f167e4728f939712b3f3ea550949e2ea675fec With the changes in PR:sonic-net#5289 access to redis unix socket is given to the redis group members. Many of sonic-util commands (especially in multi-asic) case use redis unix socket to connect to DB and thus those comamnd fails without providing sudo. This PR is continuation of PR: sonic-net#7002 where we default to use TCP for Redis if user is not root Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
abdosi
added a commit
that referenced
this pull request
Apr 2, 2022
*[Submodule update] sonic-py-swssdk 78f167e4728f939712b3f3ea550949e2ea675fec With the changes in PR:#5289 access to redis unix socket is given to the redis group members. Many of sonic-util commands (especially in multi-asic) case use redis unix socket to connect to DB and thus those comamnd fails without providing sudo. This PR is continuation of PR: #7002 where we default to use TCP for Redis if user is not root Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why I did it
Closes issue #6982.
The issue was root caused as we were using the unix_socket for reading from DB as a default mechanism (#5250). The redis unix socket is created as follows.
So it used to work fine for the user "root" or if user is part of redis group ( admin was made part of redis group by default )
How I did it
Check if the user is with sudo permissions then use the redis unix socket, else fallback to tcp socket.
How to verify it
Checked "show running all" command from a user which is not part of redis group.
Which release branch to backport (provide reason below if selected)
Description for the changelog
A picture of a cute animal (not mandatory but encouraged)