X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=src%2Fshare%2Fma%2Fsetup;h=0cd92e0d8bc87134df43ec1d84dc5247805eebe2;hb=07316c65eb5302a1d5385301876be7971e26fd1f;hp=abce3af4e45dd0f5b819ed763be6b6bf9d9206d9;hpb=98ee387a0ba4b15fe80cfcd7828127ff8ae9518d;p=monkeysphere.git diff --git a/src/share/ma/setup b/src/share/ma/setup index abce3af..0cd92e0 100644 --- a/src/share/ma/setup +++ b/src/share/ma/setup @@ -12,10 +12,14 @@ # version 3 or later. setup() { - # make the core and the sphere: - mkdir -p "${SYSDATADIR}"/authentication - mkdir -p "${GNUPGHOME_SPHERE}" + # make all needed directories + mkdir -p "${MADATADIR}" + mkdir -p "${MATMPDIR}" mkdir -p "${GNUPGHOME_CORE}" + chmod 700 "${GNUPGHOME_CORE}" + mkdir -p "${GNUPGHOME_SPHERE}" + chmod 700 "${GNUPGHOME_SPHERE}" + mkdir -p "${MADATADIR}"/authorized_keys # deliberately replace the config files via truncation # FIXME: should we be dumping to tmp files and then moving atomically? @@ -33,40 +37,42 @@ EOF # Edits will be overwritten. no-greeting primary-keyring ${GNUPGHOME_SPHERE}/pubring.gpg -keyring ${GNUPGHOME_CORE}/pubring.gpg - list-options show-uid-validity EOF - # fingerprint of core key. this should be empty on unconfigured systems. + # make sure the monkeysphere user owns everything in the sphere + # gnupghome + chown -R "$MONKEYPSHERE_USER" "${GNUPGHOME_SPHERE}" + chgrp -R "$MONKEYPSHERE_USER" "${GNUPGHOME_SPHERE}" + + # get fingerprint of core key. this should be empty on unconfigured systems. local CORE_FPR=$(gpg_core --with-colons --fixed-list-mode --fingerprint --list-secret-key | grep ^fpr: | cut -f10 -d: ) if [ -z "$CORE_FPR" ] ; then - log info "Setting up Monkeysphere authentication trust core" + log info "Setting up Monkeysphere authentication trust core..." local CORE_UID=$(printf "Monkeysphere authentication trust core UID (random string: %s)" $(head -c21