> Date: Tue, 30 Aug 2022 08:38:02 +0700 > From: Robert Elz <k...@munnari.oz.au> > > Date: Tue, 30 Aug 2022 02:27:33 +0300 > From: Valery Ushakov <u...@stderr.spb.ru> > Message-ID: <yw1lzafmjkavh...@pony.stderr.spb.ru> > > | Is there any particular reason why /root/.profile and /root/.cshrc > | (that have hard links in / too, for the single user mode i guess) are > | not writable? > > Aside from applications like vi rm mv etc (probably more) which require > a slight bit more effort if the file has no write permission, what > difference does the user 'w' (or 'r' ... 'x' does matter) permission > bit really make on a root owned file? > > I assume you aren't talking about group/other 'w' permission, > which might be fine for you to grant on your own system, but > certainly not to ship with NetBSD.
The default umask is 022. The files are meant to be sourced, not executed, so it makes sense to clear the x bits. Other than that, clearing any other bits needs justification. These files are (privileged) user-editable configuration files from the etc set which is always presumed to need local changes merged on update. In contrast, say, /bin/sh is from base and potentially subject to automatic update without the presumption of need for merging local changes.