Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Dec 2002 09:41:12 -0500 (EST)
From:      Mikhail Teterin <mi@corbulon.video-collage.com>
To:        Dag-Erling Smorgrav <des@ofug.org>
Cc:        current@FreeBSD.org, markm@FreeBSD.org
Subject:   Re: pam_setenv() crashes rshd...
Message-ID:  <200212211441.gBLEfCfU041482@corbulon.video-collage.com>
In-Reply-To: <xzpy96jldzt.fsf@flood.ping.uio.no>

next in thread | previous in thread | raw e-mail | index | archive | help
> Mikhail Teterin <mi+mx@aldan.algebra.com> writes:
> > The following patch fixes (works around?) the problem for me
> > (pam_setenv is rather inefficiently implemented by the vendor, BTW),
 
> I am the vendor.  What's wrong with pam_setenv()?

I only went into the code to see where it may be crashing my rshd and
noticed the mild inefficiency. Did not know where the code is from
either. Sorry if I offended you.

The pam_setenv and pam_putenv are backwards, IMHO. putenv should be
using setenv -- not the other way around. Currently, the setenv takes
NAME and VALUE separately, mallocs a new buffer, sprintfs %s=%s into it,
sends the buffer to putenv, which re-parses it and frees it.

I think, pam_setenv should be doing the actual "dirty work", with putenv
being a wrapper. This would save some cycles (and, possibly, syscalls
-- from malloc), but, of course, it would not be very significant with
todays hardware, yada, yada...

Would you have any other comments about my original post -- why is
pam_setenv causing the segfault somewhere, and is there anything wrong
with my patch? Thanks!

	-mi

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




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