diff options
author | Dave Reisner <d@falconindy.com> | 2010-01-18 16:27:17 -0500 |
---|---|---|
committer | Dave Reisner <d@falconindy.com> | 2010-01-18 16:27:17 -0500 |
commit | 205426e96d7c78f54f26eed33519e478f562d5b5 (patch) | |
tree | 864f35284aeca6917e99972bb5972469cccb83cb | |
parent | 168655fec6b8ba0ea9cda56c6aa5fbdaa6e3b593 (diff) | |
download | squashfu-205426e96d7c78f54f26eed33519e478f562d5b5.tar.gz |
Check UID and that .bin.list is writeable before proceeding with delete
-rwxr-xr-x | squashfu | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -270,6 +270,14 @@ action_backup () { action_remove_bin () { # check if the bin exists both in the binventory AND in the bins directory + if [[ $UID -eq 0 ]]; then + die "Must be root to remove a backup" + fi + + if [[ ! -w "$BINVENTORY" ]]; then + die "Error writing to ${BINVENTORY}" + fi + if [[ -z $2 && grep -E "^$1:" && -d "${BINS_DIR}/$1" ]]; then echo "Are you SURE you want to remove this bin?" printf "Bin ID: %s\nDate Created: %s\nSize: %s\n" \ |