Repository navigation
Conversation
An image pushed by a satellite brings its .macct, the Samba machine account secrets (unicodePwd, supplementalCredentials) of the client it was taken from. receive_upload_chunk() created it with the umask default, 0644, and finalize_upload() kept that mode through shutil.move() and shutil.copy2(). The [linbo] rsync module serves the whole LINBO directory without login, as nobody, so anyone reaching rsync could download it, from the image directory, its backup or .incoming while the upload was staged. Create a staged .macct 0600, with the mode given to open() so it is never readable in between, and set it again on a resumed chunk. Copy it into a file opened 0600 instead of using copy2(), which writes the copy with the umask default first: for the backup, and for a move that has to copy because .incoming and the image directory lie on different filesystems. Close a staged .macct before moving it, and every .macct of the image directory after. Keep .incoming and its image subdirectory 0700. Running as root, all of these become root:root, as linuxmuster-linbo7 does in rsync-post-upload.sh and linbo-torrent. Other image files keep their mode.
kiarn
added a commit
that referenced
this pull request
Oct 10, 2026
Member
|
Thank you ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An image pushed by a satellite through
receive_upload_chunk()/finalize_upload()brings its.macct, the Samba machine account secrets (unicodePwd,supplementalCredentials) of the client it was taken from. It was created with the umask default (0644) and kept that mode when moved into place and when backed up. The[linbo]rsync module serves all of/srv/linbowithout login, so the file could be downloaded from the image directory, its backup, or.incomingwhile the upload was staged. Native LINBO keeps it root:root 0600 (rsync-post-upload.sh,linbo-torrent).Changes in
linbo/image_sync.py:.macctis created 0600 directly byopen(), and set to 0600 again when a chunk resumes it.incomingand its image subdirectory are kept 0700.macctis copied into a file opened 0600 instead of withcopy2(), both for the backup and when the move has to copy across filesystems.macctis restricted before it is moved, and every.macctin the image directory afterFiles already on disk are not changed by this. To fix them:
linbo-torrent'supdate_permissions()runschown -R nobody:nogroupover the images tree and gives onlyimages/*/*.macctback to root, so a.macctin a backup directory or in.incomingbecomes readable to the rsync module again after it runs. That part is fixed in linuxmuster/linuxmuster-linbo7#182, which also leaves.incomingto the image sync.Tests:
linbo/pytests/test_image_sync_permissions.py(14 tests) checks modes and ownership for first and resumed chunks, the staging directories, finalize (same filesystem and across filesystems), the backup, and a.macctleft in place. It also checks that a new.macctis 0600 from the start, not narrowed afterwards. 13 of them fail against the currentimage_sync.py; the 14th checks that other image files keep their mode.