From 0ac8030da1523190a39de61b865c7e075f80ec50 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Sat, 25 Jan 2020 10:58:22 +0000 Subject: isc_file_isdirwritable is not used (and besides, it uses access() which hints all possible uses are TOCTOU) --- usr.sbin/bind/lib/isc/include/isc/file.h | 8 +------- usr.sbin/bind/lib/isc/unix/file.c | 7 +------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/usr.sbin/bind/lib/isc/include/isc/file.h b/usr.sbin/bind/lib/isc/include/isc/file.h index f1ca8f32f95..d523564f5d6 100644 --- a/usr.sbin/bind/lib/isc/include/isc/file.h +++ b/usr.sbin/bind/lib/isc/include/isc/file.h @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: file.h,v 1.4 2020/01/20 18:51:53 florian Exp $ */ +/* $Id: file.h,v 1.5 2020/01/25 10:58:21 deraadt Exp $ */ #ifndef ISC_FILE_H #define ISC_FILE_H 1 @@ -363,12 +363,6 @@ isc_file_munmap(void *addr, size_t len); * this platform, then we simply free the memory. */ -isc_boolean_t -isc_file_isdirwritable(const char *path); -/*%< - * Return true if the path is a directory and is writable - */ - ISC_LANG_ENDDECLS #endif /* ISC_FILE_H */ diff --git a/usr.sbin/bind/lib/isc/unix/file.c b/usr.sbin/bind/lib/isc/unix/file.c index b6ff1c7556e..f6be77670dc 100644 --- a/usr.sbin/bind/lib/isc/unix/file.c +++ b/usr.sbin/bind/lib/isc/unix/file.c @@ -43,7 +43,7 @@ * SUCH DAMAGE. */ -/* $Id: file.c,v 1.14 2020/01/22 13:02:10 florian Exp $ */ +/* $Id: file.c,v 1.15 2020/01/25 10:58:21 deraadt Exp $ */ /*! \file */ @@ -659,8 +659,3 @@ int isc_file_munmap(void *addr, size_t len) { return (munmap(addr, len)); } - -isc_boolean_t -isc_file_isdirwritable(const char *path) { - return (ISC_TF(access(path, W_OK|X_OK) == 0)); -} -- cgit v1.2.3