Bug 91612

Summary: cached users list not reload immediately when user deleted
Product: accountsservice Reporter: Leslie Zhai <xiangzhai83>
Component: generalAssignee: Matthias Clasen <mclasen>
Status: RESOLVED NOTOURBUG QA Contact:
Severity: normal    
Priority: medium CC: marius.vollmer, qatesting2525, rstrode, stefw
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: delete-user-reload-users.patch

Description Leslie Zhai 2015-08-12 03:33:38 UTC
Created attachment 117634 [details]
delete-user-reload-users.patch

Hi AccountsService developers,

I am developing kuseraccount for KDE5 https://github.com/xiangzhai/kuseraccount and I choose AccountsService for user management.

When I deleted a user via kuseraccount or gnome-control-center`s user-accounts, the cached users list not reload immediately: the user deleted was still in there!

So I just reload_users after deleted user successfully to force reload cached users list removing old (deleted) users.

Please pay some attention to my patch and give me some advice, thanks a lot!
Comment 1 Ray Strode [halfline] 2015-08-12 14:28:08 UTC
that shouldn't be neccessary. when then user is deleted file monitors should queue a reload.

what version of glib do you have? you're probably hitting 

https://bugzilla.gnome.org/show_bug.cgi?id=751358
Comment 2 Leslie Zhai 2015-08-13 01:18:27 UTC
(In reply to Ray Strode [halfline] from comment #1)
> that shouldn't be neccessary. when then user is deleted file monitors should
> queue a reload.

Yes, I noticed there are file monitors setup for /etc/passwd,  /etc/shadow, /etc/group and so on http://cgit.freedesktop.org/accountsservice/tree/src/daemon.c#n522

Even that queue_reload_users_soon http://cgit.freedesktop.org/accountsservice/tree/src/daemon.c#n446

But I still experienced 'zombie' user: created a user named 'test', then deleted it, but it was still in the cached users list!
https://twitter.com/xiangzhai/status/631634994192973824

So I just add reload_users after deleted user successfully to force reload cached users list removing old (deleted) users.

> 
> what version of glib do you have? you're probably hitting 

2.45.3

Thanks for your advice, I will follow relative issue ;-)

> 
> https://bugzilla.gnome.org/show_bug.cgi?id=751358

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.