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 f73a25e commit 8f359bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
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
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 8f359bb

Please sign in to comment.