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

next in thread | previous in thread | raw e-mail | index | archive | help
Mikhail Teterin <mi@corbulon.video-collage.com> writes:
> 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...

No, the storage format for environment variables is part of the API
and is intended for compatibility with libc.  Doing it your way would
be backward.

> 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!

I don't know why it crashes, and I haven't looked at the patch.  I
probably won't have time for it until early next year.

In the meantime, merry Christmas and a happy New Year :)

DES
-- 
Dag-Erling Smorgrav - des@ofug.org

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?xzpd6nvl2dd.fsf>