mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 00:37:00 +08:00
simplified call to expire cookies
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
#include <gdbm.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <vpn.h>
|
||||
#include <main.h>
|
||||
#include <cookies.h>
|
||||
|
||||
/* All the functions return zero on success and a negative value on error */
|
||||
@@ -104,7 +104,7 @@ finish:
|
||||
return ret;
|
||||
}
|
||||
|
||||
void expire_cookies(const struct cfg_st *cfg)
|
||||
void expire_cookies(main_server_st* s)
|
||||
{
|
||||
GDBM_FILE dbf;
|
||||
datum key;
|
||||
@@ -113,7 +113,7 @@ int deleted = 0;
|
||||
struct stored_cookie_st sc;
|
||||
time_t now = time(0);
|
||||
|
||||
dbf = gdbm_open((char*)cfg->cookie_db, 0, GDBM_WRITER, 0, NULL);
|
||||
dbf = gdbm_open((char*)s->config->cookie_db, 0, GDBM_WRITER, 0, NULL);
|
||||
if (dbf == NULL)
|
||||
return;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef COOKIES_H
|
||||
#define COOKIES_H
|
||||
|
||||
#include <vpn.h>
|
||||
#include <main.h>
|
||||
|
||||
struct __attribute__ ((__packed__)) stored_cookie_st {
|
||||
char username[MAX_USERNAME_SIZE];
|
||||
@@ -11,7 +11,7 @@ struct __attribute__ ((__packed__)) stored_cookie_st {
|
||||
|
||||
int store_cookie(const struct cfg_st *, const void* cookie, unsigned cookie_size,
|
||||
const struct stored_cookie_st* sc);
|
||||
void expire_cookies(const struct cfg_st *cfg);
|
||||
void expire_cookies(main_server_st* s);
|
||||
|
||||
int retrieve_cookie(const struct cfg_st *, const void* cookie, unsigned cookie_size,
|
||||
struct stored_cookie_st* sc);
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include <unistd.h>
|
||||
#include <net/if.h>
|
||||
#include <vpn.h>
|
||||
#include <cookies.h>
|
||||
#include <tlslib.h>
|
||||
|
||||
typedef enum {
|
||||
|
||||
@@ -600,7 +600,7 @@ fork_failed:
|
||||
syslog(LOG_INFO, "Performing maintainance");
|
||||
clear_lists(&s);
|
||||
|
||||
expire_cookies(&config);
|
||||
expire_cookies(&s);
|
||||
expire_tls_sessions(&s);
|
||||
|
||||
exit(0);
|
||||
|
||||
Reference in New Issue
Block a user