Skip to content
This repository has been archived by the owner on Nov 29, 2021. It is now read-only.

[ospd-2.0] Fix set permission on unix socket. #157

Merged
merged 1 commit into from
Oct 16, 2019

Conversation

jjnicola
Copy link
Member

It was trying to set the permissions on the unix socket before creating it.

@codecov
Copy link

codecov bot commented Oct 16, 2019

Codecov Report

Merging #157 into ospd-2.0 will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           ospd-2.0     #157   +/-   ##
=========================================
  Coverage     68.62%   68.62%           
=========================================
  Files            12       12           
  Lines          1756     1756           
=========================================
  Hits           1205     1205           
  Misses          551      551
Impacted Files Coverage Δ
ospd/server.py 31.61% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f73a25e...8f359bb. Read the comment docs.

ospd/server.py Outdated
@@ -217,6 +214,9 @@ def start(self, stream_callback: StreamCallbackType):
)
)

if self.socket_path.exists():
os.chmod(str(self.socket_path), self.socket_mode)
Copy link
Contributor

Choose a reason for hiding this comment

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

The Path class has chmod method https://docs.python.org/3/library/pathlib.html :-) Not sure why we didn't use that already

Suggested change
os.chmod(str(self.socket_path), self.socket_mode)
self.socket_path.chmod(self.socket_mode)

It was trying to set the permissions on the unix socket before creating it.
@bjoernricks bjoernricks merged commit c1c2780 into greenbone:ospd-2.0 Oct 16, 2019
@jjnicola jjnicola deleted the chmod-2 branch November 4, 2019 14:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants