provide non-standard getgrouplist() in libnfsidmap when need be
Subsystems (2)
PATCH 1/1 provide non-standard getgrouplist() in libnfsidmap when need be
libnfsidmap uses the non-standard function getgrouplist() ... the attached patch takes code from FreeBSD to implement the function based on POSIX functions when the system libc is not sufficient
-mike
configure.in +1 -1
@@ -38,7 +38,7 @@ # Checks for library functions. AC_FUNC_MALLOC -AC_CHECK_FUNCS([strchr strdup]) +AC_CHECK_FUNCS([strchr strdup getgrouplist]) AC_CONFIG_FILES([Makefile]) AC_OUTPUT(libnfsidmap.pc)
nss.c +2 -0
@@ -49,6 +49,8 @@#include "cfg.h" #include <syslog.h> +#include "getgrouplist.c" +/* * NSS Translation Methods *
getgrouplist.c +85 -0
85 lines not on this page · raw message
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
Quoted 4 lines · Mike Frysinger
libnfsidmap uses the non-standard function
getgrouplist()... the attached patch takes code from FreeBSD to implement the function based on POSIX functions when the system libc is not sufficient
-mike
Why not just modify libnfsidmap to directly use the posix functions?
Cheers
Trond
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
Quoted 7 lines · Trond Myklebust
Quoted 4 lines · Mike Frysinger
libnfsidmap uses the non-standard function
getgrouplist()... the attached patch takes code from FreeBSD to implement the function based on POSIX functions when the system libc is not sufficient
-mikeWhy not just modify libnfsidmap to directly use the posix functions?
The traditional way of fetching the list of user groups is to enumerate the entire group database, and then add the groups that the user is a member of. This is *very* slow on systems with a large number of users and groups. Many NSS backends, such as nss_ldap, provides a faster API, which uses smart LDAP queries instead. initgroups() uses this, and perhaps also getgroups(). (If not, it needs a fix.)
(As a side note, there's a lot of software out there which enumerates groups the slow way. This includes the OpenSSH server, so if you activate the AllowGroups configuration directive, SSH logins takes forever on large systems.)
Regards,
---
Peter Åstrand ThinLinc Chief Developer
Cendio AB http://www.cendio.se
Teknikringen 3
583 30 Linköping Phone: +46-13-21 46 00
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
T24gTW9uLCAyMDA3LTAzLTI2IGF0IDE2OjMyICswMjAwLCBQZXRlciDDhXN0cmFuZCB3cm90ZToK PiBPbiBNb24sIDI2IE1hciAyMDA3LCBUcm9uZCBNeWtsZWJ1c3Qgd3JvdGU6Cj4gCj4gPiBPbiBT dW4sIDIwMDctMDMtMjUgYXQgMDM6MjkgLTA0MDAsIE1pa2UgRnJ5c2luZ2VyIHdyb3RlOgo+ID4g PiBsaWJuZnNpZG1hcCB1c2VzIHRoZSBub24tc3RhbmRhcmQgZnVuY3Rpb24gZ2V0Z3JvdXBsaXN0 KCkgLi4uIHRoZSBhdHRhY2hlZCAKPiA+ID4gcGF0Y2ggdGFrZXMgY29kZSBmcm9tIEZyZWVCU0Qg dG8gaW1wbGVtZW50IHRoZSBmdW5jdGlvbiBiYXNlZCBvbiBQT1NJWCAKPiA+ID4gZnVuY3Rpb25z IHdoZW4gdGhlIHN5c3RlbSBsaWJjIGlzIG5vdCBzdWZmaWNpZW50Cj4gPiA+IC1taWtlCj4gPiAK PiA+IFdoeSBub3QganVzdCBtb2RpZnkgbGlibmZzaWRtYXAgdG8gZGlyZWN0bHkgdXNlIHRoZSBw b3NpeCBmdW5jdGlvbnM/Cj4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2lkIGludG8gYSBncm91cCBuYW1lCm9yIHZpY2UgdmVyc2EgYW5kIHRoZW4gc3R1ZmYgdGhl IHJlc3VsdCBpbnRvIGEga2VybmVsIGNhY2hlLgoKSU9XOiBpdCBzaG91bGQgYmUganVzdCBmaW5l IHRvIGNhbGwgZ2V0Z3JnaWQoKSBvciBnZXRncm5hbSgpIGluIHRoZQphcHByb3ByaWF0ZSBwbGFj ZXMuCgpDaGVlcnMKICBUcm9uZAoKCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KVGFrZSBTdXJ2ZXlzLiBFYXJu IENhc2guIEluZmx1ZW5jZSB0aGUgRnV0dXJlIG9mIElUCkpvaW4gU291cmNlRm9yZ2UubmV0J3Mg VGVjaHNheSBwYW5lbCBhbmQgeW91J2xsIGdldCB0aGUgY2hhbmNlIHRvIHNoYXJlIHlvdXIKb3Bp bmlvbnMgb24gSVQgJiBidXNpbmVzcyB0b3BpY3MgdGhyb3VnaCBicmllZiBzdXJ2ZXlzLWFuZCBl YXJuIGNhc2gKaHR0cDovL3d3dy50ZWNoc2F5LmNvbS9kZWZhdWx0LnBocD9wYWdlPWpvaW4ucGhw JnA9c291cmNlZm9yZ2UmQ0lEPURFVkRFVgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fXwpORlMgbWFpbGxpc3QgIC0gIE5GU0BsaXN0cy5zb3VyY2Vmb3JnZS5u ZXQKaHR0cHM6Ly9saXN0cy5zb3VyY2Vmb3JnZS5uZXQvbGlzdHMvbGlzdGluZm8vbmZzCg==
Quoted 3 lines · Trond Myklebust
We're not after the full list of user groups or the group entries. libnfsidmap exists purely in order to map a single gid into a group name or vice versa and then stuff the result into a kernel cache.
Not currently true, because we're also using libnfsidmap to do the krb principal -> (uid, gid's) mapping--my mistake.
We should split that code out from libnfsidmap and stick it back into rpc.svcgssd where it came from.
--b.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
Quoted 6 lines · Trond Myklebust
Quoted 3 lines · Mike Frysinger
libnfsidmap uses the non-standard function
getgrouplist()... the attached patch takes code from FreeBSD to implement the function based on POSIX functions when the system libc is not sufficientWhy not just modify libnfsidmap to directly use the posix functions?
tbh, it doesnt matter to me how it gets fixed ... whether the direction is to not use getgrouplist() at all and just use the POSIX funcs, or to use the patch i posted, or ... my motivation here is purely from a distro package maintainer, i dont actually use libnfsidmap ;)
-mike
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs