Skip to content

Commit

Permalink
Merge pull request greenbone#158 from jjnicola/chmod
Browse files Browse the repository at this point in the history
Fix set permission on unix socket.
  • Loading branch information
bjoernricks authored Oct 16, 2019
2 parents 6de3f72 + bf53067 commit b4c10f1
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 b4c10f1

Please sign in to comment.