qrexec-policy: warn if some data is ignored

Something like vm1 vm2 allow, user=foo would be 4 items,
and the user part would be ignored by the parser.
It might or might not be better to error out instead of
just warning, though...
This commit is contained in:
Vincent Penquerc'h 2013-12-27 14:29:50 -05:00 committed by Marek Marczykowski-Górecki
parent 7ad1183793
commit 97c7c97420

View File

@ -38,6 +38,11 @@ def line_to_dict(line):
paramval=iter.split("=") paramval=iter.split("=")
dict["action."+paramval[0]]=paramval[1] dict["action."+paramval[0]]=paramval[1]
# Warn if we're ignoring extra data after a space, such as:
# vm1 vm2 allow, user=foo
if len(tokens) > 3:
print >>sys.stderr, "Trailing data ignored in %s" % line
return dict return dict