[Xymon] Hobbit Permission Problem

Adam Goryachev adam at websitemanagers.com.au
Tue Mar 29 08:14:14 CEST 2011


On 29/03/2011 4:26 PM, David Baldwin wrote:
> What do you get when you do:
>
Thanks for the ideas, please see below for the results:
> # su - hobbit
> $ id -a
host:~# su - hobbit
hobbit at host:~$ id -a
uid=1000(hobbit) gid=104(hobbit) groups=4(adm),104(hobbit),244(blahblah)
> $ strace head -1 /var/log/messages
hobbit at host:~$ strace head -1 /var/log/messages
execve("/usr/bin/head", ["head", "-1", "/var/log/messages"], [/* 11 vars
*/]) = 0
brk(0)                                  = 0x8052000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or
directory)
mmap2(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xb7fcc000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=17335, ...}) = 0
mmap2(NULL, 17335, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7fc7000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or
directory)
open("/lib/i686/nosegneg/libc.so.6", O_RDONLY) = 3
read(3,
"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\260e\1\0004\0\0\0\4"..., 512)
= 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1425828, ...}) = 0
mmap2(NULL, 1431152, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = 0xb7e69000
mmap2(0xb7fc1000, 12288, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x158) = 0xb7fc1000
mmap2(0xb7fc4000, 9840, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7fc4000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xb7e68000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7e686b0,
limit:1048575, seg_32bit:1, contents:0, read_exec_only:0,
limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0xb7fc1000, 4096, PROT_READ)   = 0
munmap(0xb7fc7000, 17335)               = 0
open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=347504, ...}) = 0
mmap2(NULL, 347504, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7e13000
close(3)                                = 0
brk(0)                                  = 0x8052000
brk(0x8073000)                          = 0x8073000
open("/var/log/messages", O_RDONLY|O_LARGEFILE) = -1 EACCES (Permission
denied)
open("/usr/share/locale/locale.alias", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=2586, ...}) = 0
mmap2(NULL, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0xb7d13000
read(3, "# Locale name alias data base.\n# "..., 1048576) = 2586
read(3, ""..., 1048576)                 = 0
close(3)                                = 0
munmap(0xb7d13000, 1048576)             = 0
open("/usr/share/locale/en_AU/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1
ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1
ENOENT (No such file or directory)
write(2, "head: "..., 6head: )                = 6
write(2, "cannot open `/var/log/messages' f"..., 43cannot open
`/var/log/messages' for reading) = 43
open("/usr/share/locale/en_AU/LC_MESSAGES/libc.mo", O_RDONLY) = -1
ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT
(No such file or directory)
write(2, ": Permission denied"..., 19: Permission denied)  = 19
write(2, "\n"..., 1
)                    = 1
close(1)                                = 0
close(2)                                = 0
exit_group(1)                           = ?

> $ ltrace head -1 /var/log/messages
hobbit at host:~$ ltrace head -1 /var/log/messages
__libc_start_main(0x8049a70, 3, 0xbfffeb84, 0x804ef10, 0x804ef00
<unfinished ...>
setlocale(6,
"")                                                             = "en_AU"
bindtextdomain("coreutils",
"/usr/share/locale")                             = "/usr/share/locale"
textdomain("coreutils")                                                     
= "coreutils"
__cxa_atexit(0x804b3a0, 0, 0, 0xb7f64ff4,
0xbfffeae8)                        = 0
__ctype_b_loc()                                                             
= 0xb7e0a690
__errno_location()                                                          
= 0xb7e0a68c
__strtoull_internal(0xbfffef08, 0xbfffc934, 10, 0,
0xbfffc934)               = 1
getopt_long(2, 0xbfffeb88, "c:n:qv0123456789", 0x804f7a0,
NULL)              = -1
open64("/var/log/messages", 0,
01001170471)                                  = -1
__errno_location()                                                          
= 0xb7e0a68c
__errno_location()                                                          
= 0xb7e0a68c
__ctype_get_mb_cur_max(0x804833c, 0xbfffc914, 0xb7f8d7c4, 0,
0xb7f709e0)     = 1
dcgettext(0, 0x804fc09, 5, 0xb7e2e900,
0xb7e0a68c)                           = 0x804fc09
dcgettext(0, 0x804fc0b, 5, 0xb7e2e900,
0x804fc09)                            = 0x804fc0b
strlen("'")                                                                 
= 1
dcgettext(0, 0x804f15b, 5, 0x804f7a0,
0)                                     = 0x804f15b
__errno_location()                                                          
= 0xb7e0a68c
error(0, 13, 0x804f15b, 0x8051480, 0head: cannot open
`/var/log/messages' for reading: Permission denied
)                                        = 0
exit(1 <unfinished ...>
__fpending(0xb7f654e0, 0xb7f8cff4, 0x80485ac, 0xb7f64ff4,
1)                 = 0
fclose(0xb7f654e0)                                                          
= 0
__fpending(0xb7f65580, 0xb7f8cff4, 0x80485ac, 0xb7f64ff4,
1)                 = 0
fclose(0xb7f65580)                                                          
= 0
+++ exited (status 1) +++




More information about the Xymon mailing list