{"action":"created","issue":{"url":"https://api.github.com/repos/freedomofpress/securedrop/issues/1287","repository_url":"https://api.github.com/repos/freedomofpress/securedrop","labels_url":"https://api.github.com/repos/freedomofpress/securedrop/issues/1287/labels{/name}","comments_url":"https://api.github.com/repos/freedomofpress/securedrop/issues/1287/comments","events_url":"https://api.github.com/repos/freedomofpress/securedrop/issues/1287/events","html_url":"https://github.com/freedomofpress/securedrop/pull/1287","id":153146805,"number":1287,"title":"Use --force option with copy commands in tails_files","user":{"login":"ageis","id":1161532,"avatar_url":"https://avatars.githubusercontent.com/u/1161532?v=3","gravatar_id":"","url":"https://api.github.com/users/ageis","html_url":"https://github.com/ageis","followers_url":"https://api.github.com/users/ageis/followers","following_url":"https://api.github.com/users/ageis/following{/other_user}","gists_url":"https://api.github.com/users/ageis/gists{/gist_id}","starred_url":"https://api.github.com/users/ageis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ageis/subscriptions","organizations_url":"https://api.github.com/users/ageis/orgs","repos_url":"https://api.github.com/users/ageis/repos","events_url":"https://api.github.com/users/ageis/events{/privacy}","received_events_url":"https://api.github.com/users/ageis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"ageis","id":1161532,"avatar_url":"https://avatars.githubusercontent.com/u/1161532?v=3","gravatar_id":"","url":"https://api.github.com/users/ageis","html_url":"https://github.com/ageis","followers_url":"https://api.github.com/users/ageis/followers","following_url":"https://api.github.com/users/ageis/following{/other_user}","gists_url":"https://api.github.com/users/ageis/gists{/gist_id}","starred_url":"https://api.github.com/users/ageis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ageis/subscriptions","organizations_url":"https://api.github.com/users/ageis/orgs","repos_url":"https://api.github.com/users/ageis/repos","events_url":"https://api.github.com/users/ageis/events{/privacy}","received_events_url":"https://api.github.com/users/ageis/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/freedomofpress/securedrop/milestones/12","html_url":"https://github.com/freedomofpress/securedrop/milestones/0.3.7","labels_url":"https://api.github.com/repos/freedomofpress/securedrop/milestones/12/labels","id":1746379,"number":12,"title":"0.3.7","description":"Point release to address some requests from SecureDrop administrators and upgrade various components on the SecureDrop architecture.\r\n\r\n* Improve backup and restore roles\r\n* Ensure SecureDrop-specific Tails configuration works on Tails 2.x\r\n * Document upgrading from Tails 1.x to Tails 2.x for current admins using 1.x\r\n* Upgrade SecureDrop's Python dependencies","creator":{"login":"garrettr","id":407302,"avatar_url":"https://avatars.githubusercontent.com/u/407302?v=3","gravatar_id":"","url":"https://api.github.com/users/garrettr","html_url":"https://github.com/garrettr","followers_url":"https://api.github.com/users/garrettr/followers","following_url":"https://api.github.com/users/garrettr/following{/other_user}","gists_url":"https://api.github.com/users/garrettr/gists{/gist_id}","starred_url":"https://api.github.com/users/garrettr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garrettr/subscriptions","organizations_url":"https://api.github.com/users/garrettr/orgs","repos_url":"https://api.github.com/users/garrettr/repos","events_url":"https://api.github.com/users/garrettr/events{/privacy}","received_events_url":"https://api.github.com/users/garrettr/received_events","type":"User","site_admin":false},"open_issues":10,"closed_issues":8,"state":"open","created_at":"2016-05-03T22:12:07Z","updated_at":"2016-05-13T23:13:08Z","due_on":"2016-05-17T07:00:00Z","closed_at":null},"comments":11,"created_at":"2016-05-05T00:41:14Z","updated_at":"2016-05-13T23:17:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/freedomofpress/securedrop/pulls/1287","html_url":"https://github.com/freedomofpress/securedrop/pull/1287","diff_url":"https://github.com/freedomofpress/securedrop/pull/1287.diff","patch_url":"https://github.com/freedomofpress/securedrop/pull/1287.patch"},"body":"When cp is used in combination with set -e, and the source and destination are the same (as in an upgrade or re-run use case), the command and rest of the script will fail.\r\n\r\nIntended to fix #1286. \r\n\r\nIt is needed on lines 138 to 141 for sure. But this commit applies it liberally to all copy commands."},"comment":{"url":"https://api.github.com/repos/freedomofpress/securedrop/issues/comments/219181522","html_url":"https://github.com/freedomofpress/securedrop/pull/1287#issuecomment-219181522","issue_url":"https://api.github.com/repos/freedomofpress/securedrop/issues/1287","id":219181522,"user":{"login":"conorsch","id":657862,"avatar_url":"https://avatars.githubusercontent.com/u/657862?v=3","gravatar_id":"","url":"https://api.github.com/users/conorsch","html_url":"https://github.com/conorsch","followers_url":"https://api.github.com/users/conorsch/followers","following_url":"https://api.github.com/users/conorsch/following{/other_user}","gists_url":"https://api.github.com/users/conorsch/gists{/gist_id}","starred_url":"https://api.github.com/users/conorsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/conorsch/subscriptions","organizations_url":"https://api.github.com/users/conorsch/orgs","repos_url":"https://api.github.com/users/conorsch/repos","events_url":"https://api.github.com/users/conorsch/events{/privacy}","received_events_url":"https://api.github.com/users/conorsch/received_events","type":"User","site_admin":false},"created_at":"2016-05-13T23:17:08Z","updated_at":"2016-05-13T23:17:08Z","body":"Ran through a test of this on hardware. (More truthfully, I tested all `tails_files`-related changes staged for 0.3.7.) \r\n\r\n```\r\namnesia@amnesia:~/Persistent/securedrop/tails_files$ sudo ./install.sh \r\n[sudo] password for amnesia: \r\ncp: ‘/home/amnesia/Desktop/document.desktop’ and ‘/live/persistence/TailsData_unlocked/dotfiles/Desktop/document.desktop’ are the same file\r\n```\r\n\r\nI edited the `tails_files/install.sh` script and added `set -x` at the top to make it more verbose:\r\n\r\n```\r\namnesia@amnesia:~/Persistent/securedrop/tails_files$ sudo ./install.sh \r\n[sudo] password for amnesia: \r\n+ [[ 0 -ne 0 ]]\r\n+ HOMEDIR=/home/amnesia\r\n+ PERSISTENT=/home/amnesia/Persistent\r\n+ INSTALL_DIR=/home/amnesia/Persistent/.securedrop\r\n+ ADDITIONS=/home/amnesia/Persistent/.securedrop/torrc_additions\r\n+ SCRIPT_PY=/home/amnesia/Persistent/.securedrop/securedrop_init.py\r\n+ TAILSCFG=/live/persistence/TailsData_unlocked\r\n+ DOTFILES=/live/persistence/TailsData_unlocked/dotfiles\r\n+ DESKTOP=/home/amnesia/Desktop\r\n+ ANSIBLE=/home/amnesia/Persistent/securedrop/install_files/ansible-base\r\n+ NMDISPATCHER=/etc/NetworkManager/dispatcher.d\r\n+ SSH_ALIASES=false\r\n+ source /etc/os-release\r\n++ TAILS_PRODUCT_NAME=Tails\r\n++ TAILS_VERSION_ID=2.3\r\n+ [[ 2.3 =~ ^1\\..* ]]\r\n+ '[' '!' -d /live/persistence/TailsData_unlocked ']'\r\n+ '[' '!' -d /home/amnesia/Persistent/securedrop/install_files/ansible-base ']'\r\n+ '[' -f /home/amnesia/Persistent/securedrop/install_files/ansible-base/app-document-aths ']'\r\n+ ADMIN=true\r\n+ mkdir -p /home/amnesia/Persistent/.securedrop\r\n+ cp -f securedrop_icon.png /home/amnesia/Persistent/.securedrop\r\n+ cp -f document.desktop /home/amnesia/Persistent/.securedrop\r\n+ cp -f source.desktop /home/amnesia/Persistent/.securedrop\r\n+ cp -f securedrop_init.py /home/amnesia/Persistent/.securedrop/securedrop_init.py\r\n+ WRAPPER_BIN=/home/amnesia/Persistent/.securedrop/securedrop_init\r\n+ '[' -f /home/amnesia/Persistent/.securedrop/securedrop_init ']'\r\n+ true\r\n++ cat /home/amnesia/Persistent/securedrop/install_files/ansible-base/app-document-aths\r\n++ cut -d ' ' -f 2\r\n+ DOCUMENT=tyzwhx6om3vzksvj.onion\r\n++ cat /home/amnesia/Persistent/securedrop/install_files/ansible-base/app-source-ths\r\n+ SOURCE=rbted2wcey6yc2yv.onion\r\n++ cat /home/amnesia/Persistent/securedrop/install_files/ansible-base/app-ssh-aths\r\n++ cut -d ' ' -f 2\r\n+ APPSSH=rgk4z2f3yrj7ou4o.onion\r\n++ cat /home/amnesia/Persistent/securedrop/install_files/ansible-base/mon-ssh-aths\r\n++ cut -d ' ' -f 2\r\n+ MONSSH=5w7k3e553tgkko5u.onion\r\n+ echo '# HidServAuth lines for SecureDrop'\\''s authenticated hidden services'\r\n+ cat - /home/amnesia/Persistent/securedrop/install_files/ansible-base/app-ssh-aths /home/amnesia/Persistent/securedrop/install_files/ansible-base/mon-ssh-aths /home/amnesia/Persistent/securedrop/install_files/ansible-base/app-document-aths\r\n+ [[ -d /home/amnesia/.ssh ]]\r\n+ [[ ! -f /home/amnesia/.ssh/config ]]\r\n+ grep -q ansible /live/persistence/TailsData_unlocked/live-additional-software.conf\r\n+ grep -v '^#.*onion' /home/amnesia/Persistent/securedrop/install_files/ansible-base/inventory\r\n+ grep -q onion\r\n+ chmod 755 /home/amnesia/Persistent/.securedrop\r\n+ chown root:root /home/amnesia/Persistent/.securedrop/securedrop_init.py\r\n+ chmod 700 /home/amnesia/Persistent/.securedrop/securedrop_init.py\r\n+ chown root:root /home/amnesia/Persistent/.securedrop/torrc_additions\r\n+ chmod 400 /home/amnesia/Persistent/.securedrop/torrc_additions\r\n+ chown amnesia:amnesia /home/amnesia/Persistent/.securedrop/securedrop_icon.png\r\n+ chmod 600 /home/amnesia/Persistent/.securedrop/securedrop_icon.png\r\n+ true\r\n+ echo 'Exec=/usr/local/bin/tor-browser tyzwhx6om3vzksvj.onion'\r\n+ echo 'Exec=/usr/local/bin/tor-browser rbted2wcey6yc2yv.onion'\r\n+ cp -f /home/amnesia/Persistent/.securedrop/document.desktop /home/amnesia/Desktop\r\n+ cp -f /home/amnesia/Persistent/.securedrop/source.desktop /home/amnesia/Desktop\r\n+ cp -f /home/amnesia/Persistent/.securedrop/document.desktop /home/amnesia/.local/share/applications\r\n+ cp -f /home/amnesia/Persistent/.securedrop/source.desktop /home/amnesia/.local/share/applications\r\n+ sudo -u amnesia mkdir -p /live/persistence/TailsData_unlocked/dotfiles/Desktop\r\n+ sudo -u amnesia mkdir -p /live/persistence/TailsData_unlocked/dotfiles/.local/share/applications\r\n+ cp -f /home/amnesia/Desktop/document.desktop /live/persistence/TailsData_unlocked/dotfiles/Desktop\r\ncp: ‘/home/amnesia/Desktop/document.desktop’ and ‘/live/persistence/TailsData_unlocked/dotfiles/Desktop/document.desktop’ are the same file\r\n```\r\n\r\nLooks like we're trying to copy a symlink to a real file, and `cp` is appropriately balking at that request. Needs further testing."}}