We currently hardcode a argv list to useradd and other commands more or less smack in the middle of a bunch of other code. Trouble is that the required commands are different on Debian-based systems and different again on BSD. I think we should split out a separate file with add_user() rm_user() etc. functions which construct the argv the way each system likes it. That way we can add cases for various systems and keep the #ifdef mess well-contained. Some vendor patches to look at: Debian: http://patch-tracker.debian.org/patch/series/view/accountsservice/0.6.21-8/0002-create-and-manage-groups-like-on-a-debian-system.patch BSD: http://www.marcuscom.com:8080/viewvc/viewvc.cgi/marcuscom/ports/trunk/sysutils/accountsservice/files/patch-src_daemon.c?revision=17112&view=markup
I was looking at a patch that would check for the existence of adduser which is the required command on Debian-based systems. However, Fedora provides adduser as a symlink to useradd, so it couldn't be runtime checked easily.
Created attachment 136352 [details] [review] Support Debian based user management It's not beautiful but I think this better reflects how A-S is being used. This allows BSD etc to add a similar change for the method they need. We can always come up with a nicer abstraction in the future but I haven't been able to think of one.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/accountsservice/accountsservice/issues/38.
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.