It seems we need some patches to get accountsservice to build on FreeBSD. I have sent them to Matthias Clasen and Ray Strode personally, but they are rather busy at the moment, so I'm throwing them into Bugzilla. :-)
Created attachment 52295 [details] [review] [PATCH 1/4] Make use of utmpx optional and buildable on FreeBSD.
Created attachment 52296 [details] [review] [PATCH 2/4] Make use of <shadow.h> optional.
Created attachment 52297 [details] [review] [PATCH 3/4] Use <sys/wait.h>.
Created attachment 52298 [details] [review] [PATCH 4/4] Don't use the non-standard fgetpwent() if not available.
These look all fine to me, committed.
Hey, I had to revert PATCH 4/4. getpwent isn't right, we really only want local users. I think in order for freebsd to work, we're going to need to get local users in some freebsd specific way (or potentially fallback to parsing /etc/passwd manually)
Hi Ray, (In reply to comment #6) > Hey, I had to revert PATCH 4/4. getpwent isn't right, we really only want > local users. > > I think in order for freebsd to work, we're going to need to get local users in > some freebsd specific way (or potentially fallback to parsing /etc/passwd > manually) I'm not aware of any proper API for this. Applications normally shouldn't try to make a distinction between a local and a non-local user. I guess you'd better send an email to questions@FreeBSD.org or hackers@FreeBSD.org to get a good answer, but here are some random notes I can give you: - Don't parse /etc/passwd. On FreeBSD, /etc/passwd only exists for compatibility for broken scripts that really have to parse a plain-text file. - The easiest thing to do, is to open /etc/pwd.db. This file is a Berkeley DB (see dbopen(3)). I don't have an internet connection at home right now (recently moved abroad, still waiting to get connected), so unfortunately I can't do a lot of open source hacking right now. Sorry!
Created attachment 95754 [details] [review] daemon: emulate fgetpwent() if we don't have it We use fgetpwent directly on /etc/passwd in order to ensure we only get a list of local users (and not ones from the network directory service). Unfortunately, this function is not commonly found on non-GNU systems. Provide our own implementation of fgetpwent if the operating system does not provide it.
Comment on attachment 52297 [details] [review] [PATCH 3/4] Use <sys/wait.h>. Review of attachment 52297 [details] [review]: ----------------------------------------------------------------- This patch looks good.
(In reply to comment #9) > This patch looks good. Er, wrong window...
Patch looks good to me too, fwiw.
No real comments on the implementation. If it works, it's probably good enough! I would just name it fgetpwent though, rather than add the as_ namespace in front. Aside from the fact that none of the other daemon code has an as_ prefix, I think i'd like this to be a "tranparently fix the platform" type thing (kind of like glib does for printf functions)
Created attachment 95816 [details] [review] daemon: emulate fgetpwent() if we don't have it Changes as requested. Please apply whichever one you prefer.
Thanks for the merge!
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.