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

Commit

Permalink
Merge pull request #157 from jjnicola/chmod-2
Browse files Browse the repository at this point in the history
[ospd-2.0] Fix set permission on unix socket.
  • Loading branch information
bjoernricks committed Oct 16, 2019
2 parents f73a25e + 8f359bb commit c1c2780
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [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
Expand Down
6 changes: 3 additions & 3 deletions ospd/server.py
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 c1c2780

Please sign in to comment.