Bug 7499 - nss_wins overwrites syslog ident of some daemons
Summary: nss_wins overwrites syslog ident of some daemons
Alias: None
Product: Samba 3.5
Classification: Unclassified
Component: Winbind (show other bugs)
Version: 3.5.3
Hardware: All Linux
: P3 normal
Target Milestone: ---
Assignee: Michael Adam
QA Contact: Samba QA Contact
URL: https://qa.mandriva.com/show_bug.cgi?...
Depends on:
Reported: 2010-06-07 14:58 UTC by Buchan Milne
Modified: 2017-07-16 22:35 UTC (History)
3 users (show)

See Also:

Current patch from mandriva packaging svn (959 bytes, patch)
2010-06-07 15:00 UTC, Buchan Milne
no flags Details
Slightly cleaner patch (892 bytes, patch)
2010-06-07 15:28 UTC, Buchan Milne
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Buchan Milne 2010-06-07 14:58:40 UTC
Similar to bug #4831, nss_wins also clobbers the indent of daemons which have managed to invoke it.

Since the cifs-utils version of mount.cifs no longer does SMB host lookups, it now seems necessary to require nss_wins, so more users will be affected by this (assuming many users have hosts that require connecting with the server name, and not all have working DNS, as is common in non-AD environments).

The problem is triggered in any process which has had to invoke nss_wins at any time (e.g. DNS has not succeeded in resolving a host name), and subsequently logs. I have personally seen it in openvpn on my laptop, the Mandriva bug reporter sees it in ntpd since his resolv.conf points at the local named, which starts after ntpd.

The easiest way to reproduce this is as follows:
1)Install nss_wins
2)Ensure that nss_wins is invoked, e.g. put 'wins' before 'dns' in the hosts line in nsswitch.conf
3)Start a daemon that will invoke nss_wins (e.g. needs a dns lookup) and that logs to syslog. A good candidate here is ntpd (using say 'server pool.ntp.org').

You'll notice messages obviously from ntpd being tagged as from nss_wins, e.g.:

Jun  7 20:38:20 tiger nss_wins[17464]: frequency initialized -45.638 PPM from /var/lib/ntp/drift

With the attached patch, you get the expected behaviour:
Jun  7 20:39:39 tiger ntpd[18984]: frequency initialized -45.638 PPM from /var/lib/ntp/drift

I note that there seem to be bug reports on this same issue on other Linux distros:

as well as having been complained about on postfix and sendmail mailing lists (but, afaict, no upstream bug report yet).

A patch is available in Mandriva packaging svn:
Comment 1 Buchan Milne 2010-06-07 15:00:10 UTC
Created attachment 5766 [details]
Current patch from mandriva packaging svn
Comment 2 Buchan Milne 2010-06-07 15:28:11 UTC
Created attachment 5767 [details]
Slightly cleaner patch
Comment 3 Volker Lendecke 2010-06-07 15:56:03 UTC
Not sure if we want to invest in that code. nsswitch/wins.c has to die in its current form. It needs rewriting to use libwbclient and winbind. That's a LOT less code to take care of.

Comment 4 Simo Sorce 2010-06-07 16:01:58 UTC
Well until that is done it wouldn't be bad to include patches that help fixing current bugs.
/me totally for moving all the code for nss_wins inside winbindd
Comment 5 Debian samba package maintainers (PUBLIC MAILING LIST) 2011-02-12 05:07:59 UTC
Also reported in Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=598313

Probably not important enough to deserve being fixe in 3.5 but would be nice to have in 3.6
Comment 6 parsimony1 2011-03-08 14:18:08 UTC
Hi, I for one would be grateful if this bug was patched ASAP as it appears to be responsible for the crippling of some cross platform music players (Rhythmbox, Clementine) on various Linux distros.

I know that you have to have to develop the big picture stuff and have limited time and resources but this is one of those Linux situations where the application developer refers you to the distro package maintainer who then refers you to the the root package maintainer, and by the time the end user gets there they just give up on the package.

My case:

1. A number of Debian based distributions are affected.
2. A patch exists.
3. More than 1 popular music application is affected.
4. This is a single point from which a solution can be implemented.
5. This problem has existed for some time.
6. Many people would be happy.

I hope that I am posting in the right place and this is the bug that causes the crashes. If not, my apologies. I will be happy to help if there is anything I can do to help fix this bug.
Comment 7 Andrew Bartlett 2017-07-16 22:35:36 UTC
This was fixed by 5ab1452436a5be5fbdf892343a4fc710f387eabf in master for Samba 4.4.

We now always query winbind, rather than run the main Samba code in a nss plugin, which is a bad idea for many reasons.