Tested this patch by running several upgrades from different major versions and different setups.ACL, that are impossible to apply, are detected and reported, so it looks good for me.