Skip to content

backup: store directories if not root/root 0755#297

Open
mglae wants to merge 1 commit into
LibreELEC:masterfrom
mglae:le11_backup_dirs
Open

backup: store directories if not root/root 0755#297
mglae wants to merge 1 commit into
LibreELEC:masterfrom
mglae:le11_backup_dirs

Conversation

@mglae

@mglae mglae commented May 10, 2023

Copy link
Copy Markdown
Contributor

The LE backup code assume that all directories are of root/root 0755.

This was correct in the past but at least since using docker overlays directories may be restored with wrong modes or owners.

Add code to store directories with different modes or owners in the backup.

@antonlacon

Copy link
Copy Markdown
Contributor

I'm not familiar with docker or docker overlays. My understanding is the change adds the given item to the backup tarball if it's one of: not a directory with 755 permissions, not owned by root, or not in root's group. I don't understand why the current code is failing to have the correct mode or owner or how this resolves it.

Shouldn't the test for dir+permissions and root/root be part of the if/elif's starting at line 633 using itempaths a few lines below?

@mglae

mglae commented May 16, 2023

Copy link
Copy Markdown
Contributor Author

I don't understand why the current code is failing to have the correct mode or owner or how this resolves it.

Currently directories are only stored into backup if they are leaves without any files. Implicit directories (occurring first in path of files) are automatically created root/root 0755.

Only other directories have to be stored into backup.

Shouldn't the test for dir+permissions and root/root be part of the if/elif's starting at line 633 using itempaths a few lines below?

Then root backup directories with unusual modes like /storage/.ssh are not stored.

Side note: /storage/.ssh is not an issue in practice because mode is fixed via tmpfiles,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants