summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2014-09-02 20:43:42 +0200
committerDaniil Baturin <daniil@baturin.org>2014-09-02 20:43:42 +0200
commit772e5eb33166e5da5e2d907dab0632358514dc7a (patch)
tree7102caeda29e4bd7b7b8e03ee68b1b2bbb8c5c1c
parente0e4a70fe1a485e93a58d62b8af9f26ceacf516a (diff)
downloadvyatta-op-772e5eb33166e5da5e2d907dab0632358514dc7a.tar.gz
vyatta-op-772e5eb33166e5da5e2d907dab0632358514dc7a.zip
Bug 300: disallow entering conf mode as root.
-rw-r--r--templates/configure/node.def19
1 files changed, 13 insertions, 6 deletions
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