Date: Thu, 8 Feb 2001 19:18:18 -0600 From: "Jacques A. Vidrine" <n@nectar.com> To: Mike Heffner <mheffner@vt.edu> Cc: freebsd-audit@freebsd.org Subject: Re: login: exporting PAM environment Message-ID: <20010208191818.A91745@spawn.nectar.com> In-Reply-To: <XFMail.20010208183547.mheffner@vt.edu>; from mheffner@vt.edu on Thu, Feb 08, 2001 at 06:35:47PM -0500 References: <20010208151845.A58884@hamlet.nectar.com> <XFMail.20010208183547.mheffner@vt.edu>
index | next in thread | previous in thread | raw e-mail
On Thu, Feb 08, 2001 at 06:35:47PM -0500, Mike Heffner wrote:
> | +static int
> | +ok_to_export(s)
> | + const char *s;
> | +{
> | + static const char *noexport[] = {
> | + "SHELL", "HOME", "LOGNAME", "MAIL", "CDPATH",
> | + "IFS", "PATH", NULL
> | + };
> | + const char **pp;
> | +
> | + if (strlen(s) > 1024 || strchr(s, '=') == NULL)
> | + return 0;
> | + if (strncmp(s, "LD_", 3) == 0)
> | + return 0;
> | + for (pp = noexport; *pp != NULL; pp++) {
> | + if (strcmp(s, *pp) == 0)
> | + return 0;
>
> This needs to be strncmp(s, *pp, strlen(*pp)), otherwise the comparison will
> always fail.
Duh, oh yeah, thanks. Good catch. That's not quite right either,
though. Think MAILDIR, for example. I'll fix it some other way.
--
Jacques Vidrine / n@nectar.com / jvidrine@verio.net / nectar@FreeBSD.org
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-audit" in the body of the message
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010208191818.A91745>
