Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 678318 - nss_nis client generates refused connect to procedure ypproc_match errors on NIS server
nss_nis client generates refused connect to procedure ypproc_match errors on ...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: glibc (Show other bugs)
5.6
All Linux
medium Severity medium
: rc
: ---
Assigned To: Jeff Law
qe-baseos-tools
: Patch
Depends On:
Blocks: 719046 668957 679848 731391
  Show dependency treegraph
 
Reported: 2011-02-17 10:04 EST by Jeff Bastian
Modified: 2016-11-24 11:11 EST (History)
6 users (show)

See Also:
Fixed In Version: glibc-2.5-67
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 731391 (view as bug list)
Environment:
Last Closed: 2012-02-21 01:32:59 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch for ADJUNCT_AS_SHADOW (11.61 KB, patch)
2011-02-17 10:04 EST, Jeff Bastian
no flags Details | Diff
patch for ADJUNCT_AS_SHADOW modified (11.12 KB, patch)
2011-05-31 17:35 EDT, Jeff Bastian
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0260 normal SHIPPED_LIVE glibc bug fix update 2012-02-20 10:06:42 EST

  None (edit)
Description Jeff Bastian 2011-02-17 10:04:54 EST
Created attachment 479346 [details]
patch for ADJUNCT_AS_SHADOW

Description of problem:
The nss_nis client code in glibc tries to read the passwd.adjunct table if it sees ##username in the password field of a passwd entry.  The passwd.adjunct table is typically restricted on the NIS server to privileged ports from the client, so normal users cannot read the passwd.adjunct table.  The NIS server logs an error if a normal user (coming from a port >1024) tries to read passwd.adjunct:
  Feb 16 22:55:00 vm116 ypserv[2722]: refused connect from 10.12.58.117:34419
  to procedure ypproc_match (foonis,passwd.adjunct.byname;-1) 

Every time a normal user needs to look up a username, e.g., 'id', 'ls -l', 'ps aux', and more, the server logs this error message.

In addition to filling up the NIS server logs with these messages, it also hurts performance on the NIS clients since they're doing needless lookups.

An upstream patch added an ADJUNCT_AS_SHADOW feature to glibc:
    http://sourceware.org/bugzilla/show_bug.cgi?id=11134
    http://sourceware.org/git/?p=glibc.git;a=commit;h=71170aa0a956c59d8bad0cf6f5ed31d78c90e332

This feature solves both problems -- error logs and performance -- by only looking at passwd.adjunct when it's actually necessary, i.e., during authentication.


Version-Release number of selected component (if applicable):
glibc-2.5-58

How reproducible:
every time

Steps to Reproduce:
1. configure a NIS server to use passwd.adjunct tables for encrypted passwords
     https://access.redhat.com/kb/docs/DOC-44987
2. configure the NIS client to use the server
3. login as a regular user
4. run some commands like 'id' and 'ls -l' as the regular user while watching /var/log/messages on the NIS server
  
Actual results:
many errors 'refused connect from IP:PORT to procedure ypproc_match' in the logs

Expected results:
no errors

Additional info:
Comment 4 Jeff Bastian 2011-05-31 17:32:36 EDT
There are two identical chunks of the patch that are not valid anymore:

-  buffer[len] = '\0';
+  if (__builtin_expect (adjunct_used, false))
+    /* This is an ugly trick.  The format of passwd.adjunct.byname almost
+       matches the shadow.byname format except that the last two fields
+       are missing.  Synthesize them by marking them empty.  */
+    strcpy (&buffer[len], "::");
+  else
+    buffer[len] = '\0';


Solaris now uses 9 fields in shadow and passwd.adjunct just like Linux.
http://download.oracle.com/docs/cd/E18752_01/html/816-5174/shadow-4.html
Comment 5 Jeff Bastian 2011-05-31 17:35:36 EDT
Created attachment 502123 [details]
patch for ADJUNCT_AS_SHADOW modified

Here is an updated patch without the "dirty trick" to add two colons to the passwd.adjunct entries.

It works for me with 8 colons in the table:

[root@localhost ~]# ypmatch ralph passwd.adjunct.byname
ralph:REDACTED:::::::
[root@localhost ~]# ypmatch ralph passwd.adjunct.byname | awk -F: '{print NF}'
9
[root@localhost ~]# ssh ralph@localhost
ralph@localhost's password: 
Last login: Tue May 31 16:27:01 2011 from localhost.localdomain
[ralph@localhost ~]$
Comment 8 errata-xmlrpc 2012-02-21 01:32:59 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0260.html

Note You need to log in before you can comment on or make changes to this bug.