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:35:14 +0100
commit7d3f9f1a97d5aeb3fbdb152f4ef070539a637adc (patch)
tree5c18aad921f397acc0b5e7c5245db681f3a3fd6c
parentc360f10f67c3eba0bdab606fd20f35360bcce729 (diff)
downloadeurephia-7d3f9f1a97d5aeb3fbdb152f4ef070539a637adc.tar.gz
eurephia-7d3f9f1a97d5aeb3fbdb152f4ef070539a637adc.tar.xz
eurephia-7d3f9f1a97d5aeb3fbdb152f4ef070539a637adc.zip
eurephiadm: Don't try to remove session file if it doesn't exist
Signed-off-by: David Sommerseth <dazo@eurephia.org>
-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);
};