[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: exec: 58: /usr: Permission denied



# Probably not an X bug, but one has to start somewhere.
# Please cc me on replies.
reassign 615153 xserver-xorg
quit

Hi again,

Debian_bug_report wrote[1]:

> Sorry for the delay,

Now it's my turn to apologize.  Our analysts have been very carefully
looking over the information you sent and --- hey, who am I kidding.
In the original report, you wrote:

> So, when I restart my machine
> and try to start my X with the command "startx", the system returns the error:
> "xinit: connection to X server lost" and after said "Wait for X server to shut
> down" and stayed with prompt flashing again.

but the strace you sent does not show that message[2].  Instead it shows

  X: user not authorized to run the X server, aborting

due to

  open("/etc/X11/Xwrapper.config", O_RDONLY) = -1 EACCES (Permission denied)

What does "ls -l /usr/bin/X /etc/X11/Xwrapper.config" tell?  For reference,
on my system, it gives

 -rw------- 1 root root  601 Jan 31 08:31 /etc/X11/Xwrapper.config
 -rwsr-sr-x 1 root root 9024 Apr  2 10:23 /usr/bin/X

Notice in particular the setuid ("s") bits on X.  Is it the same on yours?
Do you use any unusual filesystem or kernel feature (selinux,
apparmor, etc) that might cause that not to work?

Also for reference I would be interested in the output from
"dpkg-query -W xserver-xorg x11-common".

That's all for now.  Hope that helps.

Regards,
Jonathan

[1] http://bugs.debian.org/615153
[2]
> So, I tried invoke X with root and
> I had sucess! When I went to the .xsession-errors I saw this error:
>
> Xsession: X session started for invisiblemanguard at Ter Fev 22 16:36:02 BRT 2011
> exec: 58: /usr: Permission denied

I admit I was more interested in what produces the latter message (so,
"sudo strace -f startx") but let's look at your stracelog for the
former.  First, a quick cast of characters:

 $ egrep '^[0-9]*  (clone|exec|wait|<... clone)' stracelog | think
 2300 startx
 - 2301 hostname
 - 2302 (startx)
   - 2303 hostname
   - 2304 grep
 - 2305 hostname
 - 2306 mcookie
 - 2307 mktemp
 - 2308 xauth
 - 2309 (startx)
   - 2310 xauth
   - 2311 sed
 - 2312 xauth
 - 2313 (startx)
   - 2314 xauth
   - 2315 sed
 - 2316 xauth
 - 2317 xinit
   - 2318 xserverrc -> X
 - 2319 rm

The expected symptom is "xinit: connection to X server lost", but
instead we get (from xinit):

  connect(3, {sa_family=AF_INET6, sin6_port=htons(6000), inet_pton(AF_INET6, "::1", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = -1 ECONNREFUSED (Connection refused)
  [...]
  connect(3, {sa_family=AF_INET, sin_port=htons(6000), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 ECONNREFUSED (Connection refused)
  close(3)                          = 0
  wait4(2318, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], WNOHANG, NULL) = 2318
  write(2, "xinit: ", 7)            = 7
  write(2, "giving up", 9)          = 9
  write(2, "\n", 1)                 = 1
  write(2, "xinit: ", 7)            = 7
  write(2, "unable to connect to X server", 29) = 29
  write(2, ": Connection refused\n", 21) = 21

What happened to the server?

  open("/etc/X11/Xwrapper.config", O_RDONLY) = -1 EACCES (Permission denied)
  lstat("/etc/X11/X", {st_mode=S_IFLNK|0777, st_size=13, ...}) = 0
  readlink("/etc/X11/X", "/usr/bin/Xorg", 1024) = 13
  access("/etc/X11/X", X_OK)        = 0
  getuid()                          = 1000
  write(2, "X: user not authorized to run th"..., 54) = 54
  exit_group(1)                     = ?

Ah.


Reply to: