From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.redhat.com (mail.redhat.com [199.183.24.239]) by listman.redhat.com (Postfix) with ESMTP id 6988A2EFFC for ; Sun, 21 Jan 2001 21:14:34 -0500 (EST) Received: (from mail@localhost) by mail.redhat.com (8.11.0/8.8.7) id f0M2EFG02224 for axp-list@listman.redhat.com; Sun, 21 Jan 2001 21:14:15 -0500 Received: from devserv.devel.redhat.com (nat-pool.corp.redhat.com [199.183.24.200]) by mail.redhat.com (8.11.0/8.8.7) with ESMTP id f0M2EFd02219 for ; Sun, 21 Jan 2001 21:14:15 -0500 Received: (from msw@localhost) by devserv.devel.redhat.com (8.11.0/8.11.0) id f0M2ESx22603 for axp-list@redhat.com; Sun, 21 Jan 2001 21:14:28 -0500 Date: Sun, 21 Jan 2001 21:14:28 -0500 From: Matt Wilson To: axp-list@redhat.com Subject: Re: Uh...this looks bad. Message-ID: <20010121211428.A22229@devserv.devel.redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from superluser@mail.isc.rit.edu on Sun, Jan 21, 2001 at 06:51:40PM -0500 X-Loop: axp-list@redhat.com Sender: axp-list-admin@redhat.com Errors-To: axp-list-admin@redhat.com X-BeenThere: axp-list@redhat.com X-Mailman-Version: 2.0beta4 Precedence: bulk Reply-To: axp-list@redhat.com List-Id: Linux and Red Hat on Alpha processors Don't forget, your can also write main as: void main (int argc, char *argv[], char *env[]) You've just gone from argv to the environment variables passed to you. Matt On Sun, Jan 21, 2001 at 06:51:40PM -0500, Andrew A. Gill wrote: > Now, I'm new to incorporating command-line arguments into my programs, > but this looks bad. With the updated GCC (gcc-2.96-69), when I try the > following simple program: > > /* --- */ > #include > > void main(int argc, char *argv[]) > { > int i; > for(i = 1; i < 20 ; i++) > printf("%s\n",argv[i]); > } > /* --- */ > > I get the following output: > > --- This has been edited, but it looks like the info is correct. --- > (null) > PWD= > HOSTNAME= > QTDIR= > LESSOPEN= > KDEDIR= > USER= > LS_COLORS= > MACHTYPE= > MAIL= > INPUTRC= > BASH_ENV= > LOGNAME= > SHLVL= > SHELL= > USERNAME= > HOSTTYPE= > OSTYPE= > HISTSIZE= > --- > > It seems like this might provide too much information to a possibly > malicious user. > > So am I just dumb, and are these trivial environmental variables (it > also lists HOME=, TERM=, and PATH= before segfaulting), or is this kind > of bad? > > -- > |Andrew A. Gill |I posted to Silent-Tristero and| > | |all I got was this stupid sig! | > |alt.tv.simpsons CBG-FAQ author | | > | (Report all obscene mail to Le Maitre Pots)| > | Temporary sig: -- > > I'm not betting. > > > > _______________________________________________ > Axp-list mailing list > Axp-list@redhat.com > https://listman.redhat.com/mailman/listinfo/axp-list