[Sugar-devel] [PATCH sugar] Create a default unencrypted keyring, OLPC #10290

Simon Schampijer simon at schampijer.de
Mon Jun 11 13:11:10 EDT 2012


Follow-up: Upstream seem to work on the possibility to use the XDG dirs, 
so one can specify an alternative path.

https://bugzilla.gnome.org/show_bug.cgi?id=613644

Thanks to Marco for pointing that out,
    Simon

On 04/16/2012 12:33 PM, Simon Schampijer wrote:
> This patch does create an ununcrypted default keyring
> if there is not one available already. This will stop
> prompts for unlocking the keyring after logging into
> Sugar.
>
> In GNOME the session manager deals with creating
> that keyring. In the OLPC images we do create a default
> keyring on image creation time (see olpc-configure), same
> is true for Soas. This patch does check/create the
> keyring on every Sugar run. The advantage is that
> for example installs the live image to a disk install
> using liveinst, or install Sugar from the Fedora installer
> without installing or ever running GNOME that workaround
> will work for them as well.
>
> Signed-off-by: Peter Robinson<pbrobinson at fedoraproject.org>
> Signed-off-by: Simon Schampijer<simon at laptop.org>
> ---
>   bin/sugar.in |   20 ++++++++++++++++++++
>   1 files changed, 20 insertions(+), 0 deletions(-)
>
> 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



More information about the Sugar-devel mailing list