From 97c7c97420cd78dbce78062969b8ee70b260ac20 Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Fri, 27 Dec 2013 14:29:50 -0500 Subject: [PATCH] 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... --- qrexec/qrexec-policy | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qrexec/qrexec-policy b/qrexec/qrexec-policy index d33dcfb..2922f63 100755 --- a/qrexec/qrexec-policy +++ b/qrexec/qrexec-policy @@ -38,6 +38,11 @@ def line_to_dict(line): paramval=iter.split("=") 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