View previous topic :: View next topic |
Author |
Message |
unixbhaskar Tux's lil' helper
Joined: 29 Nov 2007 Posts: 119 Location: India
|
Posted: Wed Sep 15, 2010 5:22 am Post subject: Strace is throwing permission denied error |
|
|
Here what I got :
Code: |
root@bhaskar-laptop_10:40:35_Wed Sep 15:/ # strace /dev/zero
execve("/dev/zero", ["/dev/zero"], [/* 22 vars */]) = -1 EACCES ([b]Permission denied)[/b]
dup(2) = 3
fcntl64(3, F_GETFL) = 0x2 (flags O_RDWR)
fstat64(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 2), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7705000
_llseek(3, 0, 0xbffa6050, SEEK_CUR) = -1 ESPIPE (Illegal seek)
write(3, "[b]strace: exec: Permission denied\n", 32strace: exec: Permission denied[/b]
) = 32
close(3) = 0
munmap(0xb7705000, 4096) = 0
exit_group(1) = ?
|
Why this is happening??
Here is my mounts where the binary reside:
Code: |
/dev/sda1 on / type ext3 (rw,relatime,errors=continue,barrier=0,data=writeback)
|
Please throw some light on it. _________________ Musing with GNU/Linux
Lenovo Thinkpad x250
x86_64 Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz GenuineIntel GNU/Linux
RAM : 8 GB
Kernel :Latest customized kernel
OS: Gentoo/Arch/Slackware/Debian/openSUSE/Fedora
Intel 965GM Chipset |
|
Back to top |
|
|
mikegpitt Advocate
Joined: 22 May 2004 Posts: 3224
|
Posted: Wed Sep 15, 2010 2:12 pm Post subject: |
|
|
Does the permissions denied only happen when you run `strace /dev/zero` or all the time? The reason you are receiving it in the /dev/zero example is because you can't execute /dev/zero. I get the same permissions denied on my machine as well.
Code: | $ ls -ltr /dev/zero
crw-rw-rw- 1 root root 1, 5 Sep 14 06:24 /dev/zero
|
Code: | $ strace /dev/zero
execve("/dev/zero", ["/dev/zero"], [/* 52 vars */]) = -1 EACCES (Permission denied)
dup(2) = 3
fcntl64(3, F_GETFL) = 0x2 (flags O_RDWR)
fstat64(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 4), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7848000
_llseek(3, 0, 0xbff8b188, SEEK_CUR) = -1 ESPIPE (Illegal seek)
write(3, "strace: exec: Permission denied\n", 32strace: exec: Permission denied
) = 32
close(3) = 0
munmap(0xb7848000, 4096) = 0
exit_group(1) = ?
|
|
|
Back to top |
|
|
unixbhaskar Tux's lil' helper
Joined: 29 Nov 2007 Posts: 119 Location: India
|
Posted: Wed Sep 15, 2010 2:30 pm Post subject: |
|
|
Sorry my mistake... I have got the desired result as I was trying to read from /dev/zero file ..so missed the cat in the command line will cause that error.Plus you can investigate with strace with any file not only with the executables.
Cheers mate! _________________ Musing with GNU/Linux
Lenovo Thinkpad x250
x86_64 Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz GenuineIntel GNU/Linux
RAM : 8 GB
Kernel :Latest customized kernel
OS: Gentoo/Arch/Slackware/Debian/openSUSE/Fedora
Intel 965GM Chipset |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|