file(GENERATE): Use permissions of input file if present.
Merge topic 'file-GENERATE-permissions' into next

df15f0f6 file(GENERATE): Use permissions of input file if present.