Operating System - HP-UX
1748169 Members
3925 Online
108758 Solutions
New Discussion юеВ

Re: exec permission denied to root with mode 777?

 
SOLVED
Go to solution
Steve Post
Trusted Contributor

exec permission denied to root with mode 777?

It seems really odd to me......
I have a file of mode 777
it's parent directory and all directories are 777.
I'm logged in as root.
I try to run the file.
It says "permission denied".
I even tried this as root on the console.
I also tried running it as other users.

Now if I make my own program: junk.sh
That works fine.

root@mybox:/usr/ud71/bin>file ./accessory
./accessory: ELF-32

root@mybox:/usr/ud71/bin>ls -l ./accessory
-r-xr-xr-x 1 277 999 9799 Nov 27 21:15 ./accessory

I'm hitting a wall here. Any ideas what is going on?


root@mybox:/usr/ud71/bin>./accessory
sh: ./accessory: Execute permission denied.
root@ob2b:/usr/ud71/bin>
6 REPLIES 6
James R. Ferguson
Acclaimed Contributor
Solution

Re: exec permission denied to root with mode 777?

Hi Steve:

One way you would see this behavior is if the executable wasn't an HP-UX binary.

Try 'chatr ./accessory' to evaluate it too.

Regards!

...JRF...
Steve Post
Trusted Contributor

Re: exec permission denied to root with mode 777?

Well that command returned nothing.
James R. Ferguson
Acclaimed Contributor

Re: exec permission denied to root with mode 777?

Hi (again) Steve:

Results will vary, but I am sure that this is NOT an HP-UX executable.

For example:

From a Fedora box, I took '/bin/date' and named it '/tmp/linuxdate':

# elfdump -f /tmp/linuxdate

/tmp/linuxdate:

*** ELF Header ***

Class: ELF-32
Data: Little-endian
OS: 0
ABI Version: 0
Type: EXEC
elfdump: Bad machine: 3 (elfdumperr 3004)
Version: 1
Entry Addr: 0x8049060
Program Hdr Offset: 0x34
Section Hdr Offset: 0xd0fc
Flags: 0x0
Elf Hdr Size: 0x34
Program Hdr Size: 0x20
Program Hdr Number: 8
Section Hdr Size: 0x28
Section Hdr Number: 32
Section Hdr String Idx: 31

# chatr /tmp/linuxdate
chatr(error): file /tmp/linuxdate is not a valid PA executable

From an AIX server:

# elfdump -f /tmp/aixdate
elfdump: Bad input file type: /tmp/aixdate (elfdumperr 2003)

# chatr /tmp/aixdate
chatr(error): chatr cannot recognize file type of file /tmp/aixdate

Regards!

...JRF...
Steve Post
Trusted Contributor

Re: exec permission denied to root with mode 777?

Nope. Jury is still out. I got a different answer from elfdump.
root@mybox:/usr/ud71/bin>elfdump -f ./accessory

./accessory:

*** ELF Header ***

Class: ELF-32
Data: Little-endian
OS: 0
ABI Version: 0
Type: EXEC
elfdump: Bad machine: 3 (elfdumperr 3004)
Version: 1
Entry Addr: 0x80487b0
Program Hdr Offset: 0x34
Section Hdr Offset: 0x15e4
Flags: 0x0
Elf Hdr Size: 0x34
Program Hdr Size: 0x20
Program Hdr Number: 7
Section Hdr Size: 0x28
Section Hdr Number: 27
Section Hdr String Idx: 24

Well I do have: "Bad machine: 3(elfdumperr 3004)"
Perhaps it's is just a bit naughty and not downright bad?
Steve Post
Trusted Contributor

Re: exec permission denied to root with mode 777?

What am I saying?!
You are right.
I just red the the details in your response.
It's the same error you have.

I agree.
Thanks.

Steve
Steve Post
Trusted Contributor

Re: exec permission denied to root with mode 777?

Ok. I found the nail that goes in that coffin.

The unidata version 7.1 I downloaded is for lunix. It says it is for linux,windows, aix, hpux, ..... It's not really accurate.
You see, unidata can run on all that stuff. But the demo can't. It can only run on linux.

I have an old version of the unidata from an ancient backup tape. I grabbed this "accessory" file and tried to run it. It bombed out. The OS is 32bit. I threw the same file on a 64 bit verson of hpux. It ran fine.