Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 67717 - xhost crashes when user is specified -- man page unclear on whether it's possible
Summary: xhost crashes when user is specified -- man page unclear on whether it's poss...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-15 13:57 UTC by Zdenek Behan
Modified: 2004-10-18 14:50 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zdenek Behan 2004-10-15 13:57:17 UTC
It seems that xhost does not accept a specific user prior to the hostname as a limiting criteria. See example:

rain@BH2 ~ $ xhost
access control enabled, only authorized clients can connect
LOCAL:
rain@BH2 ~ $ xhost +inet:rain@BH
rain@BH being added to access control list
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  109 (X_ChangeHosts)
  Value in failed request:  0xfe
  Serial number of failed request:  7
  Current serial number in output stream:  9
rain@BH2 ~ $ xhost
access control enabled, only authorized clients can connect
LOCAL:
rain@BH2 ~ $


Reproducible: Always
Steps to Reproduce:
1. As regular user running X type "xhost +inet:anybody@anywhere"
2. Watch it crash.
3. Happens everytime when you specify "user@" before the hostname.

Actual Results:  
Instead of adding the user and hostname, xhost says it already did and crashes. 
After the crash, "xhost" without parameters reports the same state as before 
attempting to add user.

Expected Results:  
According to the manpage,...

When Secure RPC is being used, the network independent netname (e.g., "nis:unix.
uid@domainname") can be specified, or  a  local  user  can  be specified with 
just the username and a trailing at-sign (e.g., "nis:pat@").

I'm not exactly sure if this is meant to work for "inet:" families as well (but 
i'd be surprised if you couldn't specify the user), and i couldn't try because 
my xhost is only compiled for inet. However, i'm almost positive it shouldn't 
crash at least. 

I am using the most recent Xorg version (6.8.0-r2), however, i've noticed the 
same problem in the previous version (and i upgraded in hope that somebody 
discovered the bug already :-). Linux kernel gentoo-dev-sources-2.6.8-r9 (most 
recent), but this obviously has nothing to do with sources, as the bug persists 
even when i upgrade.

PS: xhost man page is very incomprehensible, google out "xhost: bad hostname", i 
didn't find a single resolution to the problem of different local users 
connecting to the X server, other than the insecure "xhost +", and it's not 
exactly clear you need to do "xhost +Local:" from the manpage. Also, Local: is 
just a little bit less insecure, because it obviously does not accept user (ie. 
xhost +Local:root), and even though it's called family, it has only one empty 
member, thus "+Local:anything" always opens the X server for all locally logged 
users who specify the correct display.
Comment 1 Donnie Berkholz (RETIRED) gentoo-dev 2004-10-15 21:43:28 UTC
Is this via ssh? If so, try the -Y option to ssh.
Comment 2 Zdenek Behan 2004-10-15 23:29:46 UTC
Has nothing to do with ssh. I was trying to add trusted users to xhost, and i used local login (namely Konsole - xterm). Oh and i forgot to mention that i also have full permissions to do it, ie. i own the display, and i'm not running xhost as another user.
Comment 3 Donnie Berkholz (RETIRED) gentoo-dev 2004-10-16 17:45:14 UTC
I think what you may want is xauth.
Comment 4 Zdenek Behan 2004-10-18 13:12:54 UTC
Ahh, this will work. Thanks alot! (However, xhost still crashes for me under the conditions described, i guess it could say instead that there's a better utility to do the job, and not point out in the man page that you can "specify host name or a user name", which is rather confusing. Or something like that.)
Comment 5 Donnie Berkholz (RETIRED) gentoo-dev 2004-10-18 14:49:03 UTC
It appears that the username is only allowed in xhost when using NIS.
Comment 6 Donnie Berkholz (RETIRED) gentoo-dev 2004-10-18 14:50:19 UTC
If you'd like to file a bug at bugs.freedesktop.org on the clarity of the man page, feel free to do so. It'll probably get committed faster if you actually attach a diff to the man page.

Thanks!