summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@eurephia.org>2015-01-28 13:35:14 +0100
committerDavid Sommerseth <dazo@eurephia.org>2015-01-28 13:38:41 +0100
commit7f005291e672a80f11c14a4914135db55334a3dc (patch)
treeb8550d88d6e0c1dc3c820c9e920d3cd9c148b641
parente869f5257bf9cfb1b6a7fdc84aeebada88f39854 (diff)
downloadeurephia-release/1.1.tar.gz
eurephia-release/1.1.tar.xz
eurephia-release/1.1.zip
eurephiadm: Don't try to remove session file if it doesn't existrelease/1.1
Signed-off-by: David Sommerseth <dazo@eurephia.org> (cherry picked from commit 7d3f9f1a97d5aeb3fbdb152f4ef070539a637adc)
-rw-r--r--eurephiadm/client_session.c8
1 files 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 <dazo@users.sourceforge.net>
+ * GPLv2 only - Copyright (C) 2008 - 2015
+ * David Sommerseth <dazo@eurephia.org>
*
* 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 <dazo@users.sourceforge.net>
+ * @author David Sommerseth <dazo@eurephia.org>
* @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);
};