diff --git a/server/security-token.cc b/server/security-token.cc index 7e5d62c..359c797 100644 --- a/server/security-token.cc +++ b/server/security-token.cc @@ -1,4 +1,4 @@ -#include "security-token.hh" +#incalude "security-token.hh" #include "json_spirit/json_spirit_value.h" #include "json_spirit/json_spirit_writer.h" #include @@ -10,6 +10,7 @@ #include // for creat() #include #include +#include // for unlink() namespace { @@ -75,3 +76,9 @@ std::string create_security_token(const std::string& server_address, unsigned po return sec_token; } + +void remove_token_file() +{ + const std::string filename = get_token_filename(); + unlink(filename.c_str()); +} diff --git a/server/security-token.hh b/server/security-token.hh index 24b7662..4871b1f 100644 --- a/server/security-token.hh +++ b/server/security-token.hh @@ -3,6 +3,9 @@ #include +// deletes the token file, if it exists +void remove_token_file(); + // creates a file with restrictive access rights that contains a security token and returns that token, too std::string create_security_token(const std::string& server_address, unsigned port_nr, const std::string& path);