sudo X apps fails on NFS mounted homes
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sudo (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: sudo
With upgrade to gutsy, sudo and kdesu stopped working.
user@localhost ~> sudo xterm
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
Warning: This program is an suid-root program or is being run by the root user.
The full text of the error or warning message cannot be safely formatted
in this environment. You may get a more descriptive message by running the
program as a non-root user or by removing the suid bit on the executable.
xterm Xt error: Can't open display: %s
Note: The user's home is mounted via NFS (via default root_squash option). Moving it to a local directory makes the above work.
Some analysis with strace (see trace below) showed that sudo tries to access the user's ~/.Xauthority file, but fails due to the restricted root access on the NFS share.
This was working without problems on feisty, in exactly this configuration. For reasons of security it is probably needles to say that setting no_root_squash option on the NFS share is *no*`option.
blafasel@localhost ~> sudo strace -f xterm
with home on NFS share: htons(6010) , sin_addr= inet_addr( "127.0. 0.1")}, 16) = 0 htons(39424) , sin_addr= inet_addr( "127.0. 0.1")}, [16]) = 0 htons(6010) , sin_addr= inet_addr( "127.0. 0.1")}, [16]) = 0 "/export/ home/blafasel/ .Xauthority" , R_OK) = -1 EACCES (Permission denied) v\0\0\0\ 0\0\0\0\ 0\0", 12}], 1) = 12
...
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3
setsockopt(3, SOL_TCP, TCP_NODELAY, [1], 4) = 0
setsockopt(3, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0
connect(3, {sa_family=AF_INET, sin_port=
getsockname(3, {sa_family=AF_INET, sin_port=
getpeername(3, {sa_family=AF_INET, sin_port=
uname({sys="Linux", node="jake", ...}) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC) = 0
access(
writev(3, [{"l\0\
fcntl64(3, F_GETFL) = 0x2 (flags O_RDWR)
fcntl64(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
read(3, "", 8) = 0
write(2, "X connection to localhost:10.0 b"..., 75X connection to localhost:10.0 broken (explicit kill or server shutdo
wn).
) = 75
exit_group(1) = ?
home on local dir: htons(6010) , sin_addr= inet_addr( "127.0. 0.1")}, 16) = 0 htons(60940) , sin_addr= inet_addr( "127.0. 0.1")}, [16]) = 0 htons(6010) , sin_addr= inet_addr( "127.0. 0.1")}, [16]) = 0 "/tmp/blafasel/ .Xauthority" , R_OK) = 0 tmp/blafasel/ .Xauthority" , O_RDONLY) = 4 S_IFREG| 0600, st_size=50, ...}) = 0 PROT_WRITE, MAP_PRIVATE| MAP_ANONYMOUS, -1, 0) = 0xb7f9b000 4jake\0\ 00210\0\ 22MIT-MAGIC- COOKIE- 1"..., 4096) = 50 v\0\0\0\ 22\0\20\ 0\0\0", 12}, {"MIT-MAGIC- COOKIE- 1", 18}, {"\0\0", 2}, {"\307\ 273\303\ 17\371\ 334Fcg\ 32\227+ \30\300\ 212\263" , 16}], 4) = 48
...
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3
setsockopt(3, SOL_TCP, TCP_NODELAY, [1], 4) = 0
setsockopt(3, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0
connect(3, {sa_family=AF_INET, sin_port=
getsockname(3, {sa_family=AF_INET, sin_port=
getpeername(3, {sa_family=AF_INET, sin_port=
uname({sys="Linux", node="jake", ...}) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC) = 0
access(
open("/
fstat64(4, {st_mode=
mmap2(NULL, 4096, PROT_READ|
read(4, "\1\0\0\
read(4, "", 4096) = 0
close(4) = 0
munmap(0xb7f9b000, 4096) = 0
writev(3, [{"l\0\