Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Nov 1998 00:19:38 -0500
From:      "Steve Friedrich" <SteveFriedrich@Hot-Shot.com>
To:        "freebsd-questions@FreeBSD.ORG" <freebsd-questions@FreeBSD.ORG>, "G578@ix.netcom.com" <G578@ix.netcom.com>
Subject:   Re: C executables
Message-ID:  <199811181455.JAA03441@laker.net>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199811181455.JAA03441>