|
Lines 64-69
static void add_one_listen_addr(ServerOptions *, char *, int);
Link Here
|
| 64 |
/* Use of privilege separation or not */ |
64 |
/* Use of privilege separation or not */ |
| 65 |
extern int use_privsep; |
65 |
extern int use_privsep; |
| 66 |
extern Buffer cfg; |
66 |
extern Buffer cfg; |
|
|
67 |
struct include_item *include_list = NULL; |
| 67 |
|
68 |
|
| 68 |
/* Initializes the server options to their default values. */ |
69 |
/* Initializes the server options to their default values. */ |
| 69 |
|
70 |
|
|
Lines 415-421
typedef enum {
Link Here
|
| 415 |
sAcceptEnv, sPermitTunnel, |
416 |
sAcceptEnv, sPermitTunnel, |
| 416 |
sMatch, sPermitOpen, sForceCommand, sChrootDirectory, |
417 |
sMatch, sPermitOpen, sForceCommand, sChrootDirectory, |
| 417 |
sUsePrivilegeSeparation, sAllowAgentForwarding, |
418 |
sUsePrivilegeSeparation, sAllowAgentForwarding, |
| 418 |
sHostCertificate, |
419 |
sHostCertificate, sInclude, |
| 419 |
sRevokedKeys, sTrustedUserCAKeys, sAuthorizedPrincipalsFile, |
420 |
sRevokedKeys, sTrustedUserCAKeys, sAuthorizedPrincipalsFile, |
| 420 |
sAuthorizedPrincipalsCommand, sAuthorizedPrincipalsCommandUser, |
421 |
sAuthorizedPrincipalsCommand, sAuthorizedPrincipalsCommandUser, |
| 421 |
sKexAlgorithms, sIPQoS, sVersionAddendum, |
422 |
sKexAlgorithms, sIPQoS, sVersionAddendum, |
|
Lines 550-555
static struct {
Link Here
|
| 550 |
{ "trustedusercakeys", sTrustedUserCAKeys, SSHCFG_ALL }, |
551 |
{ "trustedusercakeys", sTrustedUserCAKeys, SSHCFG_ALL }, |
| 551 |
{ "authorizedprincipalsfile", sAuthorizedPrincipalsFile, SSHCFG_ALL }, |
552 |
{ "authorizedprincipalsfile", sAuthorizedPrincipalsFile, SSHCFG_ALL }, |
| 552 |
{ "kexalgorithms", sKexAlgorithms, SSHCFG_GLOBAL }, |
553 |
{ "kexalgorithms", sKexAlgorithms, SSHCFG_GLOBAL }, |
|
|
554 |
{ "include", sInclude, SSHCFG_GLOBAL }, |
| 553 |
{ "ipqos", sIPQoS, SSHCFG_ALL }, |
555 |
{ "ipqos", sIPQoS, SSHCFG_ALL }, |
| 554 |
{ "authorizedkeyscommand", sAuthorizedKeysCommand, SSHCFG_ALL }, |
556 |
{ "authorizedkeyscommand", sAuthorizedKeysCommand, SSHCFG_ALL }, |
| 555 |
{ "authorizedkeyscommanduser", sAuthorizedKeysCommandUser, SSHCFG_ALL }, |
557 |
{ "authorizedkeyscommanduser", sAuthorizedKeysCommandUser, SSHCFG_ALL }, |
|
Lines 964-969
process_server_config_line(ServerOptions *options, char *line,
Link Here
|
| 964 |
size_t len; |
966 |
size_t len; |
| 965 |
long long val64; |
967 |
long long val64; |
| 966 |
const struct multistate *multistate_ptr; |
968 |
const struct multistate *multistate_ptr; |
|
|
969 |
struct include_item *item; |
| 970 |
int found = 0; |
| 971 |
glob_t gbuf; |
| 967 |
|
972 |
|
| 968 |
cp = line; |
973 |
cp = line; |
| 969 |
if ((arg = strdelim(&cp)) == NULL) |
974 |
if ((arg = strdelim(&cp)) == NULL) |
|
Lines 1632-1637
process_server_config_line(ServerOptions *options, char *line,
Link Here
|
| 1632 |
*intptr = value; |
1637 |
*intptr = value; |
| 1633 |
break; |
1638 |
break; |
| 1634 |
|
1639 |
|
|
|
1640 |
case sInclude: |
| 1641 |
arg = strdelim(&cp); |
| 1642 |
if (!arg || *arg == '\0') |
| 1643 |
fatal("%s line %d: missing argument - file to include", |
| 1644 |
filename, linenum); |
| 1645 |
// browse cached list of files |
| 1646 |
for (item = include_list; item != NULL; item = item->next) { |
| 1647 |
if (strcmp(item->selector, arg) == 0) { |
| 1648 |
if (item->filename != NULL) |
| 1649 |
parse_server_config(options, item->filename, &(item->buffer), connectinfo); |
| 1650 |
found = 1; |
| 1651 |
} |
| 1652 |
} |
| 1653 |
// no match. Go glob |
| 1654 |
if (found == 0) { |
| 1655 |
debug3("Glob configuration file to include %s", arg); |
| 1656 |
if (glob(arg, 0, NULL, &gbuf) == 0) |
| 1657 |
for (i = 0; i < gbuf.gl_pathc; i++) { |
| 1658 |
debug3("Including configuration file %s", |
| 1659 |
gbuf.gl_pathv[i]); |
| 1660 |
item = malloc(sizeof(struct include_item)); |
| 1661 |
item->selector = strdup(arg); |
| 1662 |
item->filename = strdup(gbuf.gl_pathv[i]); |
| 1663 |
buffer_init(&(item->buffer)); |
| 1664 |
load_server_config(item->filename, &(item->buffer)); |
| 1665 |
parse_server_config(options, item->filename, &(item->buffer), connectinfo); |
| 1666 |
// prepend item to the start of the list |
| 1667 |
item->next = include_list; |
| 1668 |
include_list = item; |
| 1669 |
} |
| 1670 |
else { /* no match or other error */ |
| 1671 |
// store placeholder to avoid aditional globs |
| 1672 |
item = malloc(sizeof(struct include_item)); |
| 1673 |
item->selector = strdup(arg); |
| 1674 |
item->filename = NULL; |
| 1675 |
buffer_init(&(item->buffer)); |
| 1676 |
// prepend item to the start of the list |
| 1677 |
item->next = include_list; |
| 1678 |
include_list = item; |
| 1679 |
} |
| 1680 |
globfree(&gbuf); |
| 1681 |
} |
| 1682 |
break; |
| 1683 |
|
| 1635 |
case sMatch: |
1684 |
case sMatch: |
| 1636 |
if (cmdline) |
1685 |
if (cmdline) |
| 1637 |
fatal("Match directive not supported as a command-line " |
1686 |
fatal("Match directive not supported as a command-line " |