From 7f005291e672a80f11c14a4914135db55334a3dc Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Wed, 28 Jan 2015 13:35:14 +0100 Subject: eurephiadm: Don't try to remove session file if it doesn't exist Signed-off-by: David Sommerseth (cherry picked from commit 7d3f9f1a97d5aeb3fbdb152f4ef070539a637adc) --- eurephiadm/client_session.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eurephiadm/client_session.c b/eurephiadm/client_session.c index bd4102a..05a4fe9 100644 --- a/eurephiadm/client_session.c +++ b/eurephiadm/client_session.c @@ -1,7 +1,7 @@ /* client_session.c -- Handles eurephia session in admin clients * - * GPLv2 only - Copyright (C) 2008 - 2012 - * David Sommerseth + * GPLv2 only - Copyright (C) 2008 - 2015 + * David Sommerseth * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -21,7 +21,7 @@ /** * @file client_session.c - * @author David Sommerseth + * @author David Sommerseth * @date 2008-12-01 * * @brief Functions for working on eurephiaSESSIONs outside the openvpn plug-in @@ -139,7 +139,7 @@ void remove_session_file(eurephiaCTX *ctx) { fname = get_session_file(); assert(fname != NULL); - if( unlink(fname) == -1) { + if( (access(fname, F_OK) != -1) && (unlink(fname) == -1) ) { eurephia_log(ctx, LOG_ERROR, 0, "Could not remove session file (%s). Following operations might fail", fname); }; -- cgit