[node-patches] Change in ovirt-node[master]: Validate passed NTP servers and reject bad ones

rbarry at redhat.com rbarry at redhat.com
Fri Aug 9 22:20:49 UTC 2013


Ryan Barry has uploaded a new change for review.

Change subject: Validate passed NTP servers and reject bad ones
......................................................................

Validate passed NTP servers and reject bad ones

Don't blindly set NTP servers. Run them through a validator first
and drop everything that doesn't match.

Change-Id: Ifb135977b4359f5fe0161215cec2cdd1b22244b3
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=913002
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M scripts/ovirt-init-functions.sh.in
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/88/17888/1

diff --git a/scripts/ovirt-init-functions.sh.in b/scripts/ovirt-init-functions.sh.in
index 4e555d8..375bcb1 100644
--- a/scripts/ovirt-init-functions.sh.in
+++ b/scripts/ovirt-init-functions.sh.in
@@ -644,7 +644,7 @@
             dns=${i#dns=}
             ;;
             ntp=*)
-            ntp=${i#ntp=}
+            ntp=$(printf $i|python -c 'import sys; from ovirt.node import valid; print(",".join([x for line in sys.stdin for x in line[4:].strip().split(",") if valid.FQDNOrIPAddress()(x)]))')
             ;;
             network_layout=*)
             network_layout=${i#network_layout=}


-- 
To view, visit http://gerrit.ovirt.org/17888
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifb135977b4359f5fe0161215cec2cdd1b22244b3
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Ryan Barry <rbarry at redhat.com>



More information about the node-patches mailing list