and add prereq targets, so some header files are generated by BUILDUSER
during 'make prereq' instead of by root during 'make includes'.
Switch the order of 'make cleandir' and 'make includes' during 'make build'
so we don't generate many files twice.
Except for some machine@ symlinks from ${MACHINE}/stand, /usr/obj is now
clean from files generated by root during 'make build'. Those will be
cleaned up in a second step.
help, testing & ok deraadt, input from natano, further testing rpe
others.
C11 6.5.6.9 says:
When two pointers are subtracted, both shall point to elements of the
same array object, or one past the last element of the array object; the
result is the difference of the subscripts of the two array elements.
In these cases the objects are arrays of char so the result is defined,
and we believe that the report is based on a compiler incorrectly trapping
on defined behaviour.
error cases for -1 and 0 explicitly (it initially only checked for -1,
I updated it to also check for 0, and rzalamena@ figured out that 0
has to be checked in a differently).
OK millert@ rzalamena@
- If you start make build as root, everything will be run as root.
Nothing new here. New is, that you can set BUILDUSER=somebody and the
unprived parts will be run as somebody.
- If you start make build with sudo, the unprived parts will be run as
the real user (meaning YOU). You can still set BUILDUSER=somebody and
the uprived parts will run as somebody.
- If you start make build as a normal user it will error out. "I'm sorry
Dave."
Note that DESTDIR must be on partition with the noperm flag set for make
release to work correctly as an unprivileged user.
idea and ok deraadt
input and ok tb ratchov millert
rpe, halex and probably others where part of the conversation to make
this happen, thanks!
case the dup2() would fail silently and the descriptor would remain with
the CLOEXEC flag causing the exec*()d child process to have unexpected
behavior.
ok guenther@
OK natano on a previous diff which used a different uid/gid.
naddy@ pointed out that uid/gid was already taken on "important" systems.
Turns out we cannot easily recycle freed up uids/gids so settle on 51.