consolidate BINPRM_FLAGS_ENFORCE_NONDUMP handling
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 19 Jun 2011 16:49:47 +0000 (12:49 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 20 Jul 2011 05:43:10 +0000 (01:43 -0400)
commit1b5d783c94c328d406e801566f161adcfb018dda
treee7d27b987e0670099af28db0d6bfcdac33236046
parent78f32a9b479e9b9f1ce2bf620a7602c1cdbc4c8e
consolidate BINPRM_FLAGS_ENFORCE_NONDUMP handling

new helper: would_dump(bprm, file).  Checks if we are allowed to
read the file and if we are not - sets ENFORCE_NODUMP.  Exported,
used in places that previously open-coded the same logics.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/binfmt_elf.c
fs/binfmt_elf_fdpic.c
fs/binfmt_misc.c
fs/exec.c
include/linux/binfmts.h