From 772e5eb33166e5da5e2d907dab0632358514dc7a Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Tue, 2 Sep 2014 20:43:42 +0200 Subject: Bug 300: disallow entering conf mode as root. --- templates/configure/node.def | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'templates') diff --git a/templates/configure/node.def b/templates/configure/node.def index 5b349e8..5f79a08 100644 --- a/templates/configure/node.def +++ b/templates/configure/node.def @@ -1,7 +1,14 @@ help: Enter configure mode -run: history -w - export _OFR_CONFIGURE=ok - newgrp vyattacfg - unset _OFR_CONFIGURE - _vyatta_op_do_key_bindings - history -r +run: if [ `id -u` == 0 ]; then + echo "You are attempting to enter configuration mode as root." + echo "It may have unintended consequences and render your system" + echo "unusable until restart." + echo "Please do it as an administrator level VyOS user instead." + else + history -w + export _OFR_CONFIGURE=ok + newgrp vyattacfg + unset _OFR_CONFIGURE + _vyatta_op_do_key_bindings + history -r + fi -- cgit v1.2.3