[FreeNX-kNX] nxsetup patch to handle issues around NIS/NIS+

Ed Warnicke eaw at cisco.com
Sat Jul 30 20:19:33 UTC 2005


Attached is a patch to deal with some issues around
NIS/NIS+ causing problems with setting up the nx
user in nxsetup.

First:

getent passwd | egrep "^nx"

is VERY unpleasant in a NIS/NIS+
environment where getent passwd
is pulling tens of thousand of
passwd db entries over the network.
It basically takes hours.

To the best of my knowledge,

getent passwd nx

is just as good, and quite speedy
on both NIS/NIS+ and traditional
passwd file systems.

Second, useradd, at least on RedHat
vintage distros on a NIS/NIS+ machine
is a problem.  It basically takes hours
to return.  This is because it's traversing
the WHOLE NIS/NIS+ passwd db (over
the network) to make sure the user
doesn't already exist.  The workaround in
such situations is to use luseradd, which only
searches the local passwd db.

Third, sometimes in a NIS/NIS+ environment
that is supporting multiple different platforms,
you will get a conflict with the nx user.  Imagine
someone puts an nx user in the NIS, but with
a home directory of /home/nx, and you need the
nx home dir in /var/lib/nxserver/nxhome.  In
this case you want to specify:

--localuser

and have the check nx user existence only look
at the local passwd db (grep "^nx" /etc/passwd)
rather than look through the whole passwd
db (getent passwd nx).  In addition you want to
override precisely the uid use for the NIS nx
user (which is already supported by the --uid flag).
Unfortunately, luseradd blows it's little brains out if
you try to add a user nx, and an nx group exists
in the NIS but not the local /etc/groups file.  So I
added a

--gid

to specify the gid of the nx group.
Naturally, for the --localuser case, this needs to
be added with lgroupadd before running luseradd.

Please consider the attached patch, which makes
these changes for inclusion in FreeNX :)

Ed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fnx_luseradd.patch
Type: text/x-patch
Size: 3949 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/freenx-knx/attachments/20050730/7df73c91/attachment.patch>


More information about the FreeNX-kNX mailing list