Description: Remove user cache files if user account no longer exists Bug-Ubuntu: https://launchpad.net/bugs/1259562 Forwarded: https://bugs.freedesktop.org/72596 Author: Robert Ancell --- accountsservice-0.6.35.orig/src/daemon.c 2013-10-15 22:25:19.000000000 +0200 +++ accountsservice-0.6.35/src/daemon.c 2013-12-11 10:25:41.235730180 +0100 @@ -371,15 +371,21 @@ /* Only load files in this directory */ filename = g_build_filename (USERDIR, name, NULL); regular = g_file_test (filename, G_FILE_TEST_IS_REGULAR); - g_free (filename); if (regular) { pwent = getpwnam (name); - if (pwent == NULL) - g_debug ("user '%s' in cache dir but not present on system", name); - else + if (pwent == NULL) { + g_debug ("user '%s' in cache dir but not present on system, removing", name); + g_remove (filename); + g_free (filename); + } + else { + g_free (filename); return pwent; + } } + else + g_free (filename); } /* Last iteration */