LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 12-06-2004, 06:21 PM   #1
aranfitz
LQ Newbie
 
Registered: Nov 2004
Location: Melbourne
Distribution: Fedora Core 3, Red Hat 9
Posts: 6

Rep: Reputation: 0
Thumbs down Executables not executing!


Hi All,

Hi all, a problem with Fedora core three that seems to recurr after installation.

My executables will not execute. I have all the permissions for execution and they used to execute in RH9.

The only way I can get them to execute is to type:

\bin\tcsh 'executablefilename'

but this is a pain in the arse!

Fedora Core3, Kernel 2.6.9-1.667.
 
Old 12-06-2004, 06:28 PM   #2
jojotx0
Member
 
Registered: Mar 2004
Distribution: Debian Lenny
Posts: 181

Rep: Reputation: 30
in a console tpye in "./nameoffile" to execute that file.
 
Old 12-06-2004, 08:02 PM   #3
leontini
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Fedora Core 8-10
Posts: 61

Rep: Reputation: 15
I dont think that typing ./blah is a great solution. The whole idea is that executables should be executable from anywhere. I have had similar problems using FC2, with files that are in my path, even after running updatedb as root. In my case the files suddenly become executable after a couple of hours. Has anybody else seen this?
 
Old 12-06-2004, 08:16 PM   #4
jens
Senior Member
 
Registered: May 2004
Location: Belgium
Distribution: Debian, Slackware, Fedora
Posts: 1,463

Rep: Reputation: 299Reputation: 299Reputation: 299
Quote:
Originally posted by leontini
The whole idea is that executables should be executable from anywhere.
Well, it's not!
Executables(or whatever you call them) should only be used by a system administrator.
If you don't like this, you should simply use your root account as default(not recommended for sane people)

PS: Not doing this is one of the many reasons why Windows doesn't work...

Last edited by jens; 12-06-2004 at 08:22 PM.
 
Old 12-06-2004, 08:50 PM   #5
jojotx0
Member
 
Registered: Mar 2004
Distribution: Debian Lenny
Posts: 181

Rep: Reputation: 30
jens is right...you shouldn't run installation software as user..only root...and it's a binary file, not executable...executables are for windows only...well unless you use wine, then you can use executables.
 
Old 12-07-2004, 12:52 AM   #6
aranfitz
LQ Newbie
 
Registered: Nov 2004
Location: Melbourne
Distribution: Fedora Core 3, Red Hat 9
Posts: 6

Original Poster
Rep: Reputation: 0
Angry Whoa Whoa Whoa

GUYS YOU'RE NOT HELPING

OK. Let me define what I meant about executables.... I meant scripts... my SCRIPTS wont execute.

Yes I tried ./filename

I have '.' in the path anyway... There's something more sinister going on.

Thanks All
 
Old 12-07-2004, 02:03 AM   #7
kees-jan
Member
 
Registered: Sep 2004
Distribution: Debian, Ubuntu, BeatrIX, OpenWRT
Posts: 273

Rep: Reputation: 30
Could it be that your scripts are not executable?

Uh....
Let me make that more precise.
If you type
Code:
ls -l /your/script
what is the output you get? The line should begin with something like
Code:
-rwxr-xr-x
The x-es in there are essential to your script being executable

Do you start your scripts with #!/bin/sh or something?

You say your scripts don't execute. Do you get any error messages? What happens if you try to execute them?

Groetjes,

Kees-Jan
 
Old 12-07-2004, 04:34 AM   #8
mr_segfault
Member
 
Registered: Oct 2003
Location: Australia
Distribution: Redhat 9
Posts: 95

Rep: Reputation: 15
OK, firstly you must set the execute permission on the script if that is not already done.

The permissions, I don't know what you do and dont know, so you may know most of this, but it is easier just to present it as if you dont

with ls -la

-rwxr-xr-x 1 segfault segfault 721 Aug 5 09:19 myScript.sh

Generally speaking, the rwx's at the start (ignoring the first -) refer to three groups of permissions, owner (user), group, others. In the example above, the user (first three chars) show rwx, meaning that the user (owner) has read write and execute permissions. Next is group permissions r-x meaning that people in the same group have read and execute permissions (ie no write permissions) . Lastly is the permissions for others, r-x which in this example is the same permissions as the group users.

If you are interested in setting these permissions using octal notation, search the web for a good explanation. For simplicity you can set rudimentary permissions like read, write and execute using + and - commands to chmod.

+ = add permission
- = remove permission

a = all
u = user (or owner)
g = group
o = other

x = execute
w = write
r = read

eg:

chmod g-r myScript.sh

would remove read permissions from the group (being people in the same group)

giving:

-rwx--xr-x 1 segfault segfault 721 Aug 5 09:19 myScript.sh

So to make your script executable by you (the owner/user) you would use:

chmod u+r myScript.sh

This is a very simplistic explanation of the use of chmod, but google will find you a proper one.

There is a VERY good reason to require the ./ to execute a file in the current directory, and it goes a little sommin like this:

Imagine I do this..

Create a file called ls and place it in the /tmp directory of some machine (the /tmp location is not important, but is used in this example since most users have write access to /tmp)
containing scripting or binary code to do the following pseudo code:

if user executing has root permissions
then do something malicious and invoke the real ls
else
invoke real ls

Then if someone with root privleges types ls in /tmp ............

That is why it is considered a bad idea.

Simply adding . in your path will alliviate the need to place the ./ in front of the executable name, but will leave you open to attack like the one described above.

..segfault
 
Old 12-07-2004, 08:31 AM   #9
Winno
Member
 
Registered: Sep 2003
Location: Australia
Distribution: Fedora Core 3 / Mandrake 10.1 / Gentoo 2005.0
Posts: 100

Rep: Reputation: 15
One other thing that I bumped into was that partitions can be set so they don't allow any code to be run. Again, it's a another security measure so malicious code and code from other os's get run. To see if a partition is marked 'exec' or 'noexec', check the /etc/fstab file. Each line represents one partition, and options are on the right. If it's necessary, add the exec option (as root).
 
Old 12-07-2004, 04:55 PM   #10
leontini
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Fedora Core 8-10
Posts: 61

Rep: Reputation: 15
Hey all,

sorry for my lack of explanation. By executable, I meant shell scripts, programs, etc, written by the user, not istallalion programs or the like. Surely you should be able to put all of these files (with execute permissions set) into some directory, put that directory in your path, to have access to them from anywhere the user has execute permission. In my case (and from what I can tell aranfitz's) the problem is not that the partition has noexec set, because the files somehow become executable later, and other binaries and executable shell scripts can be run anyway. I use tcsh shell, could this be an issue with this particular shell? Aranfitz, what shell are you using?

Thanks and apologies
 
Old 12-08-2004, 01:49 AM   #11
aranfitz
LQ Newbie
 
Registered: Nov 2004
Location: Melbourne
Distribution: Fedora Core 3, Red Hat 9
Posts: 6

Original Poster
Rep: Reputation: 0
Well...
My shell is /bin/tcsh

As I wrote earlier, the only way i can execute is by typing /bin/tcsh before the executable.

As for the other comments, they would have been useful, but I've already tried them. This really is something sinister. However, keep the obvious ones coming, you never know what silly little thing you've missed. It's becoming clear however that this is not particularly common. Has anyone else installed FC3 yet?
 
Old 12-08-2004, 05:31 AM   #12
mr_segfault
Member
 
Registered: Oct 2003
Location: Australia
Distribution: Redhat 9
Posts: 95

Rep: Reputation: 15
aranfitz, to determine your problem you are going to need to give us a lot more information. Tell us exactly what you are tyring to do, what you have attempted, what does work, what doesn't. Give a single complete consise and understandable example from start to finish..
 
Old 12-08-2004, 05:00 PM   #13
aranfitz
LQ Newbie
 
Registered: Nov 2004
Location: Melbourne
Distribution: Fedora Core 3, Red Hat 9
Posts: 6

Original Poster
Rep: Reputation: 0
OK,

I gave the kernel version earlier.

The script "compile" looks like:

latex CTAC
bibtex CTAC
latexCTAC
latex CTAC
dvips -t a4 -o CTAC.ps CTAC.dvi

The permissions are set to _rwxrwxrwx

commands that don't work:
$compile
$./compile

commands that do work:
$/bin/tcsh compile
(That's right, I have to tell it which shell to execute it with)

Result of:
$echo $shell
/bin/tcsh

This problem may be coupled to a broader pernissions problem as often I am disallowed access to /dev/hdc (the cdrom device)

Hope this helps
 
Old 12-09-2004, 01:00 AM   #14
kees-jan
Member
 
Registered: Sep 2004
Distribution: Debian, Ubuntu, BeatrIX, OpenWRT
Posts: 273

Rep: Reputation: 30
these commands that don't work, what errors do they give?

Is the first line of your script
Code:
#!/bin/tcsh
??

Groetjes,

Kees-Jan
 
Old 12-10-2004, 06:26 PM   #15
aranfitz
LQ Newbie
 
Registered: Nov 2004
Location: Melbourne
Distribution: Fedora Core 3, Red Hat 9
Posts: 6

Original Poster
Rep: Reputation: 0
I have put #!/bin/tcsh at the start of the file, but it didn't help.

Thanks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Executables dudeman41465 Linux - Software 4 10-09-2005 07:59 PM
executables humblestudent87 Linux - Newbie 6 07-22-2004 11:42 AM
Executables q64 Linux - Newbie 3 03-29-2004 03:31 AM
Help on executables.... Kit Linux - General 9 12-06-2002 11:24 AM
Where are the executables? rooman Linux - Software 6 06-05-2002 02:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 11:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration