getgrouplist implementation compatible with kdelibs?
Thiago Macieira
thiago at kde.org
Wed Apr 15 07:32:25 BST 2009
Adriaan de Groot wrote:
>Does someone have an LGPL compatible implementation of getgrouplist()? I
>imagine one from glibc would do. Something that can be added to
> kdefakes, in any case, because Solaris doesn't have getgrouplist and
> the FreeBSD implementation I have handy is 4-clause BSD licensed
> (strange, I thought the 4-clause had been removed by the UCB years
> ago).
>
>Given such an implementation, I can make
> ./kio/kfile/kpropertiesdialog.cpp compile again on non-Linux,
> non-FreeBSD but still-UNIX platforms.
CONFORMING TO
This function is non-standard; it appears on most BSDs.
I suggest instead that you add a CMake-time check for this function's
existence. If it's not present, then we have to call getpwnam(3) to get
the UID and main GID, then iterate over getgrent(3) to get all groups to
which this user is present.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20090415/31f56efc/attachment.sig>
More information about the kde-core-devel
mailing list