Summary: | [PATCH] Remove user cache files if user account no longer exists | ||
---|---|---|---|
Product: | accountsservice | Reporter: | Gunnar Hjalmarsson <gunnarhj> |
Component: | general | Assignee: | Matthias Clasen <mclasen> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | medium | CC: | iain, marius.vollmer, mcatanzaro, rstrode, stefw |
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
Clean up cache dir
Clean up cache dir 2 Clean up cache dir 3 Move cache cleanup out into a common function and clean up icon too On startup, clean out the data of removed users |
Description
Gunnar Hjalmarsson
2013-12-11 11:56:14 UTC
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.