Package: libpam-keyring
Version: 0.0.8-6
Severity: wishlist
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I would be nice if pam-keyring-tool would support changing the password
of a keyring. Upstream has released a testing version (with the same
version number) which support this and the patch can be found on
https://bugs.launchpad.net/gnome-keyring/+bug/54792 

I have rebuild the package with the patch applied and it seems to work
for me. (Attached is the interdiff)

Greetings Arjan.

- -- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (101, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.20-2-nebula (PREEMPT)
Locale: LANG=nl_NL.UTF-8, LC_CTYPE=nl_NL.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libpam-keyring depends on:
ii  libc6                         2.5-4      GNU C Library: Shared libraries
ii  libglib2.0-0                  2.12.11-3  The GLib library of C routines
ii  libgnome-keyring0             0.8.1-2    GNOME keyring services library
ii  libpam0g                      0.79-4     Pluggable Authentication Modules l

Versions of packages libpam-keyring recommends:
ii  gnome-session                 2.18.0-1   The GNOME 2 Session Manager

- -- no debconf information

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGMTa+UALvsZYuOJARAlOMAKDVpQih5ygNRmkWeu0jJ3Hsyat26gCcCGBG
7pmGOQMLk6TM8Bik+5PkcDs=
=DKw0
-----END PGP SIGNATURE-----
diff -u pam-keyring-0.0.8/debian/changelog pam-keyring-0.0.8/debian/changelog
--- pam-keyring-0.0.8/debian/changelog
+++ pam-keyring-0.0.8/debian/changelog
@@ -1,3 +1,13 @@
+pam-keyring (0.0.8-6.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * debian/patches/06pam-keyring_change-password.dpatch:
+    - Add an option to pam-keyring-tool for changing the password of a
+      keyring. Patch taken from
+      https://bugs.launchpad.net/gnome-keyring/+bug/54792  
+
+ -- Arjan Oosting <[EMAIL PROTECTED]>  Fri, 27 Apr 2007 01:13:21 +0200
+
 pam-keyring (0.0.8-6) unstable; urgency=low
 
   * debian/patches/05pam-keyring_kfreebsd.dpatch:
diff -u pam-keyring-0.0.8/debian/patches/00list 
pam-keyring-0.0.8/debian/patches/00list
--- pam-keyring-0.0.8/debian/patches/00list
+++ pam-keyring-0.0.8/debian/patches/00list
@@ -5,0 +6 @@
+06pam-keyring_change-password
only in patch2:
unchanged:
--- pam-keyring-0.0.8.orig/config.sub
+++ pam-keyring-0.0.8/config.sub
@@ -4,7 +4,7 @@
 #   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
 #   Inc.
 
-timestamp='2006-09-20'
+timestamp='2007-01-18'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -245,12 +245,12 @@
        | bfin \
        | c4x | clipper \
        | d10v | d30v | dlx | dsp16xx \
-       | fr30 | frv \
+       | fido | fr30 | frv \
        | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
        | i370 | i860 | i960 | ia64 \
        | ip2k | iq2000 \
        | m32c | m32r | m32rle | m68000 | m68k | m88k \
-       | maxq | mb | microblaze | mcore \
+       | maxq | mb | microblaze | mcore | mep \
        | mips | mipsbe | mipseb | mipsel | mipsle \
        | mips16 \
        | mips64 | mips64el \
@@ -324,7 +324,7 @@
        | clipper-* | craynv-* | cydra-* \
        | d10v-* | d30v-* | dlx-* \
        | elxsi-* \
-       | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+       | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
        | h8300-* | h8500-* \
        | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
        | i*86-* | i860-* | i960-* | ia64-* \
@@ -925,6 +925,9 @@
                basic_machine=sh-hitachi
                os=-hms
                ;;
+       sh5el)
+               basic_machine=sh5le-unknown
+               ;;
        sh64)
                basic_machine=sh64-unknown
                ;;
@@ -1219,7 +1222,7 @@
              | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
              | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
              | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-             | -skyos* | -haiku* | -rdos* | -toppers*)
+             | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
        # Remember, each alternative MUST END IN *, to match a version number.
                ;;
        -qnx*)
@@ -1414,6 +1417,9 @@
        m68*-cisco)
                os=-aout
                ;;
+        mep-*)
+               os=-elf
+               ;;
        mips*-cisco)
                os=-elf
                ;;
only in patch2:
unchanged:
--- pam-keyring-0.0.8.orig/config.guess
+++ pam-keyring-0.0.8/config.guess
@@ -4,7 +4,7 @@
 #   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
 #   Inc.
 
-timestamp='2006-07-02'
+timestamp='2007-03-06'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -161,6 +161,7 @@
            arm*) machine=arm-unknown ;;
            sh3el) machine=shl-unknown ;;
            sh3eb) machine=sh-unknown ;;
+           sh5el) machine=sh5le-unknown ;;
            *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
        esac
        # The Operating System including object format, if it has switched
@@ -780,7 +781,7 @@
     i*:CYGWIN*:*)
        echo ${UNAME_MACHINE}-pc-cygwin
        exit ;;
-    i*:MINGW*:*)
+    *:MINGW*:*)
        echo ${UNAME_MACHINE}-pc-mingw32
        exit ;;
     i*:windows32*:*)
@@ -790,12 +791,15 @@
     i*:PW*:*)
        echo ${UNAME_MACHINE}-pc-pw32
        exit ;;
-    x86:Interix*:[3456]*)
-       echo i586-pc-interix${UNAME_RELEASE}
-       exit ;;
-    EM64T:Interix*:[3456]*)
-       echo x86_64-unknown-interix${UNAME_RELEASE}
-       exit ;;
+    *:Interix*:[3456]*)
+       case ${UNAME_MACHINE} in
+           x86) 
+               echo i586-pc-interix${UNAME_RELEASE}
+               exit ;;
+           EM64T | authenticamd)
+               echo x86_64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+       esac ;;
     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
        echo i${UNAME_MACHINE}-pc-mks
        exit ;;
@@ -950,6 +954,9 @@
     x86_64:Linux:*:*)
        echo x86_64-unknown-linux-gnu
        exit ;;
+    xtensa:Linux:*:*)
+       echo xtensa-unknown-linux-gnu
+       exit ;;
     i*86:Linux:*:*)
        # The BFD linker knows what the default object file format is, so
        # first see if it will tell us. cd to the root directory to prevent
@@ -1208,6 +1215,15 @@
     SX-6:SUPER-UX:*:*)
        echo sx6-nec-superux${UNAME_RELEASE}
        exit ;;
+    SX-7:SUPER-UX:*:*)
+       echo sx7-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8:SUPER-UX:*:*)
+       echo sx8-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8R:SUPER-UX:*:*)
+       echo sx8r-nec-superux${UNAME_RELEASE}
+       exit ;;
     Power*:Rhapsody:*:*)
        echo powerpc-apple-rhapsody${UNAME_RELEASE}
        exit ;;
only in patch2:
unchanged:
--- pam-keyring-0.0.8.orig/debian/patches/06pam-keyring_change-password.dpatch
+++ pam-keyring-0.0.8/debian/patches/06pam-keyring_change-password.dpatch
@@ -0,0 +1,199 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 06pam-keyring_change-password.dpatch by Arjan Oosting <[EMAIL PROTECTED]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
[EMAIL PROTECTED]@
+diff -urNad pam-keyring-0.0.8~/ChangeLog pam-keyring-0.0.8/ChangeLog
+--- pam-keyring-0.0.8~/ChangeLog       2006-06-01 19:54:42.000000000 +0200
++++ pam-keyring-0.0.8/ChangeLog        2007-04-27 01:14:40.000000000 +0200
+@@ -1,3 +1,8 @@
++05 June 2006 Jon Nettleton <[EMAIL PROTECTED]>
++      
++      * added pam-keyring-tool -c option which supports gnome-keyring in cvs's
++        ability to change a keyrings password
++
+ 01 June 2006 Jon Nettleton <[EMAIL PROTECTED]>
+       
+       * added detection of older pam libraries that don't support pam_syslog
+diff -urNad pam-keyring-0.0.8~/src/pam-keyring-tool.c 
pam-keyring-0.0.8/src/pam-keyring-tool.c
+--- pam-keyring-0.0.8~/src/pam-keyring-tool.c  2006-04-01 17:38:37.000000000 
+0200
++++ pam-keyring-0.0.8/src/pam-keyring-tool.c   2007-04-27 01:14:40.000000000 
+0200
+@@ -29,12 +29,12 @@
+ #include <glib/gprintf.h>
+ #include <gnome-keyring.h>
+ 
+-/* ============================ PASSWORD_SIZE =============================== 
*/
++//extern char *getpass(const char *);
++/* ============================ AUTHTOK_SIZE =============================== 
*/
+ const size_t PASSWORD_SIZE = 1024;
+ 
+ char *getpass(const char *);
+ 
+-
+ /* ============================ stdin_getpass () 
============================= */
+ /* SIDE AFFECTS: at most size - 1 characters are read from stream and placed
+  *               in stdinpass; terminating carriage return in s is removed
+@@ -43,8 +43,8 @@
+ 
+ static char *stdin_getpass(void)
+ {
+-      char stdinpass[PASSWORD_SIZE];
+-      size_t len;
++        char stdinpass[PASSWORD_SIZE];
++        size_t len;
+ 
+         /*
+          * if no error is reported from fgets() and string at least contains
+@@ -68,7 +68,7 @@
+ 
+ static gchar *get_pass(const gchar *prompt, gboolean opt_use_stdin)
+ {
+-      char *pass = NULL;
++              char *pass = NULL;
+               
+         if (opt_use_stdin) {
+                       pass = stdin_getpass();
+@@ -90,7 +90,7 @@
+       assert(keyring != NULL);
+ 
+       if (password == NULL) {
+-              g_fprintf(stderr, "pam-keyring-tool: error reading password\n");
++              fprintf(stderr, "pam-keyring-tool: error reading authtok\n");
+               result = GNOME_KEYRING_RESULT_BAD_ARGUMENTS;
+               goto _return;
+       }
+@@ -108,13 +108,11 @@
+  */
+ static GnomeKeyringResult pam_keyring_set_default(gchar *keyring)
+ {
+-      GnomeKeyringResult result;
+ 
+       assert(keyring != NULL);
+ 
+-      result = gnome_keyring_set_default_keyring_sync(keyring);
++      return gnome_keyring_set_default_keyring_sync(keyring);
+ 
+-      return result;
+ }
+ 
+ /* ============================ pam_keyring_get_default () 
=========================== */
+@@ -144,14 +142,14 @@
+ static GnomeKeyringResult pam_keyring_unlock(char *keyring, gboolean 
opt_use_stdin)
+ {
+       GnomeKeyringResult result;
+-      char *password = NULL;
++      gchar *password = NULL;
+ 
+       assert(keyring != NULL);
+ 
+       password = get_pass( "Password:", opt_use_stdin);
+ 
+       if (password == NULL) {
+-              g_fprintf(stderr, "pam-keyring-tool: error reading authtok\n");
++              fprintf(stderr, "pam-keyring-tool: error reading authtok\n");
+               result = GNOME_KEYRING_RESULT_IO_ERROR;
+               goto _return;
+       }
+@@ -162,22 +160,71 @@
+               result = pam_keyring_create(keyring, password);
+       }
+ 
+-      memset(password, 0x0, sizeof(password));
++      memset(password, 0x00, PASSWORD_SIZE);
+ _return:
+       return result;
+ }
+       
++/* ============================ pam_keyring_change_password () 
=============================== */
++/* INPUT: name, the name of the keyring, boolean of how to get password
++ * SIDE AFFECT: the keyring is unlocked
++ * OUTPUT: GnomeKeyringResult
++ */
++ 
++static GnomeKeyringResult pam_keyring_change_password(char *keyring, gboolean 
opt_use_stdin)
++{
++      GnomeKeyringResult result;
++      gchar *old_password = NULL;
++      gchar *new_password = NULL;
++      gchar *verify_password = NULL;
++
++      assert(keyring != NULL);
++
++      old_password = g_strdup(get_pass( "Old password:", opt_use_stdin));
++
++      if (old_password == NULL) {
++              result = GNOME_KEYRING_RESULT_IO_ERROR;
++              goto _return;
++      }
++      
++      if ( !opt_use_stdin ) {
++              new_password = g_strdup(get_pass( "New password:", 
opt_use_stdin));
++              verify_password = get_pass( "Verify password:", opt_use_stdin);
++              
++              if (new_password == NULL || strcmp( new_password, 
verify_password)) {
++                      result = GNOME_KEYRING_RESULT_DENIED;
++                      memset(new_password, 0x00, sizeof(new_password));
++                      memset(verify_password, 0x00, sizeof(verify_password));
++                      goto _return;
++              }
++              memset(verify_password, 0x00, sizeof(verify_password));
++      } else {
++              new_password = get_pass( "New password:", opt_use_stdin);
++      }       
++      
++      result = gnome_keyring_change_password_sync(keyring, old_password, 
new_password);
++      
++      memset(old_password, 0x00, sizeof(old_password));
++      g_free(old_password);
++      memset(new_password, 0x00, sizeof(new_password));
++      g_free(new_password);
++      
++_return:
++      return result;
++}
+       
+ static gboolean opt_unlock_keyring = FALSE;
++static gboolean opt_change_password = FALSE;
+ static gboolean opt_getdefault_keyring = FALSE;
+ static gboolean opt_use_stdin = FALSE;
+ static char *keyring = NULL;
+ 
+ GOptionEntry entries[] = {
+       { "unlock", 'u', 0, G_OPTION_ARG_NONE, &opt_unlock_keyring, "Unlock 
Keyring", NULL },
++      { "change", 'c', 0, G_OPTION_ARG_NONE, &opt_change_password, "Change 
Keyring Password", NULL },
+       { "get-default", 'g', 0, G_OPTION_ARG_NONE, &opt_getdefault_keyring, 
"Get Default Keyring", NULL },
+       { "use-stdin", 's', 0, G_OPTION_ARG_NONE, &opt_use_stdin, "Use stdin 
for Password Prompt", NULL },
+-      { "keyring", 0, 0, G_OPTION_ARG_STRING, &keyring, "Name of Keyring", 
"name" },
++      { "keyring", 'k', 0, G_OPTION_ARG_STRING, &keyring, "Name of Keyring", 
"name" },
+       { NULL }
+ };
+ 
+@@ -198,7 +245,7 @@
+                       goto _error;
+               }
+               if (opt_getdefault_keyring) {
+-                      g_fprintf(stdout, "keyring: %s\n", keyring);
++                      g_fprintf(stdout,  "keyring: %s\n", keyring);
+                       goto _exit;
+               }
+               if ( !keyring) {
+@@ -207,7 +254,16 @@
+               }
+       }
+       
+-      if (opt_unlock_keyring && ! opt_getdefault_keyring) {
++      if (opt_change_password) {
++              if (pam_keyring_change_password(keyring, opt_use_stdin) != 
GNOME_KEYRING_RESULT_OK) {
++                      error = g_strdup_printf("error changing the password 
for the %s keyring", keyring);
++                      goto _error;
++              }
++              goto _exit;
++      }
++              
++      
++      if (opt_unlock_keyring) {
+               if (pam_keyring_unlock(keyring, opt_use_stdin) != 
GNOME_KEYRING_RESULT_OK) {
+                       error = g_strdup_printf("error unlocking the %s 
keyring", keyring);
+                       goto _error;

Reply via email to