build.sh: arbitrary write permissions on built files?

Frédéric Fauberteau <[email protected]> Fri, 11 Oct 2019 09:08:02 +0200
Newsgroups gmane.os.netbsd.devel.installation
Organization The NetBSD Foundation
Message-ID <[email protected]>
I used build.sh for building NetBSD-9.0_BETA/amd64 sets and it is a 
awesome tool! When I tried to upgrade a machine using sysupgrade, I 
realized that I forgot the x{base,comp,...} sets. It is when I reupload 
the newly built release I realized that some files had read-only 
permissions (because permission denied during scp). On the system where 
I built the release, I get:
$ ls -l amd64/binary/kernel/
total 42324
-rw-r--r-- 1 triaxx users      508 10 oct.  23:21 MD5
-r--r--r-- 1 triaxx users 10109837 10 oct.  23:11 netbsd-GENERIC.gz
-rw-r--r-- 1 triaxx users 11032849 10 oct.  23:09 
netbsd-GENERIC_KASLR.gz
-r--r--r-- 1 triaxx users   466462 10 oct.  23:11 
netbsd-GENERIC.symbols.gz
-r--r--r-- 1 triaxx users  8389793 10 oct.  23:11 netbsd-INSTALL.gz
-r--r--r-- 1 triaxx users   355315 10 oct.  23:11 
netbsd-INSTALL.symbols.gz
-r--r--r-- 1 triaxx users  4053828 10 oct.  23:11 
netbsd-INSTALL_XEN3_DOMU.gz
-rw-r--r-- 1 triaxx users  6190691 10 oct.  23:10 netbsd-XEN3_DOM0.gz
-rw-r--r-- 1 triaxx users  2715825 10 oct.  23:10 netbsd-XEN3_DOMU.gz
-rw-r--r-- 1 triaxx users     1300 10 oct.  23:21 SHA512

Some kernel archives are 444, some others are 644... But I don't know 
why.

It does not seem to be a local issue since I observe a similar result on 
ftp.netbsd.org:
$ ls -l /ftp/pub/NetBSD/NetBSD-8.1/amd64/binary/kernel/
total 55440
-rw-r--r--  1 builds  builds      443 May 31 13:10 MD5
-rw-r--r--  1 builds  builds     1136 May 31 13:10 SHA512
-r--r--r--  1 builds  builds  8190911 May 31 13:02 netbsd-GENERIC.gz
-r--r--r--  1 builds  builds   425991 May 31 13:02 
netbsd-GENERIC.symbols.gz
-r--r--r--  1 builds  builds  7120360 May 31 13:02 netbsd-INSTALL.gz
-r--r--r--  1 builds  builds   341814 May 31 13:02 
netbsd-INSTALL.symbols.gz
-r--r--r--  1 builds  builds  3659891 May 31 13:02 
netbsd-INSTALL_XEN3_DOMU.gz
-rw-r--r--  1 builds  builds  5830389 May 31 13:01 netbsd-XEN3_DOM0.gz
-rw-r--r--  1 builds  builds  2415990 May 31 13:01 netbsd-XEN3_DOMU.gz

Is there a reason to this behavior? Could we easily fix that?

Fred