From 565ff71af87b24c5746017ee51858fd8649beef9 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Sat, 15 Mar 2014 17:29:56 +0100 Subject: unlink challenge file only on success --- udev/ykfde.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/udev/ykfde.c b/udev/ykfde.c index 1c45833..2077583 100644 --- a/udev/ykfde.c +++ b/udev/ykfde.c @@ -256,10 +256,11 @@ out30: free(challenge); out20: - /* close and unlink challenge file - * we can not try again later! */ + /* close the challenge file */ fclose(challengefile); - unlink(CHALLENGEFILE); + /* Unlink it if we were successful, we can not try again later! */ + if (ret == EXIT_SUCCESS) + unlink(CHALLENGEFILE); out10: return ret; -- cgit v1.2.3-70-g09d2