Permission denied when running from xinetd

henro001 at gmail.com henro001 at gmail.com
Tue Nov 27 22:51:26 GMT 2007


On Nov 26, 2007 11:38 PM, Matt McCutchen <matt at mattmccutchen.net> wrote:
> On Sun, 2007-11-25 at 17:37 -0500, freightcar at gmail.com wrote:

> root.  Set a shell script like the following as the "server" in the
> xinetd configuration to verify that the daemon is running as root and to
> strace it to get more information about the failed chdir:
>
> #!/bin/bash
> echo $UID $EUID >/tmp/rsync.ids
> exec strace -f -o /tmp/rsync.strace /usr/bin/rsync --daemon
>


I have set the script as server, here is the section  of strace output
for both scenarios:


xinetd:


11891 open("/etc/group", O_RDONLY)      = 4
11891 fcntl64(4, F_GETFD)               = 0
11891 fcntl64(4, F_SETFD, FD_CLOEXEC)   = 0
11891 fstat64(4, {st_mode=S_IFREG|0644, st_size=702, ...}) = 0
11891 mmap2(NULL, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7d04000
11891 read(4, "root:x:0:root,rsync,henro\nbin:x:"..., 4096) = 702
11891 close(4)                          = 0
11891 munmap(0xb7d04000, 4096)          = 0
11891 chdir("/home/test")               = -1 EACCES (Permission denied)
11891 time(NULL)                        = 1196105171


standalone daemon:

11942 open("/etc/group", O_RDONLY)      = 4
11942 fcntl64(4, F_GETFD)               = 0
11942 fcntl64(4, F_SETFD, FD_CLOEXEC)   = 0
11942 fstat64(4, {st_mode=S_IFREG|0644, st_size=702, ...}) = 0
11942 mmap2(NULL, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f8c000
11942 read(4, "root:x:0:root,rsync,henro\nbin:x:"..., 4096) = 702
11942 close(4)                          = 0
11942 munmap(0xb7f8c000, 4096)          = 0
11942 chdir("/home/test")               = 0
11942 setgid32(0)                       = 0
11942 setgroups32(1, [0])               = 0
11942 setuid32(0)                       = 0
11942 geteuid32()                       = 0
11942 select(7, NULL, [6], NULL, {60, 0}) = 1 (out [6], left {60, 0})
11942 write(6, "@RSYNCD: OK\n", 12)     = 12


More information about the rsync mailing list