From 7e0cd1281925ab017eeb08877be528d46ae23257 Mon Sep 17 00:00:00 2001
From: Stig Thormodsrud <stig@vyatta.com>
Date: Tue, 27 Nov 2007 13:46:15 -0800
Subject: Fix "set system time-zone" doesn't verify valid time-zone.

---
 templates/system/time-zone/node.def | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

(limited to 'templates/system/time-zone/node.def')

diff --git a/templates/system/time-zone/node.def b/templates/system/time-zone/node.def
index 72ca791e..60e87e12 100644
--- a/templates/system/time-zone/node.def
+++ b/templates/system/time-zone/node.def
@@ -12,7 +12,12 @@ case \"$(@)\" in \
   [Pp][Hh][Oo]*) LTF=\"\\\$LTF/US/Arizona\" ;; \
   *) LTF=\"\\\$LTF/Etc/$(@)\" ;; \
 esac && \
-sudo ln -fs \\\$LTF /etc/localtime"
+if [ -e \"\\\$LTF\" ]; then \
+   sudo ln -fs \\\$LTF /etc/localtime; \
+else \
+   echo \"Invalid timezone\"; \
+   exit 1; \
+fi"
 delete: "sudo ln -fs /usr/share/zoneinfo/GMT /etc/localtime"
 #allowed: local -a list=( "Los Angeles" "New York" "Denver" "Chicago" \
 #                         "Anchorage" "Honolulu" "Phoenix" "GMT" )
-- 
cgit v1.2.3

