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

Commit

Permalink
Fix set permission on unix socket.
Browse files Browse the repository at this point in the history
It was trying to set the permissions on the unix socket before creating it.
  • Loading branch information
jjnicola committed Oct 16, 2019
1 parent 6de3f72 commit bf53067
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [20.4] (unreleased)

## [2.0.0] (unreleased)
## [2.0.1] (unreleased)

### Fixed
- Fix set permission in unix socket. [#157](https://github.com/greenbone/ospd/pull/157)

[2.0.1]: https://github.com/greenbone/ospd/compare/v2.0.0...ospd-2.0

## [2.0.0] (2019-10-11)

### Added
- Add OSP command get_vts and the vts dictionary. [#12](https://github.com/greenbone/ospd/pull/12) [#60](https://github.com/greenbone/ospd/pull/60) [#72](https://github.com/greenbone/ospd/pull/72) [#73](https://github.com/greenbone/ospd/pull/73) [#93](https://github.com/greenbone/ospd/pull/93)
Expand Down
6 changes: 3 additions & 3 deletions ospd/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,6 @@ def start(self, stream_callback: StreamCallbackType):
self._cleanup_socket()
self._create_parent_dirs()

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

try:
self.stream_callback = stream_callback
self.server = ThreadedUnixSocketServer(self, str(self.socket_path))
Expand All @@ -217,6 +214,9 @@ def start(self, stream_callback: StreamCallbackType):
)
)

if self.socket_path.exists():
self.socket_path.chmod(self.socket_mode)

def close(self):
super().close()
self._cleanup_socket()
Expand Down

0 comments on commit bf53067

Please sign in to comment.