1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-24 02:04:21 +03:00

gpo: Enable more specific parsers of GPO files

* .pol files
* .ini (and GPT.ini)
* audit.csv
* GptTmpl.inf

.aas is currently not handled.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Garming Sam 2018-05-23 13:51:08 +12:00 committed by Andrew Bartlett
parent 497db98538
commit 854c3eb2aa

View File

@ -49,6 +49,11 @@ from samba.ntacls import dsacl2fsacl
from samba.dcerpc import nbt
from samba.net import Net
from samba.gp_parse import GPParser, GPNoParserException
from samba.gp_parse.gp_pol import GPPolParser
from samba.gp_parse.gp_ini import GPIniParser, GPTIniParser
from samba.gp_parse.gp_csv import GPAuditCsvParser
from samba.gp_parse.gp_inf import GptTmplInfParser
from samba.gp_parse.gp_aas import GPAasParser
def samdb_connect(ctx):
@ -238,6 +243,19 @@ def parse_unc(unc):
def find_parser(name, flags=re.IGNORECASE):
if re.match('audit\.csv$', name, flags=flags):
return GPAuditCsvParser()
if re.match('GptTmpl\.inf$', name, flags=flags):
return GptTmplInfParser()
if re.match('GPT\.INI$', name, flags=flags):
return GPTIniParser()
if re.match('.*\.ini$', name, flags=flags):
return GPIniParser()
if re.match('.*\.pol$', name, flags=flags):
return GPPolParser()
if re.match('.*\.aas$', name, flags=flags):
return GPAasParser()
return GPParser()