Blob Blame History Raw
diff --git a/bin/sugar.in b/bin/sugar.in
index 12098db..df27143 100644
--- a/bin/sugar.in
+++ b/bin/sugar.in
@@ -62,6 +62,26 @@ export LANGUAGE="${LANGUAGE:-${LANG}}"
 # Set Sugar's telepathy accounts directory
 export MC_ACCOUNT_DIR=$HOME/.sugar/$SUGAR_PROFILE/accounts

+# Check if the keyring exists and create a default
+# unencrypted keyring (OLPC #10290)
+keyring_path=$HOME/.gnome2/keyrings
+if [ ! -e $keyring_path/login.keyring ] &&
+    [ ! -e $keyring_path/default.keyring ]; then
+    mkdir -p $keyring_path
+    echo 'default' > $keyring_path/default
+    TIME=$(/bin/date +%s)
+    cat >> $keyring_path/default.keyring.tmp <<EOF
+[keyring]
+display-name=default
+ctime=$TIME
+mtime=$TIME
+lock-on-idle=false
+lock-timeout=0
+EOF
+
+mv $keyring_path/default.keyring{.tmp,}
+fi
+
 # Workaround until gnome-keyring-daemon lets dbus activate it
 # https://bugzilla.gnome.org/show_bug.cgi?id=628302
 if test "$SUGAR_EMULATOR" = "yes" -a "$(type gnome-keyring-daemon)"; then