61b06ae
--- sugar-0.107.1/bin/sugar.in.orig	2015-11-13 22:13:00.000000000 +0000
61b06ae
+++ sugar-0.107.1/bin/sugar.in	2016-01-04 02:38:48.945211100 +0000
61b06ae
@@ -46,6 +46,26 @@
b869103
 # Set Sugar's telepathy accounts directory
61b06ae
 export MC_ACCOUNT_DIR="$HOME/.sugar/$SUGAR_PROFILE/accounts"
4c178ff
 
b869103
+# Check if the keyring exists and create a default
b869103
+# unencrypted keyring (OLPC #10290)
b869103
+keyring_path=$HOME/.gnome2/keyrings
b869103
+if [ ! -e $keyring_path/login.keyring ] &&
b869103
+    [ ! -e $keyring_path/default.keyring ]; then
b869103
+    mkdir -p $keyring_path
b869103
+    echo 'default' > $keyring_path/default
b869103
+    TIME=$(/bin/date +%s)
b869103
+    cat >> $keyring_path/default.keyring.tmp <
b869103
+[keyring]
b869103
+display-name=default
b869103
+ctime=$TIME
b869103
+mtime=$TIME
b869103
+lock-on-idle=false
b869103
+lock-timeout=0
b869103
+EOF
b869103
+
b869103
+mv $keyring_path/default.keyring{.tmp,}
b869103
+fi
b869103
+
4c178ff
 # Source language settings and debug definitions
4c178ff
 if [ -f ~/.i18n ]; then
4c178ff
         . ~/.i18n