]> git.proxmox.com Git - mirror_ifupdown2.git/commit
Fix stdin issues with missing config filename ifquery for disable_cli_interfacesfile
authorSam Tannous <stannous@cumulusnetworks.com>
Fri, 9 Oct 2015 22:00:49 +0000 (18:00 -0400)
committerRoopa Prabhu <roopa@cumulusnetworks.com>
Sat, 10 Oct 2015 14:33:07 +0000 (07:33 -0700)
commitc28fc55eb9b2fe701f4bfd3c586e1f5c6d72f391
tree8a2ee6e645c043f4f76837ae694a5e0f67534bd9
parent67cfaeb1cf881c5de07ab4d352ca8ca1e01f6e1b
Fix stdin issues with missing config filename ifquery for disable_cli_interfacesfile

Ticket: CM-7066
Reviewed By: roopa
Testing Done: unit tested and wrote new testcase in testifupdown2

Use case for ifquery where stdin used with -i breaks
because interfacesfileiobuf was not checked in addition to interfacesfilename.

Testcase like:

echo '[{"name": "swp1","auto": true,"config": {"address": "10.10.10.10/24"}}]' | ifquery -i - -t json swp1

would fail because while -i was given with stdin, the check for missing filename would produce an error.

It was also decided by consensus that the ifquery command does not need to have a check for
disable_cli_interfacesfile since a query "should" not pose a security check.

(I've also added some test cases for this in cl-tests).

(cherry picked from commit 4d37e932b43da87a9240a866be2d8b9508a9c7eb)
ifupdown/networkinterfaces.py
sbin/ifupdown