Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Jul 2006 16:50:19 GMT
From:      Christian Marg <marg@rz.tu-clausthal.de>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/71290: [PATCH] passwd cannot change passwords other than NIS/local (e.g. via pam_ldap)
Message-ID:  <200607241650.k6OGoJBF050498@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/71290; it has been noted by GNATS.

From: Christian Marg <marg@rz.tu-clausthal.de>
To: bug-followup@FreeBSD.org,  wielebap@iem.pw.edu.pl
Cc:  
Subject: Re: bin/71290: [PATCH] passwd cannot change passwords other than
 NIS/local (e.g. via pam_ldap)
Date: Mon, 24 Jul 2006 18:40:27 +0200

 This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
 --------------enigE16969CBF150AF4AC42296C1
 Content-Type: multipart/mixed;
  boundary="------------020109090606060001060108"
 
 This is a multi-part message in MIME format.
 --------------020109090606060001060108
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 Hello...
 
 Since I also want to use pam_ldap to change Passwords in LDAP, I
 stumbled about this problem. And after looking into the sources I found
 this comment in <pwd.h>:
 
 ---------------------
 /* XXX These flags are bogus.  With nsswitch, there are many
  * possible sources and they cannot be represented in a small integer.
  */
 #define _PWF_SOURCE	0x3000
 #define _PWF_FILES	0x1000
 #define _PWF_NIS	0x2000
 #define _PWF_HESIOD	0x3000
 ---------------------
 
 So, if the flags are Bogus, why are they tested in passwd.c?
 Just to select which string is printed. Yes, the test has no real purpose=
 =2E
 
 Attached is my patch - just strip the select statement that is purely
 cosmetic but hinders people to use passwd.
 
 Maybe someone considers to commit the patch, so that this bug can be
 closed after a year... :|
 
 bye
 
 Christian
 
 
 --=20
 Christian Marg                    mail: mailto:marg@rz.tu-clausthal.de
 Rechenzentrum TU Clausthal        web : http://www.rz.tu-clausthal.de
 D-38678 Clausthal-Zellerfeld      fon : 05323/72-2043
 Germany                           ICQ : <on request>
 
 --------------020109090606060001060108
 Content-Type: text/plain;
  name="passwd-patch.txt"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: inline;
  filename="passwd-patch.txt"
 
 diff -u passwd.c passwd.c.orig
 --- /usr/src/usr.bin/passwd/passwd.c.orig       Mon Jul 24 17:40:16 2006
 +++ /usr/src/usr.bin/passwd/passwd.c    Mon Jul 24 17:54:16 2006
 @@ -109,21 +109,7 @@
         if (uid !=3D 0 && uid !=3D pwd->pw_uid)
                 errx(1, "permission denied");
 
 -       /* check where the user's from */
 -       switch (pwd->pw_fields & _PWF_SOURCE) {
 -       case _PWF_FILES:
 -               fprintf(stderr, "Changing local password for %s\n",
 -                   pwd->pw_name);
 -               break;
 -       case _PWF_NIS:
 -               fprintf(stderr, "Changing NIS password for %s\n",
 -                   pwd->pw_name);
 -               break;
 -       default:
 -               /* XXX: Green men ought to be supported via PAM. */
 -               errx(1,
 -         "Sorry, `passwd' can only change passwords for local or NIS use=
 rs.");
 -       }
 +       fprintf(stderr, "Changing password for %s\n", pwd->pw_name);
 
  #define pam_check(func) do { \
         if (pam_err !=3D PAM_SUCCESS) { \
 
 
 --------------020109090606060001060108--
 
 --------------enigE16969CBF150AF4AC42296C1
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: OpenPGP digital signature
 Content-Disposition: attachment; filename="signature.asc"
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.4 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
 iD8DBQFExPgAXwu7mUb3ymMRAjdmAKCAjhcc9LtPaMJXvoDPoxEOCpgHNACcCFWk
 XtOdN8E39Zh3mAnYoaq9iOg=
 =H+iT
 -----END PGP SIGNATURE-----
 
 --------------enigE16969CBF150AF4AC42296C1--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607241650.k6OGoJBF050498>