diff options
author | Volker Lendecke <vl@samba.org> | 2009-08-08 13:42:55 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2009-08-08 13:44:31 +0200 |
commit | e8088e16f812d682e08ad558865d0cc6eab2ad9c (patch) | |
tree | 0b749d1343692a457de44699a4d94785a0e1ea91 | |
parent | e1a95e7961a4ffe67ee7abe61faad0e7e65417d6 (diff) | |
download | samba-e8088e16f812d682e08ad558865d0cc6eab2ad9c.tar.gz samba-e8088e16f812d682e08ad558865d0cc6eab2ad9c.tar.bz2 samba-e8088e16f812d682e08ad558865d0cc6eab2ad9c.zip |
Make wbinfo also print the members when querying a group
-rw-r--r-- | nsswitch/wbinfo.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/nsswitch/wbinfo.c b/nsswitch/wbinfo.c index 5dd96f9ac0..ac5b4c4395 100644 --- a/nsswitch/wbinfo.c +++ b/nsswitch/wbinfo.c @@ -233,17 +233,25 @@ static bool wbinfo_get_groupinfo(const char *group) { wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE; struct group *grp; + char **mem; wbc_status = wbcGetgrnam(group, &grp); if (!WBC_ERROR_IS_OK(wbc_status)) { return false; } - d_printf("%s:%s:%u\n", + d_printf("%s:%s:%u:", grp->gr_name, grp->gr_passwd, (unsigned int)grp->gr_gid); + mem = grp->gr_mem; + while (*mem != NULL) { + d_printf("%s%s", *mem, *(mem+1) != NULL ? "," : ""); + mem += 1; + } + d_printf("\n"); + wbcFreeMemory(grp); return true; @@ -254,17 +262,25 @@ static bool wbinfo_get_gidinfo(int gid) { wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE; struct group *grp; + char **mem; wbc_status = wbcGetgrgid(gid, &grp); if (!WBC_ERROR_IS_OK(wbc_status)) { return false; } - d_printf("%s:%s:%u\n", + d_printf("%s:%s:%u:", grp->gr_name, grp->gr_passwd, (unsigned int)grp->gr_gid); + mem = grp->gr_mem; + while (*mem != NULL) { + d_printf("%s%s", *mem, *(mem+1) != NULL ? "," : ""); + mem += 1; + } + d_printf("\n"); + wbcFreeMemory(grp); return true; |