keepalived-sync: fix mkdir permission denied in rsync.sh#28608
Open
willjayyyy wants to merge 1 commit intoopenwrt:openwrt-24.10from
Open
keepalived-sync: fix mkdir permission denied in rsync.sh#28608willjayyyy wants to merge 1 commit intoopenwrt:openwrt-24.10from
willjayyyy wants to merge 1 commit intoopenwrt:openwrt-24.10from
Conversation
8b5ac25 to
0a6fa13
Compare
Member
|
Please bump the PKG_RELEASE in the same commit by one. |
0a6fa13 to
00681eb
Compare
The rsync.sh script uses sudo for rsync but not for mkdir. After the first sync, rsync -a preserves root ownership on directories under the sync target. Subsequent syncs fail at the mkdir step because the keepalived user cannot create subdirectories inside root-owned directories. Add sudo to the mkdir command to match the existing sudo rsync usage. Also update the sudoers configuration in the postinst script to permit /bin/mkdir in addition to /usr/bin/rsync. Fixes: openwrt#28565 Signed-off-by: willjay <723386252@qq.com>
00681eb to
8438644
Compare
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.
Summary
sudoformkdirinrsync.shto match the existingsudo rsyncbehavior, falling back to plainmkdirwhensudois not available/bin/mkdirin addition to/usr/bin/rsyncProblem
After the first successful sync,
rsync -a(running viasudo rsync) preserves root ownership on synced directories. Subsequent syncs fail at themkdirstep because thekeepaliveduser cannot create subdirectories inside root-owned directories:Root Cause
rsync.shuses--rsync-path="sudo rsync"for the rsync commands (lines 67, 83) but runsmkdirwithoutsudo(line 59). This inconsistency causesmkdirto fail when directories are owned by root.Test Plan
Fixes: #28565