summaryrefslogtreecommitdiff
path: root/servconf.h
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2012-09-06 23:20:10 +0100
committerColin Watson <cjwatson@debian.org>2012-09-06 23:20:10 +0100
commitc6a2c0334e45419875687d250aed9bea78480f2e (patch)
treed8f01bef9f3921fa1ca7592a19474be9c8349f76 /servconf.h
parentdd5ed53e20d218607260916a6b04d1c8c5b3d88f (diff)
parent8b13b5bdc4f19bd52ee673104d66b71c21153b96 (diff)
merge 6.1p1
Diffstat (limited to 'servconf.h')
-rw-r--r--servconf.h31
1 files changed, 25 insertions, 6 deletions
diff --git a/servconf.h b/servconf.h
index a434c6fa3..2ccf4d0f2 100644
--- a/servconf.h
+++ b/servconf.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: servconf.h,v 1.99 2011/06/22 21:57:01 djm Exp $ */ 1/* $OpenBSD: servconf.h,v 1.103 2012/07/10 02:19:15 djm Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -39,7 +39,7 @@
39/* use_privsep */ 39/* use_privsep */
40#define PRIVSEP_OFF 0 40#define PRIVSEP_OFF 0
41#define PRIVSEP_ON 1 41#define PRIVSEP_ON 1
42#define PRIVSEP_SANDBOX 2 42#define PRIVSEP_NOSANDBOX 2
43 43
44#define DEFAULT_AUTH_FAIL_MAX 6 /* Default for MaxAuthTries */ 44#define DEFAULT_AUTH_FAIL_MAX 6 /* Default for MaxAuthTries */
45#define DEFAULT_SESSIONS_MAX 10 /* Default for MaxSessions */ 45#define DEFAULT_SESSIONS_MAX 10 /* Default for MaxSessions */
@@ -169,8 +169,20 @@ typedef struct {
169 char *revoked_keys_file; 169 char *revoked_keys_file;
170 char *trusted_user_ca_keys; 170 char *trusted_user_ca_keys;
171 char *authorized_principals_file; 171 char *authorized_principals_file;
172
173 char *version_addendum; /* Appended to SSH banner */
172} ServerOptions; 174} ServerOptions;
173 175
176/* Information about the incoming connection as used by Match */
177struct connection_info {
178 const char *user;
179 const char *host; /* possibly resolved hostname */
180 const char *address; /* remote address */
181 const char *laddress; /* local address */
182 int lport; /* local port */
183};
184
185
174/* 186/*
175 * These are string config options that must be copied between the 187 * These are string config options that must be copied between the
176 * Match sub-config and the main config, and must be sent from the 188 * Match sub-config and the main config, and must be sent from the
@@ -183,17 +195,24 @@ typedef struct {
183 M_CP_STROPT(revoked_keys_file); \ 195 M_CP_STROPT(revoked_keys_file); \
184 M_CP_STROPT(authorized_principals_file); \ 196 M_CP_STROPT(authorized_principals_file); \
185 M_CP_STRARRAYOPT(authorized_keys_files, num_authkeys_files); \ 197 M_CP_STRARRAYOPT(authorized_keys_files, num_authkeys_files); \
198 M_CP_STRARRAYOPT(allow_users, num_allow_users); \
199 M_CP_STRARRAYOPT(deny_users, num_deny_users); \
200 M_CP_STRARRAYOPT(allow_groups, num_allow_groups); \
201 M_CP_STRARRAYOPT(deny_groups, num_deny_groups); \
202 M_CP_STRARRAYOPT(accept_env, num_accept_env); \
186 } while (0) 203 } while (0)
187 204
205struct connection_info *get_connection_info(int, int);
188void initialize_server_options(ServerOptions *); 206void initialize_server_options(ServerOptions *);
189void fill_default_server_options(ServerOptions *); 207void fill_default_server_options(ServerOptions *);
190int process_server_config_line(ServerOptions *, char *, const char *, int, 208int process_server_config_line(ServerOptions *, char *, const char *, int,
191 int *, const char *, const char *, const char *); 209 int *, struct connection_info *);
192void load_server_config(const char *, Buffer *); 210void load_server_config(const char *, Buffer *);
193void parse_server_config(ServerOptions *, const char *, Buffer *, 211void parse_server_config(ServerOptions *, const char *, Buffer *,
194 const char *, const char *, const char *); 212 struct connection_info *);
195void parse_server_match_config(ServerOptions *, const char *, const char *, 213void parse_server_match_config(ServerOptions *, struct connection_info *);
196 const char *); 214int parse_server_match_testspec(struct connection_info *, char *);
215int server_match_spec_complete(struct connection_info *);
197void copy_set_server_options(ServerOptions *, ServerOptions *, int); 216void copy_set_server_options(ServerOptions *, ServerOptions *, int);
198void dump_config(ServerOptions *); 217void dump_config(ServerOptions *);
199char *derelativise_path(const char *); 218char *derelativise_path(const char *);