Re: Cannot run any executables under Debian2.0 - Help(newbie)

1998-10-12 Thread Helge Hafting
In [EMAIL PROTECTED], on 10/09/98
   at 07:48 PM, rathon [EMAIL PROTECTED] said:

Hi,

let me explain this as best as I can -

Problem:
--
I had installed Yggdrasil Linux long time ago and everything on that
setup worked ok.

Recently, I upgraded to Debian2.0 and none of my executables or Perl
scripts are working anymore. I get

bash: filename: command not found

Background:
---
Within Debian, I did not create a /home dir. I wanted to use my existing
Yggdrasil /home with all my files intact when I ran Debian.

So, within Debian /etc/fstab, I added the following:
/dev/hdc4   /home   ext2   defaults

Now, I could see all my files.

Since I was logged on with a different username, I did the
following to change file permissions:

chown -R rathon /home/guest (as root, username=rathon)

Now, I could open up any file and edit as I needed in my /home/guest dir.

As I mentioned earlier, Perl scripts that worked on Ygg do not work on
Debian. I get a 'command not found'

I did a env and got this:

PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:

I could do 'which Perl' and see the path being /usr/bin/perl. Same as my
Ygg path for Perl. So I was sure Perl got detected right.

So I wanted to do a test to see if this is Perl specific or not. I wrote
a 3 line 'C' code and compiled it using gcc. This gave me a 'a.out'
file(no error in compiling). When I run the file, I get:

bash:a.out:command not found
Note that your PATH does not contain the current directory (.) This is
default for Debian, and is considered a security feature. I believe you
can run standard executables like ls and such?

To run the a.out file, use ./a.out instead of only a.out
The same applies to anything else that isn't in your path.  Why is this a
security thing?  Because a nasty user on a multiuser system could create a
virus or something and name it ls
in his home directory.  Someone else might cd's into that
directory and run ls in order to get a directory list.
Not having the current dir in PATH is then useful.

So, my present setup(Debian)WILL NOT allow any executables to run!
If you are the only user (normal on a home machine) add . to your PATH.
Or you may put your private executables in ~/bin¨ and add  that to your
path.  Or get used to type ./executable

I checked my permission and that was ok. I even did a chmod 777 on my
file and that did not work.

Additional info:
---
I am giving some additional info in the hopes that someone can point me
in the right direction. I have a feeling that I did not move my /home dir
from Ygg to Debian properly.

If I do a ls -l:
-rw-r--r--   1  rathon  users  64   Oct12 10:44  test.c
-rwxrwxr-x   1  rathon  rathon 4157 Oct12 10:44 a.out

Notice that the gid changed when I compiled the file ? Is that normal to
get uid and gid the same ??
It didn't change when compiling.  The compiler simply creates a new file
(a.out) and it get the default uid/gid for files you create. Try compiling
someone else's source file - you'll be the owner of the executable because
*you* ran the compiler.

Helge Hafting


Re: Cannot run any executables under Debian2.0 - Help(newbie)

1998-10-12 Thread tko
Helge Hafting writes:
[snip]
 Note that your PATH does not contain the current directory (.) This is
 default for Debian, and is considered a security feature. I believe you
 can run standard executables like ls and such?
 
 To run the a.out file, use ./a.out instead of only a.out
 The same applies to anything else that isn't in your path.  Why is this a
 security thing?  Because a nasty user on a multiuser system could create a
 virus or something and name it ls
 in his home directory.  Someone else might cd's into that
 directory and run ls in order to get a directory list.
 Not having the current dir in PATH is then useful. 

Unnecessary, Just place the . at the end of the $PATH variable so that all
other directories are searched first before defaulting to the current
directory .  Thus, official binaries (like /usr/bin/*) are searched before
attempting the current directory.

-- 
-= Sent by Debian 1.3 Linux =-
Thomas Kocourek  KD4CIK 
@[EMAIL PROTECTED]@westgac3.dragon.com Remove @_@ for correct Email address
--... ...-- ...  -.. .  -.- -.. - -.-. .. -.-


Re: Cannot run any executables under Debian2.0 - Help(newbie)

1998-10-12 Thread David Wright
On Mon, 12 Oct 1998, tko wrote:

 Helge Hafting writes:
 [snip]
  Note that your PATH does not contain the current directory (.) This is
  default for Debian, and is considered a security feature. I believe you
  can run standard executables like ls and such?
  
  To run the a.out file, use ./a.out instead of only a.out
  The same applies to anything else that isn't in your path.  Why is this a
  security thing?  Because a nasty user on a multiuser system could create a
  virus or something and name it ls
  in his home directory.  Someone else might cd's into that
  directory and run ls in order to get a directory list.
  Not having the current dir in PATH is then useful. 
 
 Unnecessary, Just place the . at the end of the $PATH variable so that all
 other directories are searched first before defaulting to the current
 directory .  Thus, official binaries (like /usr/bin/*) are searched before
 attempting the current directory.

He did say 'nasty' user. Nasty users don't just have trojan horses called
'ls', but common typos as well. These won't get caught by official binaries,
so typing 'emaca' will do its dirty work before benignly replying
bash: emaca: command not found .

It's not very difficult to get used to typing ./ when you need to.

Cheers,

-- 
Email:  [EMAIL PROTECTED]   Tel: +44 1908 653 739  Fax: +44 1908 655 151
Snail:  David Wright, Earth Science Dept., Milton Keynes, England, MK7 6AA
Disclaimer:   These addresses are only for reaching me, and do not signify
official stationery. Views expressed here are either my own or plagiarised.