Skip to content

safeio.py creates files with wrong permissions #7915

@DavidePrincipi

Description

@DavidePrincipi

The safeio.py library appeared in core 3.18 and is now used to write the environment files. New installations of app and core have an unexpected strict permission set, 0600. While this does not represent an issue now, it may become a dangerous side effect.

Steps to reproduce

  • Call agent.safeio.safe_open with a path to an existing file with permissive mode (e.g. 0644)
  • Write some data
  • Commit and check the permissions

Expected behavior

File permissions should be preserved or reflect the default open() behavior

Actual behavior

File is created with mode 0600, not preserving previous mode and not honoring umask

Components

ns8-core 3.18.0, agent.safeio.py

See also

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions