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