From owner-freebsd-audit Fri Feb 9 0:35:18 2001 Delivered-To: freebsd-audit@freebsd.org Received: from ringworld.nanolink.com (pool180-tch-2.Sofia.0rbitel.net [212.95.171.180]) by hub.freebsd.org (Postfix) with SMTP id 73A2737B491 for ; Fri, 9 Feb 2001 00:34:59 -0800 (PST) Received: (qmail 2617 invoked by uid 1000); 9 Feb 2001 08:33:14 -0000 Date: Fri, 9 Feb 2001 10:33:14 +0200 From: Peter Pentchev To: "Jacques A. Vidrine" Cc: Mike Heffner , freebsd-audit@freebsd.org Subject: Re: login: exporting PAM environment Message-ID: <20010209103314.A348@ringworld.oblivion.bg> Mail-Followup-To: "Jacques A. Vidrine" , Mike Heffner , freebsd-audit@freebsd.org References: <20010208151845.A58884@hamlet.nectar.com> <20010208191818.A91745@spawn.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: <20010208191818.A91745@spawn.nectar.com>; from n@nectar.com on Thu, Feb 08, 2001 at 07:18:18PM -0600 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, Feb 08, 2001 at 07:18:18PM -0600, Jacques A. Vidrine wrote: > 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. Well, you could always tag a " && (s[strlen(pp)] == '=') " or something.. brrr.. ugly :( G'luck, Peter -- If this sentence were in Chinese, it would say something else. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message