mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-10-14 02:22:03 +08:00
removed server-name config option
This commit is contained in:
@@ -72,10 +72,6 @@ max-clients = 16
|
|||||||
# multiple times). Unset or set to zero for unlimited.
|
# multiple times). Unset or set to zero for unlimited.
|
||||||
max-same-clients = 2
|
max-same-clients = 2
|
||||||
|
|
||||||
# Used to identify this particular server. It is used as NAS identifier
|
|
||||||
# in radius, if the nas-identifier is not already set.
|
|
||||||
#server-name = ocserv@example.com
|
|
||||||
|
|
||||||
# Use listen-host to limit to specific IPs or to the IPs of a provided
|
# Use listen-host to limit to specific IPs or to the IPs of a provided
|
||||||
# hostname.
|
# hostname.
|
||||||
#listen-host = [IP|HOSTNAME]
|
#listen-host = [IP|HOSTNAME]
|
||||||
|
|||||||
+2
-5
@@ -40,7 +40,7 @@
|
|||||||
static rc_handle *rh = NULL;
|
static rc_handle *rh = NULL;
|
||||||
static char nas_identifier[64];
|
static char nas_identifier[64];
|
||||||
|
|
||||||
static void acct_radius_global_init(void *pool, const char *server_name, void *additional)
|
static void acct_radius_global_init(void *pool, void *additional)
|
||||||
{
|
{
|
||||||
radius_cfg_st *config = additional;
|
radius_cfg_st *config = additional;
|
||||||
|
|
||||||
@@ -54,10 +54,7 @@ static void acct_radius_global_init(void *pool, const char *server_name, void *a
|
|||||||
if (config->nas_identifier) {
|
if (config->nas_identifier) {
|
||||||
strlcpy(nas_identifier, config->nas_identifier, sizeof(nas_identifier));
|
strlcpy(nas_identifier, config->nas_identifier, sizeof(nas_identifier));
|
||||||
} else {
|
} else {
|
||||||
if (server_name)
|
nas_identifier[0] = 0;
|
||||||
strlcpy(nas_identifier, server_name, sizeof(nas_identifier));
|
|
||||||
else
|
|
||||||
nas_identifier[0] = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rc_read_dictionary(rh, rc_conf_str(rh, "dictionary")) != 0) {
|
if (rc_read_dictionary(rh, rc_conf_str(rh, "dictionary")) != 0) {
|
||||||
|
|||||||
+1
-1
@@ -83,7 +83,7 @@ const gss_OID_set_desc desired_mechs = {
|
|||||||
.elements = (gss_OID)&spnego_mech
|
.elements = (gss_OID)&spnego_mech
|
||||||
};
|
};
|
||||||
|
|
||||||
static void gssapi_global_init(void *pool, const char *server_name, void *additional)
|
static void gssapi_global_init(void *pool, void *additional)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
OM_uint32 time, minor;
|
OM_uint32 time, minor;
|
||||||
|
|||||||
+1
-1
@@ -49,7 +49,7 @@ struct plain_ctx_st {
|
|||||||
|
|
||||||
static char *password_file = NULL;
|
static char *password_file = NULL;
|
||||||
|
|
||||||
static void plain_global_init(void *pool, const char *server_name, void *additional)
|
static void plain_global_init(void *pool, void *additional)
|
||||||
{
|
{
|
||||||
struct plain_cfg_st *config = additional;
|
struct plain_cfg_st *config = additional;
|
||||||
|
|
||||||
|
|||||||
+2
-5
@@ -41,7 +41,7 @@
|
|||||||
static rc_handle *rh = NULL;
|
static rc_handle *rh = NULL;
|
||||||
static char nas_identifier[64];
|
static char nas_identifier[64];
|
||||||
|
|
||||||
static void radius_global_init(void *pool, const char *server_name, void *additional)
|
static void radius_global_init(void *pool, void *additional)
|
||||||
{
|
{
|
||||||
radius_cfg_st *config = additional;
|
radius_cfg_st *config = additional;
|
||||||
|
|
||||||
@@ -56,10 +56,7 @@ static void radius_global_init(void *pool, const char *server_name, void *additi
|
|||||||
if (config->nas_identifier) {
|
if (config->nas_identifier) {
|
||||||
strlcpy(nas_identifier, config->nas_identifier, sizeof(nas_identifier));
|
strlcpy(nas_identifier, config->nas_identifier, sizeof(nas_identifier));
|
||||||
} else {
|
} else {
|
||||||
if (server_name)
|
nas_identifier[0] = 0;
|
||||||
strlcpy(nas_identifier, server_name, sizeof(nas_identifier));
|
|
||||||
else
|
|
||||||
nas_identifier[0] = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rc_read_dictionary(rh, rc_conf_str(rh, "dictionary")) != 0) {
|
if (rc_read_dictionary(rh, rc_conf_str(rh, "dictionary")) != 0) {
|
||||||
|
|||||||
@@ -74,7 +74,6 @@ static struct cfg_options available_options[] = {
|
|||||||
{ .name = "custom-header", .type = OPTION_MULTI_LINE, .mandatory = 0 },
|
{ .name = "custom-header", .type = OPTION_MULTI_LINE, .mandatory = 0 },
|
||||||
{ .name = "split-dns", .type = OPTION_MULTI_LINE, .mandatory = 0 },
|
{ .name = "split-dns", .type = OPTION_MULTI_LINE, .mandatory = 0 },
|
||||||
{ .name = "acct", .type = OPTION_STRING, .mandatory = 0 },
|
{ .name = "acct", .type = OPTION_STRING, .mandatory = 0 },
|
||||||
{ .name = "server-name", .type = OPTION_STRING, .mandatory = 0 },
|
|
||||||
{ .name = "listen-host", .type = OPTION_STRING, .mandatory = 0 },
|
{ .name = "listen-host", .type = OPTION_STRING, .mandatory = 0 },
|
||||||
{ .name = "listen-host-is-dyndns", .type = OPTION_BOOLEAN, .mandatory = 0 },
|
{ .name = "listen-host-is-dyndns", .type = OPTION_BOOLEAN, .mandatory = 0 },
|
||||||
{ .name = "compression", .type = OPTION_BOOLEAN, .mandatory = 0 },
|
{ .name = "compression", .type = OPTION_BOOLEAN, .mandatory = 0 },
|
||||||
@@ -702,7 +701,6 @@ unsigned urlfw_size = 0;
|
|||||||
READ_STRING("user-profile", config->xml_config_file);
|
READ_STRING("user-profile", config->xml_config_file);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
READ_STRING("server-name", config->server_name);
|
|
||||||
READ_STRING("ca-cert", config->ca);
|
READ_STRING("ca-cert", config->ca);
|
||||||
READ_STRING("default-domain", config->default_domain);
|
READ_STRING("default-domain", config->default_domain);
|
||||||
READ_STRING("crl", config->crl);
|
READ_STRING("crl", config->crl);
|
||||||
@@ -1084,7 +1082,6 @@ unsigned i;
|
|||||||
DEL(config->banner);
|
DEL(config->banner);
|
||||||
DEL(config->dh_params_file);
|
DEL(config->dh_params_file);
|
||||||
DEL(config->listen_host);
|
DEL(config->listen_host);
|
||||||
DEL(config->server_name);
|
|
||||||
DEL(config->pin_file);
|
DEL(config->pin_file);
|
||||||
DEL(config->srk_pin_file);
|
DEL(config->srk_pin_file);
|
||||||
DEL(config->ca);
|
DEL(config->ca);
|
||||||
|
|||||||
@@ -147,10 +147,6 @@ max-clients = 16
|
|||||||
# multiple times). Unset or set to zero for unlimited.
|
# multiple times). Unset or set to zero for unlimited.
|
||||||
max-same-clients = 2
|
max-same-clients = 2
|
||||||
|
|
||||||
# Used to identify this particular server. It is used as NAS identifier
|
|
||||||
# in radius, if the nas-identifier is not already set.
|
|
||||||
#server-name = ocserv@example.com
|
|
||||||
|
|
||||||
# Use listen-host to limit to specific IPs or to the IPs of a provided
|
# Use listen-host to limit to specific IPs or to the IPs of a provided
|
||||||
# hostname.
|
# hostname.
|
||||||
#listen-host = [IP|HOSTNAME]
|
#listen-host = [IP|HOSTNAME]
|
||||||
|
|||||||
+1
-1
@@ -27,7 +27,7 @@
|
|||||||
typedef struct acct_mod_st {
|
typedef struct acct_mod_st {
|
||||||
unsigned int type; /* ACCT_TYPE_ */
|
unsigned int type; /* ACCT_TYPE_ */
|
||||||
unsigned int auth_types; /* or of the AUTH_TYPEs which are compatible with this */
|
unsigned int auth_types; /* or of the AUTH_TYPEs which are compatible with this */
|
||||||
void (*global_init)(void *pool, const char *server_name, void* additional);
|
void (*global_init)(void *pool, void* additional);
|
||||||
void (*global_deinit)(void);
|
void (*global_deinit)(void);
|
||||||
|
|
||||||
/* The context provided below is of the authentication method */
|
/* The context provided below is of the authentication method */
|
||||||
|
|||||||
+2
-2
@@ -65,11 +65,11 @@ void sec_auth_init(sec_mod_st * sec, struct cfg_st *config)
|
|||||||
|
|
||||||
for (i=0;i<config->auth_methods;i++) {
|
for (i=0;i<config->auth_methods;i++) {
|
||||||
if (config->auth[i].enabled && config->auth[i].amod && config->auth[i].amod->global_init)
|
if (config->auth[i].enabled && config->auth[i].amod && config->auth[i].amod->global_init)
|
||||||
config->auth[i].amod->global_init(sec, config->server_name, config->auth[i].additional);
|
config->auth[i].amod->global_init(sec, config->auth[i].additional);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config->acct.amod && config->acct.amod->global_init)
|
if (config->acct.amod && config->acct.amod->global_init)
|
||||||
config->acct.amod->global_init(sec, config->server_name, config->acct.additional);
|
config->acct.amod->global_init(sec, config->acct.additional);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* returns a negative number if we have reached the score for this client.
|
/* returns a negative number if we have reached the score for this client.
|
||||||
|
|||||||
+1
-1
@@ -30,7 +30,7 @@
|
|||||||
typedef struct auth_mod_st {
|
typedef struct auth_mod_st {
|
||||||
unsigned int type;
|
unsigned int type;
|
||||||
unsigned int allows_retries; /* whether the module allows retries of the same password */
|
unsigned int allows_retries; /* whether the module allows retries of the same password */
|
||||||
void (*global_init)(void *pool, const char *server_name, void* additional);
|
void (*global_init)(void *pool, void* additional);
|
||||||
void (*global_deinit)(void);
|
void (*global_deinit)(void);
|
||||||
int (*auth_init)(void** ctx, void *pool, const char* username, const char* ip);
|
int (*auth_init)(void** ctx, void *pool, const char* username, const char* ip);
|
||||||
int (*auth_msg)(void* ctx, void *pool, char** msg);
|
int (*auth_msg)(void* ctx, void *pool, char** msg);
|
||||||
|
|||||||
Reference in New Issue
Block a user