LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 11-07-2006, 11:48 AM   #1
ygloo
Member
 
Registered: Aug 2006
Distribution: slack
Posts: 323

Rep: Reputation: 30
file execution


there is a "file" in /root which permissions are:
-rw-r--r-- 1 root root

when i try:
/root/file <-'
answer is "permission denied"
when i try the same with a "." at the beggining - file executes!?
. /root/file <-'

and i'm trying this as a normal user (!root)
how to explain??
 
Old 11-07-2006, 12:01 PM   #2
fordeck
Member
 
Registered: Oct 2006
Location: Utah
Posts: 520

Rep: Reputation: 61
If the permissions for file are:

-rw-r--r-- 1 root root

This file is not executable

/root is the home directory of the supersuser root and a normal user should not be able to do anything in that directory.

/root on a typical install is not included in the PATH so if you were root and wanted to execute file you would have to type the absolute path to the file.
 
Old 11-07-2006, 12:25 PM   #3
soggycornflake
Member
 
Registered: May 2006
Location: England
Distribution: Slackware 10.2, Slamd64
Posts: 249

Rep: Reputation: 31
Quote:
when i try the same with a "." at the beggining - file executes!?
. /root/file <-'
No, it doesn't. It is sourced into the current shell, which is not the same as executing the file as a script.

And as fordeck says, you shouldn't be able to acces this file as a normal user. Make sure the permissions for /root are 700 (-rwx------).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
file execution zaid Linux - General 3 01-18-2006 06:32 AM
file execution zaid Linux - General 1 01-17-2006 08:28 PM
File execution on ftp (vsftpd) rkemp General 1 03-13-2004 08:48 AM
file execution doubt pongsu Linux - General 2 09-25-2003 02:23 PM


All times are GMT -5. The time now is 12:29 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration