Article View: comp.windows.x
Article #24077Re: Why does xterm need NIS?
From: Thomas Maslen
Date: Wed, 26 Jun 1991 02:44
Date: Wed, 26 Jun 1991 02:44
40 lines
2026 bytes
2026 bytes
pjs@euclid.jpl.nasa.gov (Peter Scott) writes:
>Well, what does xterm (or any other X client) need NIS for when
>I'm opening the window on the local host? I did a trace on xterm
>later, but the NIS master was up by then and I couldn't tell what
>system calls were accessing NIS.
Well, here's a part-answer... In the R4 sources, xterm/main.c contains calls
to getpwuid(). If your /etc/passwd contains the "+" magic, and getpwuid()
doesn't find the uid in /etc/passwd before the first "+" or "-", getpwuid will
try to commune with NIS.
From a quick peek at the source, xterm seems to have a number of reasons to
call getpwuid:
- it wants the username in order to write a helpful utmp entry,
- something to do with initializing groups that I didn't trace,
- it wants to know your default shell,
- it may want to run login -p -f <username>
The resize program (xterm/resize.c) also calls getpwuid() to determine the
default shell.
It is entirely possible that other parts of xterm, or the library routines
it uses, end up invoking some of the other getXXXbyYYY() routines, e.g.
gethostbyname(); I haven't checked.
I'll close with the comment from the top of xterm/main.c (even before the
copyright notice)...
/*
* W A R N I N G
*
* If you think you know what all of this code is doing, you are probably
* very mistaken. There be serious and nasty dragons here.
*
>This is news. This is your | Peter Scott, NASA/JPL/Caltech
>brain on news. Any questions? | (pjs@euclid.jpl.nasa.gov)
Thomas Maslen
maslen@eng.sun.com
Technical Details
Message-ID:
<maslen.677904287@gday>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!apple!sun-barr!cronkite!newstop!exodus!gday!maslenReferences:
<1991Jun25.170013.19600@elroy.jpl.nasa.gov>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!apple!sun-barr!cronkite!newstop!exodus!gday!maslen From: maslen@eng.sun.com (Thomas Maslen) Newsgroups: comp.windows.x Subject: Re: Why does xterm need NIS? Message-ID: <maslen.677904287@gday> Date: 26 Jun 91 02:44:47 GMT References: <1991Jun25.170013.19600@elroy.jpl.nasa.gov> Sender: news@exodus.Eng.Sun.COM Lines: 40