From: NIIBE Yutaka Date: Mon, 24 Apr 2017 22:48:51 +0000 (+0900) Subject: g10: invalidate the fd cache for keyring. X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=c91c51d825695b956afb1c213506cfd63f9f23dc;p=gnupg2.git g10: invalidate the fd cache for keyring. * g10/keyring.c (keyring_search_reset): Don't keep the FD cache. -- GnuPG-bug-id: 3096 Fixes-commit: 5556eca5acd46983bff0b38a1ffbc2f07fbaba9f Signed-off-by: NIIBE Yutaka (cherry picked from commit 116cfd60779fbb3540da629db54dc2e148f4a3a2) Gbp-Pq: Name 0074-g10-invalidate-the-fd-cache-for-keyring.patch --- diff --git a/g10/keyring.c b/g10/keyring.c index 328290e..d75fdbc 100644 --- a/g10/keyring.c +++ b/g10/keyring.c @@ -692,7 +692,6 @@ keyring_search_reset (KEYRING_HANDLE hd) { log_assert (hd); - hd->current.kr = NULL; iobuf_close (hd->current.iobuf); hd->current.iobuf = NULL; hd->current.eof = 0; @@ -700,6 +699,12 @@ keyring_search_reset (KEYRING_HANDLE hd) hd->found.kr = NULL; hd->found.offset = 0; + + if (hd->current.kr) + iobuf_ioctl (NULL, IOBUF_IOCTL_INVALIDATE_CACHE, 0, + (char*)hd->current.kr->fname); + hd->current.kr = NULL; + return 0; }