Date sent: Wed, 11 Mar 1998 15:14:26 +0100 From: Sven Paulus To: inn-patches@vix.com Subject: little bugfix to "LIST ACTIVE" Hi, nnrpd shows a little odd behaviour when access to hierarchies is restricted from within nnrpd.access: doing a "LIST ACTIVE group.name" the group's values are displayed even if you don't have access at all to this group. This only happens if "group.name" is the name of an existing group and not a wildmatch-pattern and is caused by a little short cut for this case in nnrpd/command.c. This bug was first described by Bettina Fink on the German Newsmasters Mailing List. I think, the following few lines should fix this (it's against 1.7.2-insync, this might cause a little line offset): --- commands.c.orig Tue Dec 9 00:48:50 1997 +++ commands.c Sun Mar 1 21:29:22 1998 @@ -309,6 +309,7 @@ static time_t last_time; time_t now; (void)time(&now); + lp = &INFOactive; if (ac < 3 || now > last_time + NNRP_RESCAN_DELAY * 3) { if (last_time && !GetGroupList()) { syslog(L_NOTICE, "%s cant getgroupslist for list %m", ClientHost); @@ -320,15 +321,19 @@ if (ac == 3) { GROUPENTRY *gp = GRPfind(av[2]); if (gp) { - Reply("%d list:\r\n", NNTP_LIST_FOLLOWS_VAL); - Printf("%s %ld %ld %c%s\r\n.\r\n", - gp->Name, (long)gp->High, (long)gp->Low, - gp->Flag, gp->Alias ? gp->Alias : ""); + grplist[0] = av[2]; + grplist[1] = NULL; + Reply("%d %s.\r\n", NNTP_LIST_FOLLOWS_VAL, lp->Format); + if (PERMmatch(PERMdefault, PERMlist, grplist)) + Printf("%s %ld %ld %c%s\r\n.\r\n", + gp->Name, (long)gp->High, (long)gp->Low, + gp->Flag, gp->Alias ? gp->Alias : ""); + else + Printf(".\r\n"); return; } wildarg = av[2]; } - lp = &INFOactive; } else if (caseEQ(p, "active.times")) lp = &INFOactivetimes; Sven -- --Sven-Paulus----------28-48-32--3-----ub6v@rz.uni-karlsruhe.de------ --Karlstr.-55----------30--2-50-29-----sven@oops.sub.de-------------- --D-76133-Karlsruhe----44-49-10--8-----T#-49-721-9375094---------irc- --PGP-ID-3C9A6091-------9-12-19-71-----F#-49-721-9375095-----svennie-