Bug#307672: Can't purge dcc-common if LDAP is used

2005-05-10 Thread MJ Ray
package dcc-common
tags 307672 + patch
stop commands here

  Did adduser manage to add the dcc user and group for you?
 adduser doesn't add the user if is already exists.

That doesn't answer the question. The postrm script won't
try to remove the users if they are already removed, so you
should remove the dcc user and group from LDAP *before* doing
the --purge and there would be no error.

Did adduser add the dcc user and group for you, or did you add it yourself?

I think that dcc should warn it couldn't remove the user and
group if the adduser commands can't, but not fail. I'm mildly
concerned that usermod is used instead of moduser in postinst.
I also think your system is misconfigured (but that doesn't
excuse dcc-common failing to remove) and you should add files
back into nsswitch if you want debian packages to install and
purge without sysadmin intervention.

Here's a udiff. Excuse timestamps:

--- debian/dcc-common.postrm.orig   2005-05-10 11:05:07.0 +0100
+++ debian/dcc-common.postrm2005-05-10 11:07:28.0 +0100
@@ -24,12 +24,12 @@
rm -rf /var/log/dcc /var/lib/dcc/log /var/lib/dcc/map 
/var/lib/dcc/map.txt /var/lib/dcc/ids /etc/dcc /var/lib/dcc/whiteclnt 
/var/lib/dcc /var/run/dcc

 if getent passwd dcc /dev/null; then
-deluser dcc
+userdel dcc || echo dcc: Could not remove dcc user 2
 fi


 if getent group dcc /dev/null; then
-delgroup dcc
+groupdel dcc || echo dcc: Could not remove dcc group 2
 fi


-- 
MJR/slef



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#307672: Can't purge dcc-common if LDAP is used

2005-05-07 Thread Piotr Roszatycki
On Friday 06 of May 2005 17:23, MJ Ray wrote:
 Piotr Roszatycki wrote:
  It doesn't work, because deluser and delgroup works only on /etc/passwd
  and /etc/group files. My users are on LDAP directory.

 Did adduser manage to add the dcc user and group for you?
 Should your nsswitch.conf include files as a fallback?
 Should we make this a wishlist bug against adduser?

adduser doesn't add the user if is already exists.

granat:~# adduser dcc
adduser: The user `dcc' already exists.
granat:~# grep dcc /etc/passwd || echo nothing
nothing
granat:~# getent passwd dcc
dcc:!:519:519:DCC System User:/var/lib/dcc:/bin/false

-- 
 .''`.Piotr Roszatycki, Netia SA
: :' :mailto:[EMAIL PROTECTED]
`. `' mailto:[EMAIL PROTECTED]
  `-


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#307672: Can't purge dcc-common if LDAP is used

2005-05-06 Thread MJ Ray
 The system uses LDAP as NSS backend.

Reading policy 9.2.2, it says to use adduser, so probably deluser
and delgroup are the equivalent, instead of groupdel.

Does delgroup work for you?

-- 
MJR/slef
http://people.debian.org/~mjr/



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#307672: Can't purge dcc-common if LDAP is used

2005-05-06 Thread Piotr Roszatycki
On Friday 06 of May 2005 16:10, MJ Ray wrote:
  The system uses LDAP as NSS backend.

 Reading policy 9.2.2, it says to use adduser, so probably deluser
 and delgroup are the equivalent, instead of groupdel.

 Does delgroup work for you?

It doesn't work, because deluser and delgroup works only on /etc/passwd 
and /etc/group files. My users are on LDAP directory.

I suggest to do the same as ssh.postrm do:

deluser --quiet dcc  /dev/null || true
delgroup --quiet dcc  /dev/null || true

-- 
 .''`.Piotr Roszatycki, Netia SA
: :' :mailto:[EMAIL PROTECTED]
`. `' mailto:[EMAIL PROTECTED]
  `-


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#307672: Can't purge dcc-common if LDAP is used

2005-05-06 Thread MJ Ray
Piotr Roszatycki wrote:
 It doesn't work, because deluser and delgroup works only on /etc/passwd
 and /etc/group files. My users are on LDAP directory.

Did adduser manage to add the dcc user and group for you?
Should your nsswitch.conf include files as a fallback?
Should we make this a wishlist bug against adduser?

 I suggest to do the same as ssh.postrm do:
 deluser --quiet dcc  /dev/null || true
 delgroup --quiet dcc  /dev/null || true

That seems ugly to me, definitely the redirection, but maybe it's
the best solution.

-- 
MJR/slef



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#307672: Can't purge dcc-common if LDAP is used

2005-05-04 Thread Piotr Roszatycki
Package: dcc-common
Version: 1.2.74-2
Severity: normal

# dpkg -P dcc-client dcc-common dcc-server
dpkg - warning: ignoring request to remove dcc-client which isn't installed.
(Reading database ... 19200 files and directories currently installed.)
Removing dcc-common ...
Purging configuration files for dcc-common ...
Removing user `dcc'...
userdel: error deleting password entry
userdel: error deleting shadow password entry
done.
Removing group `dcc'...
groupdel: cannot remove user's primary group.
/usr/sbin/delgroup: `/usr/sbin/groupdel dcc' returned error code 8.  Aborting.
dpkg: error processing dcc-common (--purge):
 subprocess post-removal script returned error exit status 2
dpkg - warning: ignoring request to remove dcc-server which isn't installed.
Errors were encountered while processing:
 dcc-common

The system uses LDAP as NSS backend.

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (900, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.10-1-686
Locale: LANG=pl_PL, LC_CTYPE=pl_PL (charmap=ISO-8859-2)

Versions of packages dcc-common depends on:
ii  dcc-client  1.2.74-2 Distributed Checksum Clearinghouse
ii  libc6   2.3.2.ds1-21 GNU C Library: Shared libraries an

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]