This is a forward of the Ubuntu bug https://launchpad.net/bugs/1259562 The guest session feature provided by lightdm has resulted in files for deleted temporary guest users being kept in the cache dir. To fix this, we are about to patch src/daemon.c so it deletes such files, and not just reports their existence in the log. Since users may be deleted in a number of various ways without accountsservice being notified, we think it would be a good idea to make this change upstream.
Created attachment 90603 [details] [review] Clean up cache dir
don't you need to clean up the icon too? Aside from that, I wonder if we'll run into bug reports after this where users lose their settings after a domain controller blip. Maybe it should avoid cleaning up remote users?
Right, it's logical to clean up the icon as well. (Guest users typically don't bother with icons, which explains why I missed it.) Maybe checking errno would provide sufficient safety? errno = 0; pwent = getpwnam (name); if (pwent == NULL && errno == 0) {
From "man getpwnam": RETURN VALUE The getpwnam() and getpwuid() functions return a pointer to a passwd structure, or NULL if the matching entry is not found or an error occurs. If an error occurs, errno is set appropriately.
Created attachment 90679 [details] [review] Clean up cache dir 2 Attaching a new patch in accordance with comment #3.
I like this patch. Two requests, if you don't mind: 1) Can you make it in git-format-patch format so it has a commit message, etc ? 2) Can you do one preliminary clean up patch before this one that moves the existing cases where the cache files are removed into a standalone function, then change this patch to call that function? This sort of clean up is repeated in two places already, it'd be good to drop the duplication rather than add a third place.
Created attachment 90741 [details] [review] Clean up cache dir 3 I chose to modify the patch so it makes use of a standalone function. Sorry, but I'm not enough familiar with git, so I leave it to you to convert the patch into the desired format.
Created attachment 93452 [details] [review] Move cache cleanup out into a common function and clean up icon too I did as Ray suggested. Also I passed --author to pretend that Gunnar wrote the git patches. If you find that objectionable, set it to me.
Created attachment 93453 [details] [review] On startup, clean out the data of removed users
Seems these patches have been forgotten....
I've cleaned up and applied these patches to master.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.