From c46e1f849c2b2029e30dcbeffa853924bc26af6e Mon Sep 17 00:00:00 2001 From: Nelson Ferreira Date: Wed, 22 Feb 2012 18:29:43 -0500 Subject: [PATCH] Coverity: TOCTOU: CID 390 * lib-src/movemail.c (main): No need to check access to outname, since open will fail and we are not giving any better diagnosis. * lib-src/movemail.c (main): Ditto for inname. Signed-off-by: Nelson Ferreira --- lib-src/movemail.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib-src/movemail.c b/lib-src/movemail.c index 89760f8..ba22f92 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c @@ -315,11 +315,6 @@ int main(int argc, char *argv[]) if (*outname == 0) fatal("Destination file name is empty", 0); - VERBOSE(("checking access to output file\n")); - /* Check access to output file. */ - if (access(outname, F_OK) == 0 && access(outname, W_OK) != 0) - pfatal_with_name(outname); - /* Also check that outname's directory is writable to the real uid. */ { char *buf = (char *)xmalloc(strlen(outname) + 1); @@ -345,9 +340,6 @@ int main(int argc, char *argv[]) #ifndef DISABLE_DIRECT_ACCESS - /* Check access to input file. */ - if (access(inname, R_OK | W_OK) != 0) - pfatal_with_name(inname); if (fork() == 0) { setuid(getuid()); -- 2.34.1