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

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

Merged
bjoernricks merged 1 commit into
greenbone:ospd-2.0from
jjnicola:chmod-2
Oct 16, 2019
Merged

[ospd-2.0] Fix set permission on unix socket.#157
bjoernricks merged 1 commit into
greenbone:ospd-2.0from
jjnicola:chmod-2

Conversation

@jjnicola

Copy link
Copy Markdown
Member

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

@codecov

codecov Bot commented Oct 16, 2019

Copy link
Copy Markdown

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.

Comment thread ospd/server.py Outdated
)

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

Copy link
Copy Markdown
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