tag 369439 +patch thanks On 30/05/2006 Christian Perrier wrote: > > if i execute 'echo "jonas:password" | chgpasswd', i get a prompt: > > Password: > > and after two seconds it terminates with the following error message: > > chgpasswd: PAM authentication failed > > > > chgpasswd should not ask anything, as it's intended to be used in > > scripts, and gets all information via stdin. > > > I suspect (without checking) that this could be related to the utility > being PAMified. We currently don't use PAM for chpasswd in Debian and > we probably should do so as well for chgpasswd.
absolutely correct. i tried disabling PAM for chgpasswd, and it worked as expected. a patch is attached. > We're currently considering to re-enable PAM for all utilities, > without, however, using a PAM configuration file for each. We will > probably have all utilities use the same PAM configuration file than > passwd. But that's another story... does that imply, that chpasswd and chgpasswd ask for a password? or is this due to the missing configuration file currently? in any case, the current behaviour of chpasswd is the expected one, the behaviour of chgpasswd is not the expected one. ... jonas
diff -rNu shadow-4.0.15.orig/debian/patches/504_undef_USE_PAM.dpatch shadow-4.0.15/debian/patches/504_undef_USE_PAM.dpatch --- shadow-4.0.15.orig/debian/patches/504_undef_USE_PAM.dpatch 2006-05-30 16:02:54.000000000 +0200 +++ shadow-4.0.15/debian/patches/504_undef_USE_PAM.dpatch 2006-05-30 16:08:46.000000000 +0200 @@ -1,5 +1,5 @@ -Goal: Do not use PAM for chage, chpasswd, groupadd, groupdel, groupmod - newusers, useradd, userdel, usermod (keep them low-level) +Goal: Do not use PAM for chage, chpasswd, chgpasswd, groupadd, groupdel, + groupmod newusers, useradd, userdel, usermod (keep them low-level) Fixes: #283961, #162181, #162199, #162228. Note: @@ -30,6 +30,18 @@ #ident "$Id: chpasswd.c,v 1.34 2005/10/19 15:21:07 kloczek Exp $" +Index: shadow-4.0.15/src/chgpasswd.c +=================================================================== +--- shadow-4.0.15.orig/src/chgpasswd.c 2006-05-30 15:32:11.000000000 +0200 ++++ shadow-4.0.15/src/chgpasswd.c 2006-05-30 15:33:24.000000000 +0200 +@@ -28,6 +28,7 @@ + */ + + #include <config.h> ++#undef USE_PAM + + #ident "$Id: chgpasswd.c,v 1.1 2006/03/05 22:12:38 kloczek Exp $" + Index: shadow-4.0.15/src/groupadd.c =================================================================== --- shadow-4.0.15.orig/src/groupadd.c 2006-03-08 19:32:11.928876405 +0100 diff -rNu shadow-4.0.15.orig/debian/patches/504_undef_USE_PAM.nolibpam shadow-4.0.15/debian/patches/504_undef_USE_PAM.nolibpam --- shadow-4.0.15.orig/debian/patches/504_undef_USE_PAM.nolibpam 2006-05-30 16:02:54.000000000 +0200 +++ shadow-4.0.15/debian/patches/504_undef_USE_PAM.nolibpam 2006-05-30 15:41:18.000000000 +0200 @@ -9,7 +9,8 @@ -chage_LDADD = $(LDADD) $(LIBPAM) $(LIBAUDIT) $(LIBSELINUX) +chage_LDADD = $(LDADD) $(LIBAUDIT) $(LIBSELINUX) chfn_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) - chgpasswd_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) +-chgpasswd_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) ++chgpasswd_LDADD = $(LDADD) $(LIBSELINUX) chsh_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) -chpasswd_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) +chpasswd_LDADD = $(LDADD) $(LIBSELINUX)
signature.asc
Description: Digital signature