]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
MFC bspatch Capsicumization and improvements
authoremaste <emaste@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 23 Sep 2016 01:52:06 +0000 (01:52 +0000)
committeremaste <emaste@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 23 Sep 2016 01:52:06 +0000 (01:52 +0000)
commitafc21aa713afc03a6cf9f3dbbf760d02cd343768
treec6ff4dc94aa740593f25944dff93408bcd60cd34
parent046b7bd43feb34ce7eaf5b01f54c700869edb89d
MFC bspatch Capsicumization and improvements

r304691: bspatch: apply style(9)

Make style changes (and trivial refactoring of open calls) now in order
to reduce noise in diffs for future capsicum changes.

r304807 (allanjude): Capsicumize bspatch

Move all of the fopen() and open() calls to the top of main()

Restrict each FD to least privilege (read/seek only, write only, etc)

cap_enter(), and make all except the output FD read/seek only.

r304821: bspatch: remove output file in the case of error

r305486: bspatch: add sanity checks on sizes to avoid integer overflow

Note that this introduces an explicit 2GB limit, but this was already
implicit in variable and function argument types.

This is based on the "non-cryptanalytic attacks against freebsd
update components" anonymous gist. Further refinement is planned.

r305737: bspatch: remove superfluous newlines from errx strings

r305822: bspatch: use #define for header size instead of magic number

r306026: bspatch: Remove backwards-compatibility sys/capability.h support

bspatch previously included sys/capability.h or sys/capsicum.h based
on __FreeBSD_version, as FreeBSD is the upstream for bsdiff and we may
see this file incorporated into other third-party software.

The Capsicum header is now installed as sys/capsicum.h in stable/10 and
FreeBSD 10.3, so we can just use sys/capsicum.h and simplify the logic.

git-svn-id: svn://svn.freebsd.org/base/stable/9@306222 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
usr.bin/bsdiff/bspatch/bspatch.c