diff --git a/Makefile.am b/Makefile.am index 73817e5c76f970..527dd22d0d7abc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,9 +20,9 @@ EXTRA_DIST += \ # why is it so hard to make autotools to this? install-data-local: -mkdir -p $(DESTDIR)$(datadir)/ceph - -install -m 644 share/known_hosts_drop.ceph.com $(DESTDIR)$(datadir)/ceph/known_hosts_drop.ceph.com - -install -m 644 share/id_dsa_drop.ceph.com $(DESTDIR)$(datadir)/ceph/id_dsa_drop.ceph.com - -install -m 644 share/id_dsa_drop.ceph.com.pub $(DESTDIR)$(datadir)/ceph/id_dsa_drop.ceph.com.pub + -install -m 600 share/known_hosts_drop.ceph.com $(DESTDIR)$(datadir)/ceph/known_hosts_drop.ceph.com + -install -m 600 share/id_dsa_drop.ceph.com $(DESTDIR)$(datadir)/ceph/id_dsa_drop.ceph.com + -install -m 600 share/id_dsa_drop.ceph.com.pub $(DESTDIR)$(datadir)/ceph/id_dsa_drop.ceph.com.pub all-local: if WITH_DEBUG diff --git a/src/ceph-post-file.in b/src/ceph-post-file.in index 9b922a6c94153c..b278e8abd95c77 100755 --- a/src/ceph-post-file.in +++ b/src/ceph-post-file.in @@ -1,16 +1,16 @@ #!/bin/bash -e -# if we start up as ./$0, assume we are running from a source -# checkout. -if [ `dirname $0` = "." ] && [ $PWD != "/usr/bin" ]; then - known_hosts=../share/known_hosts_drop.ceph.com - ssh_key=../share/id_dsa_drop.ceph.com -else - known_hosts=@datadir@/known_hosts_drop.ceph.com - ssh_key=@datadir@/id_dsa_drop.ceph.com +# If these files exist, assume we are a source install. +if [[ -f ../share/known_hosts_drop.ceph.com && -f ../share/id_dsa_drop.ceph.com ]] + then # running from source install + known_hosts=../share/known_hosts_drop.ceph.com + ssh_key=../share/id_dsa_drop.ceph.com + else # running from a pkg install + known_hosts=@datadir@/known_hosts_drop.ceph.com + ssh_key=@datadir@/id_dsa_drop.ceph.com fi -usage() { +function usage() { echo "Usage: $0 [options] file1 [dir2 ...] Easily upload files or directories to ceph.com for analysis by Ceph @@ -155,7 +155,7 @@ done cp "$ssh_key" "$t4" cp "${ssh_key}.pub" "$t4.pub" -sftp -i $t4 \ +sftp -o "IdentityFile=$t4" \ -C \ -oCheckHostIP=no \ -oGlobalKnownHostsFile=$known_hosts \