Bug in agent.py, and shadowing

2 views
Skip to first unread message

Brian

unread,
Feb 4, 2010, 3:31:32 PM2/4/10
to neatx
I'm trying to get shadowing working, and ran into what looks like a
bug in agent.py (svn r49).

At line 554 it has:

opts["shadowuid"] = self._ctx.uid

But self._ctx.uid is an integer, not a string, and this blows up later
at agent.py:652 with the error
"TypeError: argument of type 'int' is not iterable"

Anyway, changing this to "str(self._ctx.uid)" in my copy worked, and I
can shadow my own session.
If this looks like a real bug, please accept my contribution to your
project.

Note: there are still issues, and I'd REALLY REALLY like to see
shadowing of other peoples sessions working, since this is the killer
feature for me. I'll be happy to help if I can....

Jordan Gray

unread,
Feb 6, 2010, 6:09:35 PM2/6/10
to neatx
Looks like a good catch on a bug to me. When I make your mod and
recompile, it fixes my problem shadowing.

--Jordan

Jordan Gray

unread,
Feb 8, 2010, 11:54:47 PM2/8/10
to neatx
BTW, there's a simple little hack you can use to get shadowing of any
user working. It seems to only work for root, I assume, because of
the way neatx handles permissions on the sessions directory. ymmv

--Jordan

root@localhost [~/tmp/neatx-read-only/neatx/lib/app]# diff -u
nxserver.py.original nxserver.py
--- nxserver.py.original 2010-02-08 22:51:42.000000000 -0600
+++ nxserver.py 2010-02-08 22:52:10.000000000 -0600
@@ -323,7 +323,7 @@

return True

- return mgr.FindSessionsWithFilter(ctx.username, _Filter)
+ return mgr.FindSessionsWithFilter(None, _Filter)

def _StartSession(self, args):
"""Handle the startsession NX command.

Stephen Shirley

unread,
Feb 9, 2010, 5:24:54 PM2/9/10
to ne...@googlegroups.com
On Thu, Feb 4, 2010 at 21:31, Brian <br...@lstc.com> wrote:
> Anyway, changing this to "str(self._ctx.uid)" in my copy worked, and I
> can shadow my own session.
> If this looks like a real bug, please accept my contribution to your
> project.

Yup, that's a real bug, thanks for finding it and suggesting the fix!

Steve
--
"You are technically correct, the best kind of correct."
- Bureaucrat 1.0, Futurama

Stephen Shirley

unread,
Feb 9, 2010, 5:27:09 PM2/9/10
to ne...@googlegroups.com
On Tue, Feb 9, 2010 at 05:54, Jordan Gray <jordan...@gmail.com> wrote:
> BTW, there's a simple little hack you can use to get shadowing of any
> user working.  It seems to only work for root, I assume, because of
> the way neatx handles permissions on the sessions directory.  ymmv

Indeed. Anyone who has read/write permissions for for
<sessiondir>/nxnode.sock, and read permissions for
<sessiondir>/neatx.data should be able to shadow a session. As you
say, root has that, no problem. If you remove that check, and handle
the permissions appropriately yourself, then yeah, shadowing between
users should work.

Reply all
Reply to author
Forward
0 new messages