From owner-freebsd-questions Wed Nov 18 06:56:07 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA15420 for freebsd-questions-outgoing; Wed, 18 Nov 1998 06:56:07 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from laker.net (jet.laker.net [205.245.74.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id GAA15411 for ; Wed, 18 Nov 1998 06:56:05 -0800 (PST) (envelope-from sfriedri@laker.net) Received: from nt (digital-pbi-153.laker.net [208.0.233.53]) by laker.net (8.9.0/8.9.LAKERNET.NO-SPAM.SPAMMERS.AND.RELAYS.WILL.BE.TRACKED.AND.PROSECUTED.) with SMTP id JAA03441; Wed, 18 Nov 1998 09:55:34 -0500 Message-Id: <199811181455.JAA03441@laker.net> From: "Steve Friedrich" To: "freebsd-questions@FreeBSD.ORG" , "G578@ix.netcom.com" Date: Wed, 18 Nov 1998 00:19:38 -0500 Reply-To: "Steve Friedrich" X-Mailer: PMMail 98 Professional (2.01.1600) For Windows NT (4.0.1381;3) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: Re: C executables Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, 17 Nov 1998 21:32:13 -0500, G578@ix.netcom.com wrote: >I know this sounds idiotic, but I can't get my "C" executables to run. >I've compiled with "cc" and with "gcc" (which I installed from the >packages), and I get no errors, and I create "a.out", but when I type >"a.out" to run the thing, I get "...not found." I'm new to C and new to >UNIX, so I'm probably doing something excrutiatingly dumb. It's just >that, this is how it worked in Caldera Linux, and this is how all the C >books say it should work in pretty much any UNIX environment. You >compile, you don't specify an object module name, it defaults to >"a.out", then you type "a.out" and, Voila, Hello World! Why am I >getting Voila, Not Found? It used to be standard practice that dot . was included in the default path for all users. Dot means the current directory, wherever you happen to be at the moment the command is issued. But having dot in the path can be a security hole. Suppose you are a malicious user and create a *bad* program and name it the same as a standard unix utility, such as ls. You could then *chump* people into going to a directory where you had write permission and execute an ls command. Your malicious program could delete files, etc. You can check a few unix security books for more info... And as everyone has already said, simply use ./a.out instead of just a.out Unix systems measure "uptime" in years, Winblows measures it in minutes. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message