From 134b8c66bec679556bec90c4eef937d464a7950e Mon Sep 17 00:00:00 2001 From: Jameson Graef Rollins Date: Sat, 11 Jul 2009 16:00:22 -0400 Subject: explicitly set MONKEYSPHERE_GROUP The monkeysphere group is now determined from the system "groups" command, and then MONKEYSPHERE_GROUP is explicitly set from this, and then used when setting group ownership. --- src/monkeysphere-host | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/monkeysphere-host') diff --git a/src/monkeysphere-host b/src/monkeysphere-host index 507b47f..60b627a 100755 --- a/src/monkeysphere-host +++ b/src/monkeysphere-host @@ -226,6 +226,7 @@ LOG_LEVEL=${MONKEYSPHERE_LOG_LEVEL:=$LOG_LEVEL} KEYSERVER=${MONKEYSPHERE_KEYSERVER:=$KEYSERVER} CHECK_KEYSERVER=${MONKEYSPHERE_CHECK_KEYSERVER:=$CHECK_KEYSERVER} MONKEYSPHERE_USER=${MONKEYSPHERE_MONKEYSPHERE_USER:=$MONKEYSPHERE_USER} +MONKEYSPHERE_GROUP=$(groups "$MONKEYSPHERE_USER" | cut -d: -f2 | awk '{ print $1 }') PROMPT=${MONKEYSPHERE_PROMPT:=$PROMPT} # other variables @@ -238,6 +239,7 @@ export LOG_LEVEL export KEYSERVER export CHECK_KEYSERVER export MONKEYSPHERE_USER +export MONKEYSPHERE_GROUP export PROMPT export GNUPGHOME_HOST export GNUPGHOME -- cgit v1.2.3 From ba3ca3e10f4975510dfeedcb6dfe8e2374ca3097 Mon Sep 17 00:00:00 2001 From: Jameson Graef Rollins Date: Sat, 11 Jul 2009 16:25:52 -0400 Subject: improve function to get primary group to make it more portable --- src/monkeysphere-authentication | 2 +- src/monkeysphere-host | 2 +- src/share/common | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src/monkeysphere-host') diff --git a/src/monkeysphere-authentication b/src/monkeysphere-authentication index 0e6f986..5b30628 100755 --- a/src/monkeysphere-authentication +++ b/src/monkeysphere-authentication @@ -120,7 +120,7 @@ LOG_LEVEL=${MONKEYSPHERE_LOG_LEVEL:=$LOG_LEVEL} KEYSERVER=${MONKEYSPHERE_KEYSERVER:=$KEYSERVER} CHECK_KEYSERVER=${MONKEYSPHERE_CHECK_KEYSERVER:=$CHECK_KEYSERVER} MONKEYSPHERE_USER=${MONKEYSPHERE_MONKEYSPHERE_USER:=$MONKEYSPHERE_USER} -MONKEYSPHERE_GROUP=$(groups "$MONKEYSPHERE_USER" | cut -d: -f2 | awk '{ print $1 }') +MONKEYSPHERE_GROUP=$(get_primary_group "$MONKEYSPHERE_USER") PROMPT=${MONKEYSPHERE_PROMPT:=$PROMPT} AUTHORIZED_USER_IDS=${MONKEYSPHERE_AUTHORIZED_USER_IDS:=$AUTHORIZED_USER_IDS} RAW_AUTHORIZED_KEYS=${MONKEYSPHERE_RAW_AUTHORIZED_KEYS:=$RAW_AUTHORIZED_KEYS} diff --git a/src/monkeysphere-host b/src/monkeysphere-host index 60b627a..ebd29c8 100755 --- a/src/monkeysphere-host +++ b/src/monkeysphere-host @@ -226,7 +226,7 @@ LOG_LEVEL=${MONKEYSPHERE_LOG_LEVEL:=$LOG_LEVEL} KEYSERVER=${MONKEYSPHERE_KEYSERVER:=$KEYSERVER} CHECK_KEYSERVER=${MONKEYSPHERE_CHECK_KEYSERVER:=$CHECK_KEYSERVER} MONKEYSPHERE_USER=${MONKEYSPHERE_MONKEYSPHERE_USER:=$MONKEYSPHERE_USER} -MONKEYSPHERE_GROUP=$(groups "$MONKEYSPHERE_USER" | cut -d: -f2 | awk '{ print $1 }') +MONKEYSPHERE_GROUP=$(get_primary_group "$MONKEYSPHERE_USER") PROMPT=${MONKEYSPHERE_PROMPT:=$PROMPT} # other variables diff --git a/src/share/common b/src/share/common index bd887d3..76b539f 100644 --- a/src/share/common +++ b/src/share/common @@ -483,6 +483,12 @@ get_homedir() { eval "echo ~${uname}" } +# return the primary group of a user +get_primary_group() { + local uname=${1:-`whoami`} + groups "$uname" | sed 's/^..* : //' | awk '{ print $1 }' +} + ### CONVERSION UTILITIES # output the ssh key for a given key ID -- cgit v1.2.3 From 0ac8f36de9a29b5feb4f834e9dd15aaf834b4991 Mon Sep 17 00:00:00 2001 From: Greg Lyle Date: Sat, 11 Jul 2009 17:38:53 -0400 Subject: Check for a host key before running monkeysphere-host diagnostics Closes #624 --- src/monkeysphere-host | 1 + 1 file changed, 1 insertion(+) (limited to 'src/monkeysphere-host') diff --git a/src/monkeysphere-host b/src/monkeysphere-host index ebd29c8..d498065 100755 --- a/src/monkeysphere-host +++ b/src/monkeysphere-host @@ -306,6 +306,7 @@ case $COMMAND in ;; 'diagnostics'|'d') + check_host_no_key load_fingerprint source "${MHSHAREDIR}/diagnostics" diagnostics -- cgit v1.2.3