After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 356897 - infinite loop when creating a keyring with an existant name
infinite loop when creating a keyring with an existant name
Status: RESOLVED FIXED
Product: gnome-keyring
Classification: Core
Component: general
0.6.x
Other Linux
: Normal major
: ---
Assigned To: GNOME keyring maintainer(s)
GNOME keyring maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2006-09-20 12:52 UTC by Sebastien Bacher
Modified: 2007-01-04 19:57 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
patch to fix the issue (1.15 KB, patch)
2006-09-20 12:56 UTC, Sebastien Bacher
accepted-commit_now Details | Review

Description Sebastien Bacher 2006-09-20 12:52:55 UTC
That bug has been opened on https://launchpad.net/distros/ubuntu/+source/gnome-keyring/+bug/60765

"...
Here is the trace below.

(gdb) thread apply all bt

Thread 1 (Thread 47598724759328 (LWP 6312))

  • #0 access
    from /lib/libc.so.6
  • #1 IA__g_file_test
    at gfileutils.c line 282
  • #2 ??
  • #3 ??
  • #0 access
    from /lib/libc.so.6

I think I've spotted where the problem is. Somehow I already had a (broken) default.keyring file, and in the gnome-keyring-daemon, it loops looking for a defaultX.keyring, where X is a version number.

Source file : gnome-keyring-daemon-file.c, lines 194 through 205.

        version = 0;
        do {
                if (version == 0) {
                        filename = g_strdup_printf ("%s.keyring", base);
                } else {
                        filename = g_strdup_printf ("%s%d.keyring", base, version);
                }

                path = g_build_filename (dir, filename, NULL);

                g_free (filename);
        } while (g_file_test (path, G_FILE_TEST_EXISTS));

Unfortunately, there's no incrementation of the "version" integer in that loop, so it might be looping forever if there's already such a file (as version always ==0). A simple patch would be to increment the version number at the end of loop corpse.
..."
Comment 1 Sebastien Bacher 2006-09-20 12:56:12 UTC
Created attachment 73084 [details] [review]
patch to fix the issue
Comment 2 Stef Walter 2007-01-04 19:57:49 UTC
Thanks. Committed. 

2007-01-04  Sebastien Bacher  <seb128@ubuntu.com>

	* gnome-keyring-daemon-file.c: (get_default_keyring_file_for_name):
	fix infinite loop when creating a keyring with an already existant
	name, issue pointed by "Yachar" on https://launchpad.net/bugs/60765
	(Closes: bug #356897)