PAM and passwd age warnings again.

Thomas Gardner tmg at pobox.com
Fri Feb 17 00:51:33 EST 2006


Hi all,

This is a patch against 4.2p1 (compiling for a Linux --- an old, highly
customized 7.2 to be specific).  When I compiled it from your original
source, installed it, and turned on PAM (for passwd aging), I couldn't
get the passwd expiration warnings as specified in /etc/shadow to work
at all (the message that is supposed to warn you as you're logging in
that your passwd will expire in XYZ days).  The patch below seemed to
fix it.  It looks like PAM was figgerin' it out, but the message was
getting blocked again (although this time it was being blocked for a
different reason than the last time I proposed a fix for this).

Please let me know if you get this, because I'm not on the mailing list
(sorry).  If you'd like to put it into the official source, please
feel free; that's why I'm giving it to you.  If you already have,
and I'm a rev or two behind and missed it, please accept my apologies.
If you'd like to just completely ignore this and not include it in
the source, well, that would be fine too, it's your code, not mine.
I'm just sending this to y'all 'cause I worked through it for myself,
and I thought you folks might like it.  If not, well, that's OK too.
I just figgered this was the least I could do for the cause.

L8r,
tg.

------------------------------------------------------------------------
diff -Naur openssh-4.2p1.old/monitor.c openssh-4.2p1.new/monitor.c
--- openssh-4.2p1.old/monitor.c	Sun Jul 17 03:53:31 2005
+++ openssh-4.2p1.new/monitor.c	Tue Dec 20 09:10:04 2005
@@ -1716,6 +1716,11 @@
 	child_state.input = buffer_get_string(&m, &child_state.ilen);
 	child_state.output = buffer_get_string(&m, &child_state.olen);
 
+	/* Let's not forget our loginmsg, now, eh? */
+	p = buffer_get_string (&m, &plen);
+	if (plen) buffer_append (&loginmsg, p, plen);
+	xfree (p);
+
 	buffer_free(&m);
 }
 
diff -Naur openssh-4.2p1.old/monitor_wrap.c openssh-4.2p1.new/monitor_wrap.c
--- openssh-4.2p1.old/monitor_wrap.c	Sun Jul 17 03:53:31 2005
+++ openssh-4.2p1.new/monitor_wrap.c	Tue Dec 20 09:09:16 2005
@@ -631,6 +631,9 @@
 	buffer_put_string(&m, buffer_ptr(&input), buffer_len(&input));
 	buffer_put_string(&m, buffer_ptr(&output), buffer_len(&output));
 
+	/* Let's not forget our loginmsg, now, eh? */
+	buffer_put_string(&m, buffer_ptr(&loginmsg), buffer_len(&loginmsg));
+
 	mm_request_send(monitor->m_recvfd, MONITOR_REQ_KEYEXPORT, &m);
 	debug3("%s: Finished sending state", __func__);
 




More information about the openssh-unix-dev mailing list