From owner-freebsd-audit Thu Feb 8 17:18:37 2001 Delivered-To: freebsd-audit@freebsd.org Received: from gw.nectar.com (gw.nectar.com [208.42.49.153]) by hub.freebsd.org (Postfix) with ESMTP id 6CA2837B69D for ; Thu, 8 Feb 2001 17:18:19 -0800 (PST) Received: by gw.nectar.com (Postfix, from userid 1001) id 7016618C93; Thu, 8 Feb 2001 19:18:18 -0600 (CST) Date: Thu, 8 Feb 2001 19:18:18 -0600 From: "Jacques A. Vidrine" To: Mike Heffner Cc: freebsd-audit@freebsd.org Subject: Re: login: exporting PAM environment Message-ID: <20010208191818.A91745@spawn.nectar.com> Mail-Followup-To: "Jacques A. Vidrine" , Mike Heffner , freebsd-audit@freebsd.org References: <20010208151845.A58884@hamlet.nectar.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from mheffner@vt.edu on Thu, Feb 08, 2001 at 06:35:47PM -0500 X-Url: http://www.nectar.com/ Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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