NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: lib/47293: innetgr(3) failed to match correctly
The following reply was made to PR lib/47293; it has been noted by GNATS.
From: Wolfgang Stukenbrock <wolfgang.stukenbrock%nagler-company.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: lib/47293: innetgr(3) failed to match correctly
Date: Fri, 07 Dec 2012 15:28:49 +0100
Hi again,
even with the patch send before, there is still a differens in matching
against the Solaris version.
Again the short-Cur ist the source of the problem ....
If there is an entry (-,blub,) in the netgroup on Solaris
innetgr(<ngr>, NULL, "blub", "xxx") will match but the NetBSD version
will not match.
The problem is, that in this case we have checked for "blub.xxx" in
netgroup.byuser but the relevant entry there is "blub.*".
So we also need to check for an entry without domainname, even if we got
a domainname.
This modified patch will solve this problem too:
diff -u -r1.1 getnetgrent.c
--- getnetgrent.c 2012/12/07 13:02:55 1.1
+++ getnetgrent.c 2012/12/07 14:26:16
@@ -795,16 +795,29 @@
*retval = 1;
return NS_SUCCESS;
}
+ /* If a domainname is given, we would have found a match */
+ if (domain != NULL) {
+ if (in_lookup(grp, host, NULL, _NG_KEYBYHOST)) {
+ *retval = 1;
+ return NS_SUCCESS;
+ }
+ *retval = 0;
+ return NS_SUCCESS;
+ }
} else if (host == NULL && user != NULL) {
if (in_lookup(grp, user, domain, _NG_KEYBYUSER)) {
*retval = 1;
return NS_SUCCESS;
}
- }
- /* If a domainname is given, we would have found a match */
- if (domain != NULL) {
- *retval = 0;
- return NS_SUCCESS;
+ /* If a domainname is given, we would have found a match */
+ if (domain != NULL) {
+ if (in_lookup(grp, user, NULL, _NG_KEYBYUSER)) {
+ *retval = 1;
+ return NS_SUCCESS;
+ }
+ *retval = 0;
+ return NS_SUCCESS;
+ }
}
/* Too bad need the slow recursive way */
gnats-admin%NetBSD.org@localhost wrote:
> Thank you very much for your problem report.
> It has the internal identification `lib/47293'.
> The individual assigned to look at your
> report is: lib-bug-people.
>
>
>>Category: lib
>>Responsible: lib-bug-people
>>Synopsis: innetgr(3) failed to match correctly
>>Arrival-Date: Fri Dec 07 13:05:00 +0000 2012
>>
Home |
Main Index |
Thread Index |
Old Index