touch known_hosts file in monkeysphere so that permission checking
authorJameson Graef Rollins <jrollins@phys.columbia.edu>
Wed, 29 Oct 2008 02:32:56 +0000 (22:32 -0400)
committerJameson Graef Rollins <jrollins@phys.columbia.edu>
Wed, 29 Oct 2008 02:32:56 +0000 (22:32 -0400)
down't fail.  remove spurios directory in monkeysphere.dirs.  more
work on test suite.

debian/monkeysphere.dirs
src/monkeysphere
tests/basic
tests/home/testuser/.monkeysphere/monkeysphere.conf

index b2bd77cd241341b8bca50559640e5b89413ade15..cfafe15d3b31c2c2bbeb6025289b44a119be2ab6 100644 (file)
@@ -10,4 +10,3 @@ usr/share/man/man1
 usr/share/man/man5
 usr/share/man/man8
 etc/monkeysphere
-etc/monkeysphere/authorized_user_ids
index 5703995f5edff3a21ca9e3de6bbea885c86be8c9..7e800cc4d61942f53deff20817f08633da6a8a74 100755 (executable)
@@ -318,10 +318,12 @@ case $COMMAND in
     'update-known_hosts'|'update-known-hosts'|'k')
        MODE='known_hosts'
 
+       # touch the known_hosts file so that the file permission check
+       # below won't fail upon not finding the file
+       (umask 0022 && touch "$KNOWN_HOSTS")
+
        # check permissions on the known_hosts file path
-       if ! check_key_file_permissions "$USER" "$KNOWN_HOSTS" ; then
-           failure "Improper permissions on known_hosts file path."
-       fi
+       check_key_file_permissions "$USER" "$KNOWN_HOSTS" || failure
 
         # if hosts are specified on the command line, process just
         # those hosts
index 1f4930f9b1ca7c356f915f96edc36c8e83dd80ce..ec92e1a7d0b41b73698f78467e05e5a154e7bcbf 100755 (executable)
@@ -104,19 +104,19 @@ cp -a "$TESTDIR"/home/admin "$TEMPDIR"/
 cp -a "$TESTDIR"/home/testuser "$TEMPDIR"/
 
 # set up environment for testuser
-export HOME="$TEMPDIR"/testuser
-export GNUPGHOME="$HOME"/.gnupg
-export SSH_ASKPASS="$HOME"/.ssh/askpass
-export MONKEYSPHERE_HOME="$HOME"/.monkeysphere
-
-cat <<EOF >> "$HOME"/.ssh/config
-UserKnownHostsFile $HOME/.ssh/known_hosts
-IdentityFile $HOME/.ssh/no-such-identity
-ProxyCommand $HOME/.ssh/proxy-command %h %p $SOCKET
+TESTHOME="$TEMPDIR"/testuser
+export GNUPGHOME="$TESTHOME"/.gnupg
+export SSH_ASKPASS="$TESTHOME"/.ssh/askpass
+export MONKEYSPHERE_HOME="$TESTHOME"/.monkeysphere
+
+cat <<EOF >> "$TESTHOME"/.ssh/config
+UserKnownHostsFile $TESTHOME/.ssh/known_hosts
+IdentityFile $TESTHOME/.ssh/no-such-identity
+ProxyCommand $TESTHOME/.ssh/proxy-command %h %p $SOCKET
 EOF
 
 cat <<EOF >> "$MONKEYSPHERE_HOME"/monkeysphere.conf
-KNOWN_HOSTS=$HOME/.ssh/known_hosts
+KNOWN_HOSTS=$TESTHOME/.ssh/known_hosts
 EOF
 
 get_gpg_prng_arg >> "$GNUPGHOME"/gpg.conf
@@ -128,7 +128,7 @@ EOF
 
 ### SERVER TESTS
 
-# setup monkeysphere temp gnupghome directories
+# setup monkeysphere directories
 mkdir -p -m 750 "$MONKEYSPHERE_SYSDATADIR"/gnupg-host
 mkdir -p -m 700 "$MONKEYSPHERE_SYSDATADIR"/gnupg-authentication
 mkdir -p -m 700 "$MONKEYSPHERE_SYSDATADIR"/authorized_keys
@@ -195,7 +195,7 @@ ssh_test
 # authorized_keys file, this is to make sure that the ssh
 # authentication FAILS...
 echo "### removing testuser authorized_user_ids and reupdating authorized_keys..."
-rm -f "$TEMPDIR"/testuser/.monkeysphere/authorized_user_ids
+rm -f "$TESTHOME"/.monkeysphere/authorized_user_ids
 monkeysphere-server update-users $(whoami)
 
 # make sure the user can NOT connect
index 59cc0cfb093585adce1ffb6be6215e91ed0a08da..dbe0233eb0c1243d90868ecf6123c9ad572527cb 100644 (file)
@@ -1,3 +1,5 @@
 # monkeysphere config for testuser in monkeysphere test suite
 
+LOG_LEVEL=DEBUG
+
 # KNOWN_HOSTS will be dynamically defined after creation.