-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
migrating from xpyb #111
Comments
On Mon, Sep 14, 2020 at 11:06:19AM -0700, Ted X Toth wrote:
I've got some old code that used xpyb to get and set the SELinux context of some X resources that I'm looking to port to python3. I've started to looking at using xcffib. But just playing around in the interpreter I got an exception when I tried to get a windows context:
>>> import xcffib
>>> import xcffib.xselinux
>>> c = xcffib.connect()
>>> c2 = xcffib.wrap(xcffib.ffi.cast("long", c._conn))
>>> xselinux = c2(xcffib.xselinux.key)
>>> xselinux.GetWindowContext(0x400139)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/site-packages/xcffib-0.10.1-py3.6.egg/xcffib/xselinux.py", line 246, in GetWindowContext
return self.send_request(7, buf, GetWindowContextCookie, is_checked=is_checked)
File "/usr/local/lib/python3.6/site-packages/xcffib-0.10.1-py3.6.egg/xcffib/__init__.py", line 391, in send_request
seq = self.conn.send_request(flags, xcb_parts + 2, xcb_req)
File "/usr/local/lib/python3.6/site-packages/xcffib-0.10.1-py3.6.egg/xcffib/__init__.py", line 573, in wrapper
self.invalid()
File "/usr/local/lib/python3.6/site-packages/xcffib-0.10.1-py3.6.egg/xcffib/__init__.py", line 559, in invalid
raise ConnectionException(err)
xcffib.ConnectionException: xcb connection shutdown because extension not supported
I'm running on a centos7 box with:
libxcb-1.13-1.el7.x86_64
libxcb-devel-1.13-1.el7.x86_64
xcb-proto-1.13-4.el7.noarch
installed.
Any pointers as to what I'm doing wrong would be appreciated.
Do you have the selinux extensions enabled? (i.e. what is the output
of `xffib.xproto.xprotoExtension(c).ListExtensions().reply().names`?
|
for ext in xcffib.xproto.xprotoExtension(c).ListExtensions().reply().names: output: so apparently the selinux extension isn't enabled. I don't recall doing anything in the old code to enable it and I see the extension shared library in the rpm: Is there something I need to do to enable it? |
Oops the xserver I'm querying is on my Mac not the centos box I ssh'd into :( |
I've got some old code that used xpyb to get and set the SELinux context of some X resources that I'm looking to port to python3. I've started to looking at using xcffib. But just playing around in the interpreter I got an exception when I tried to get a windows context:
I'm running on a centos7 box with:
libxcb-1.13-1.el7.x86_64
libxcb-devel-1.13-1.el7.x86_64
xcb-proto-1.13-4.el7.noarch
installed.
Any pointers as to what I'm doing wrong would be appreciated.
The text was updated successfully, but these errors were encountered: