From 2f5a8732573261557698841bc4467e82fbeca574 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 25 Oct 2015 18:34:53 +0000 Subject: [PATCH] Only copy the administrator user's keys to root --- src/freedombone | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/freedombone b/src/freedombone index d8ee8fb6..eb27df8e 100755 --- a/src/freedombone +++ b/src/freedombone @@ -3226,11 +3226,13 @@ function create_restore_script { echo ' exit 276' >> /usr/bin/$RESTORE_SCRIPT_NAME echo ' fi' >> /usr/bin/$RESTORE_SCRIPT_NAME echo ' rm -rf /root/tempgnupg' >> /usr/bin/$RESTORE_SCRIPT_NAME - echo ' cp -r /home/$USERNAME/.gnupg /root' >> /usr/bin/$RESTORE_SCRIPT_NAME - echo ' if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_SCRIPT_NAME - echo ' umount $USB_MOUNT' >> /usr/bin/$RESTORE_SCRIPT_NAME - echo ' rm -rf $USB_MOUNT' >> /usr/bin/$RESTORE_SCRIPT_NAME - echo ' exit 283' >> /usr/bin/$RESTORE_SCRIPT_NAME + echo ' if [[ "$USERNAME" == "$MY_USERNAME" ]]; then' >> /usr/bin/$RESTORE_SCRIPT_NAME + echo ' cp -r /home/$USERNAME/.gnupg /root' >> /usr/bin/$RESTORE_SCRIPT_NAME + echo ' if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_SCRIPT_NAME + echo ' umount $USB_MOUNT' >> /usr/bin/$RESTORE_SCRIPT_NAME + echo ' rm -rf $USB_MOUNT' >> /usr/bin/$RESTORE_SCRIPT_NAME + echo ' exit 283' >> /usr/bin/$RESTORE_SCRIPT_NAME + echo ' fi' >> /usr/bin/$RESTORE_SCRIPT_NAME echo ' fi' >> /usr/bin/$RESTORE_SCRIPT_NAME echo ' fi' >> /usr/bin/$RESTORE_SCRIPT_NAME echo ' done' >> /usr/bin/$RESTORE_SCRIPT_NAME @@ -4732,9 +4734,11 @@ function restore_from_friend { echo ' exit 276' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME echo ' fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME echo ' rm -rf /root/tempgnupg' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME - echo ' cp -r /home/$USERNAME/.gnupg /root' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME - echo ' if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME - echo ' exit 283' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME + echo ' if [[ "$USERNAME" == "$MY_USERNAME" ]]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME + echo ' cp -r /home/$USERNAME/.gnupg /root' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME + echo ' if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME + echo ' exit 283' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME + echo ' fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME echo ' fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME echo ' fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME echo ' fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME