]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC bspatch Capsicumization and improvements
authoremaste <emaste@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 22 Sep 2016 21:16:54 +0000 (21:16 +0000)
committeremaste <emaste@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 22 Sep 2016 21:16:54 +0000 (21:16 +0000)
commitd5cc33f36e76458d461df65be12b2f9f6d7ade48
tree21b6fa7ae9972058b5ef49e50250d22789bd8df0
parent868251cd2ca582fe5a0a8d8252dacab9af8e79cd
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/10@306215 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
usr.bin/bsdiff/bspatch/bspatch.c