Skip to content

fix(snapshot): create the restored etcd data directory with 0700 - #4275

Merged
cbalan merged 3 commits into
loft-sh:mainfrom
blacksoxx:restore-datadir-private
Nov 19, 2026
Merged

cbalan merged 3 commits into
loft-sh:mainfrom
blacksoxx:restore-datadir-private

Conversation

@blacksoxx

@blacksoxx blacksoxx commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

What issue type does this pull request address?
/kind bugfix

What does this pull request do? Which issues does it resolve?
resolves #4274

The restore path recreated the embedded etcd data directory with mode 0777. It is now created with 0700, the mode etcd uses and checks for its data directory. Unit test added for backupFolder.

Please provide a short message that should be published in the vcluster release notes
Fixed the restore command creating the embedded etcd data directory world accessible.


Note

Low Risk
Narrow permissions fix on restore directory creation with regression test coverage; no auth or data-handling logic changes.

Overview
The snapshot restore path in backupFolder now recreates the embedded etcd data directory with mode 0700 instead of 0777, matching what etcd expects so restores no longer leave the data dir world-readable/writable.

A unit test TestBackupFolderRecreatesPrivateDir asserts the recreated directory permissions and that the prior tree is kept under dir.backup.

Reviewed by Cursor Bugbot for commit a15ee9e. Bugbot is set up for automated code reviews on this repo. Configure here.

The restore path moved the embedded etcd data directory aside and recreated it with 0777. etcd creates and checks its data directory with 0700, and the directory holds the restored database with every Secret of the virtual cluster. Unit test added for backupFolder.

Signed-off-by: Youssef Omar Bouden <youssef.bouden2002@gmail.com>
r0bnet
r0bnet previously approved these changes Nov 18, 2026
@cbalan
cbalan merged commit e8a22cc into loft-sh:main Nov 19, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restore recreates the embedded etcd data directory world accessible

3 participants