1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-17 00:07:37 +02:00

add support for multiple include paths

This commit is contained in:
Kelly Brazil
2022-11-04 14:42:04 -07:00
parent 89d4df2a05
commit 7c899abb15
3 changed files with 16 additions and 2 deletions

View File

@ -79,6 +79,9 @@ Schema:
],
"ignorerhosts": string,
"ignoreuserknownhosts": string,
"include": [
string
],
"ipqos": [
string
],
@ -528,6 +531,14 @@ def _process(proc_data: JSONDictType) -> JSONDictType:
proc_data[key] = new_list
continue
# this is a list value
if key == 'include':
new_list = []
for item in val: # type: ignore
new_list.extend(item.split())
proc_data[key] = new_list
continue
if key == 'maxstartups':
maxstart_split = val.split(':', maxsplit=2) # type: ignore
proc_data[key] = maxstart_split[0]
@ -596,7 +607,7 @@ def parse(
raw_output: Dict = {}
multi_fields: Set[str] = {'acceptenv', 'hostkey', 'listenaddress', 'port'}
multi_fields: Set[str] = {'acceptenv', 'hostkey', 'include', 'listenaddress', 'port'}
modified_fields: Set[str] = {
'casignaturealgorithms', 'ciphers', 'hostbasedacceptedalgorithms',

View File

@ -1,3 +1,6 @@
Include foo/bar foo/baz
Include foo/buz
# $OpenBSD: sshd_config,v 1.100 2016/08/15 12:32:04 naddy Exp $
# This is the sshd server system-wide configuration file. See

View File

@ -1 +1 @@
{"port":[22],"addressfamily":"any","listenaddress":["0.0.0.0","::"],"hostkey":["/etc/ssh/ssh_host_rsa_key","/etc/ssh/ssh_host_ecdsa_key","/etc/ssh/ssh_host_ed25519_key"],"syslogfacility":"AUTHPRIV","authorizedkeysfile":[".ssh/authorized_keys"],"passwordauthentication":"yes","challengeresponseauthentication":"no","gssapiauthentication":"yes","gssapicleanupcredentials":"no","usepam":"yes","x11forwarding":"yes","acceptenv":["LANG","LC_CTYPE","LC_NUMERIC","LC_TIME","LC_COLLATE","LC_MONETARY","LC_MESSAGES","LC_PAPER","LC_NAME","LC_ADDRESS","LC_TELEPHONE","LC_MEASUREMENT","LC_IDENTIFICATION","LC_ALL","LANGUAGE","XMODIFIERS"],"subsystem":"sftp","subsystem_command":"/usr/libexec/openssh/sftp-server"}
{"include":["foo/bar","foo/baz","foo/buz"],"port":[22],"addressfamily":"any","listenaddress":["0.0.0.0","::"],"hostkey":["/etc/ssh/ssh_host_rsa_key","/etc/ssh/ssh_host_ecdsa_key","/etc/ssh/ssh_host_ed25519_key"],"syslogfacility":"AUTHPRIV","authorizedkeysfile":[".ssh/authorized_keys"],"passwordauthentication":"yes","challengeresponseauthentication":"no","gssapiauthentication":"yes","gssapicleanupcredentials":"no","usepam":"yes","x11forwarding":"yes","acceptenv":["LANG","LC_CTYPE","LC_NUMERIC","LC_TIME","LC_COLLATE","LC_MONETARY","LC_MESSAGES","LC_PAPER","LC_NAME","LC_ADDRESS","LC_TELEPHONE","LC_MEASUREMENT","LC_IDENTIFICATION","LC_ALL","LANGUAGE","XMODIFIERS"],"subsystem":"sftp","subsystem_command":"/usr/libexec/openssh/sftp-server"}