diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2007-10-24 09:09:29 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2007-10-24 09:09:29 -0700 |
commit | ae08adfabeed8fec9093e759a40f156d589defa9 (patch) | |
tree | 346ae29a6645f5b547b567b4a9956a6338462f89 /etc/bash_completion.d | |
parent | f3a563927fd763646b104e9af0a8a78f48920a95 (diff) | |
download | vyatta-cfg-ae08adfabeed8fec9093e759a40f156d589defa9.tar.gz vyatta-cfg-ae08adfabeed8fec9093e759a40f156d589defa9.zip |
make sure config directories have correct permissions.
Diffstat (limited to 'etc/bash_completion.d')
-rw-r--r-- | etc/bash_completion.d/vyatta-cfg | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/etc/bash_completion.d/vyatta-cfg b/etc/bash_completion.d/vyatta-cfg index f740c54..f76437e 100644 --- a/etc/bash_completion.d/vyatta-cfg +++ b/etc/bash_completion.d/vyatta-cfg @@ -26,6 +26,8 @@ if [ "$_OFR_CONFIGURE" != "ok" ]; then return 0 fi +umask 0002 + if [ -r /etc/default/vyatta ]; then source /etc/default/vyatta fi @@ -143,8 +145,9 @@ edit () really_exit() { - umount $VYATTA_TEMP_CONFIG_DIR - rm -rf $VYATTA_TEMP_CONFIG_DIR $VYATTA_CHANGES_ONLY_DIR $VYATTA_CONFIG_TMP + sudo umount $VYATTA_TEMP_CONFIG_DIR + sudo rm -rf $VYATTA_TEMP_CONFIG_DIR $VYATTA_CHANGES_ONLY_DIR \ + $VYATTA_CONFIG_TMP unset _OFR_CONFIGURE builtin exit 0 } @@ -764,11 +767,18 @@ vyatta_config_complete () fi } -mkdir -p $VYATTA_ACTIVE_CONFIGURATION_DIR -mkdir -p $VYATTA_CHANGES_ONLY_DIR -mkdir -p $VYATTA_CONFIG_TMP +DEF_GROUP=quaggavty +make_vyatta_config_dir () +{ + sudo mkdir -m 0775 -p $1 + sudo chgrp ${DEF_GROUP} $1 +} + +make_vyatta_config_dir $VYATTA_ACTIVE_CONFIGURATION_DIR +make_vyatta_config_dir $VYATTA_CHANGES_ONLY_DIR +make_vyatta_config_dir $VYATTA_CONFIG_TMP if [ ! -d $VYATTA_TEMP_CONFIG_DIR ]; then - mkdir -p $VYATTA_TEMP_CONFIG_DIR + make_vyatta_config_dir $VYATTA_TEMP_CONFIG_DIR sudo mount -t unionfs -o dirs=${VYATTA_CHANGES_ONLY_DIR}=rw:/opt/vyatta/config/active=ro unionfs ${VYATTA_TEMP_CONFIG_DIR} fi |