use rsync's --chmod instead of "find [...] -exec chmod [...]" in mirror-2stage.sh

Bug #1899385 reported by Paul Collins
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Mirror Charm
New
Undecided
Unassigned

Bug Description

mirror-2stage.sh does post-sync fixups as follows:

files/mirror-2stage.sh:find ${DEST_DIR} -type d ! -perm /o=r,o=x -ls -exec chmod go+rx '{}' +
files/mirror-2stage.sh:find ${DEST_DIR} -type f ! -perm /o=r -ls -exec chmod go+r '{}' +

First of all, this is racy.

Second of all, it's not clear where this came from and if it's still needed.

Third of all, rsync's --chmod option can be used to alter its
view of the source's permissions such that we can use it to
replace the find commands above.

Let us do so.

Revision history for this message
Paul Collins (pjdc) wrote :

h/t ballot for pointing out this flag's existence

Revision history for this message
Paul Collins (pjdc) wrote :

I just added the existing logic to mirror-1stage.sh, so be sure to update that as well.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.