Package: consolekit
Version: 0.2.10-1
Severity: grave
Tags: patch
User: [EMAIL PROTECTED]
Usertags: origin-ubuntu ubuntu-patch intrepid

Hi Michael,

thanks for 0.2.10-1, it is a great release. I just noticed a small bug
in the "clean /var/run/console/" patch, if the directory does not
exist at all, it crashes with:

$ sudo console-kit-daemon --debug --no-daemon
console-kit-daemon[6206]: DEBUG: Debugging enabled
console-kit-daemon[6206]: DEBUG: initializing console-kit-daemon 0.2.10
console-kit-daemon[6206]: DEBUG: Cleaning up /var/run/console
console-kit-daemon[6206]: GLib-WARNING: GError set over the top of a previous 
GError or uninitialized memory.
This indicates a bug in someone's code. You must ensure an error is NULL before 
it's set.
The overwriting error message was: Error opening directory '/var/run/console': 
No such file or directory
Segmentation fault

I fixed the GError handling in attached patch, and also demoted
g_warning to g_debug, since it is not an error at all if
/var/run/console/ does not exist at startup (e. g. if you enabled
RAMRUN in /etc/default/rcS).

Thanks,

Martin

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
  * 03-cleanup_console_tags.patch: Properly initialize GError to avoid daemon
    crash if /var/run/console/ does not exist. Also, demote message about it
    from warning to debug, since it is not an error condition at all.
--- consolekit-0.2.10/debian/patches/03-cleanup_console_tags.patch
+++ consolekit-0.2.10/debian/patches/03-cleanup_console_tags.patch
@@ -12,14 +12,14 @@
 +delete_console_tags (void)
 +{
 +      GDir *dir;
-+      GError *error;
++      GError *error = NULL;
 +      const gchar *name;
 +
 +      g_debug ("Cleaning up %s", CONSOLE_TAGS_DIR);
 +
 +      dir = g_dir_open (CONSOLE_TAGS_DIR, 0, &error);
 +      if (dir == NULL) {
-+              g_warning ("Couldn't open directory %s: %s", CONSOLE_TAGS_DIR,
++              g_debug ("Couldn't open directory %s: %s", CONSOLE_TAGS_DIR,
 +                         error->message);
 +              g_error_free (error);
 +              return;

Attachment: signature.asc
Description: Digital signature

Reply via email to