On Thu, Jun 14, 2018 at 08:08:02AM +0300, kact...@gnu.org wrote:
> 
> [2018-06-14 00:32] Wouter Verhelst <wou...@debian.org>
> > Hi,
> 
> Hi!
> 
> > On Wed, Jun 13, 2018 at 03:21:11AM +0300, kact...@gnu.org wrote:
> > > I never worked with NSS, but how did it happen, that useradd {in postinst}
> > > created user in a way, that userdel {in prerm} could not find?
> > 
> > That's not what happened.
> > 
> > The sreview user already existed before the sreview-common package was
> > installed, but it did not exist in /etc/passwd; instead, it existed in a
> > different location, configured through an NSS module.
> 
> Am I correct, some time ago it was created by previous version of maintainer 
> script,
> when I did not use dh-sysuser?

No.

It was created in Debian's LDAP directory.

> > The easiest way for you to test this is probably to install libnss-db,
> > change the value of ETC in /etc/default/libnss-db to some other
> > directory and cull the DBS value so it contains just passwd, then create
> > a file called "passwd" in the directory that you pointed ETC to, run
> > "make -C /var/lib/misc", and add "db" to /etc/nsswitch.conf on the
> > "passwd" line.
> > 
> > Meanwhile, I'm going to have to implement it properly and remove
> > dh_sysuser from my build-depends. Ah well.
> 
> So sad. Maybe you could suggest what should I use instead of 'useradd/userdel'
> in sysuser-helper to make dh-sysuser also work with NSS?

You generally cannot modify users from the command line (or from a
maintainer script) that are created through any NSS module that is not
libnss-compat (note: I said "unix" before, but that was obviously
wrong).

There's nothing wrong with useradd, but you should be prepared for the
possibility that the user already exists or cannot be modified.

Alternatively, you can just use adduser.

-- 
Could you people please use IRC like normal people?!?

  -- Amaya Rodrigo Sastre, trying to quiet down the buzz in the DebConf 2008
     Hacklab

Reply via email to