From dimaqq at gmail.com Tue Jun 2 09:30:22 2015 From: dimaqq at gmail.com (Dima Tisnek) Date: Tue, 2 Jun 2015 09:30:22 +0200 Subject: [execnet-dev] gw python 2.4 broken, on purpose or just a bug? Message-ID: Commit 2df363b30a8b use-subprocess32-if-available (pull request #13) https://mail.python.org/pipermail/execnet-commit/2014-November/000276.html contains: 'subprocess': ['subprocess32' if SUBPROCESS32 else 'subprocess'], which breaks if target runs Python 2.4 I can't recall if 2.4 was abandoned, pypi used to stated 2.4-3.1, not it states 2.6-3.x what was the latest version that supported 2.4? From holger at merlinux.eu Tue Jun 2 10:25:01 2015 From: holger at merlinux.eu (holger krekel) Date: Tue, 2 Jun 2015 08:25:01 +0000 Subject: [execnet-dev] gw python 2.4 broken, on purpose or just a bug? In-Reply-To: References: Message-ID: <20150602082501.GN29732@merlinux.eu> On Tue, Jun 02, 2015 at 09:30 +0200, Dima Tisnek wrote: > Commit 2df363b30a8b > use-subprocess32-if-available (pull request #13) > https://mail.python.org/pipermail/execnet-commit/2014-November/000276.html > > contains: > > 'subprocess': ['subprocess32' if SUBPROCESS32 else 'subprocess'], > > which breaks if target runs Python 2.4 > > I can't recall if 2.4 was abandoned, pypi used to stated 2.4-3.1, not > it states 2.6-3.x what was the latest version that supported 2.4? Can't remember and don't have py24 isntalled. Please just try previous relases. holger > _______________________________________________ > execnet-dev mailing list > execnet-dev at python.org > https://mail.python.org/mailman/listinfo/execnet-dev > -- about me: http://holgerkrekel.net/about-me/ contracting: http://merlinux.eu From dimaqq at gmail.com Tue Jun 2 10:35:16 2015 From: dimaqq at gmail.com (Dima Tisnek) Date: Tue, 2 Jun 2015 10:35:16 +0200 Subject: [execnet-dev] gw python 2.4 broken, on purpose or just a bug? In-Reply-To: <20150602082501.GN29732@merlinux.eu> References: <20150602082501.GN29732@merlinux.eu> Message-ID: Also, there are 5 with statements in same file. So it looks like 2.5+ is really needed. Okay I'll roll back to 1.1 and generally work on getting newer Python everywhere. Cheers. On 2 June 2015 at 10:25, holger krekel wrote: > On Tue, Jun 02, 2015 at 09:30 +0200, Dima Tisnek wrote: >> Commit 2df363b30a8b >> use-subprocess32-if-available (pull request #13) >> https://mail.python.org/pipermail/execnet-commit/2014-November/000276.html >> >> contains: >> >> 'subprocess': ['subprocess32' if SUBPROCESS32 else 'subprocess'], >> >> which breaks if target runs Python 2.4 >> >> I can't recall if 2.4 was abandoned, pypi used to stated 2.4-3.1, not >> it states 2.6-3.x what was the latest version that supported 2.4? > > Can't remember and don't have py24 isntalled. Please just try previous > relases. > > holger > >> _______________________________________________ >> execnet-dev mailing list >> execnet-dev at python.org >> https://mail.python.org/mailman/listinfo/execnet-dev >> > > -- > about me: http://holgerkrekel.net/about-me/ > contracting: http://merlinux.eu From holger at merlinux.eu Wed Jun 3 17:50:24 2015 From: holger at merlinux.eu (holger krekel) Date: Wed, 3 Jun 2015 15:50:24 +0000 Subject: [execnet-dev] Question about ssh with sudo over execnet In-Reply-To: <555D2142.4040208@gmail.com> References: <555D2142.4040208@gmail.com> Message-ID: <20150603155024.GC29732@merlinux.eu> Hi Prasanna, i guess it is what is expected, yes. It's equivalent to not using execnet and doing "ssh HOST ; sudo " and then asking for os.getuid() which returns 0. best, holger On Wed, May 20, 2015 at 17:05 -0700, Prasanna Mulgaonkar wrote: > Hi Ronny: > > Noticed something today that no amount of googling seems to help > find an answer to-- > > If I open an ssh connection via execnet, and pass run the link with > sudo, it appears that the python interpreter at the remote end > operates with the userid and context of root, not the userid that is > used to log in. Is this expected behavior? Note that the userid used > to login is in the sudoers file with all privileges and NOPASS. > > Here are two examples. In both cases, the string cmd is: > > ``` > >>> cmd = """ > ... import os, pwd > ... channel.send(pwd.getpwuid(os.getuid()).pw_name) > ... """ > ``` > which basically returns the userid of the user logged in. > > First we run it with sudo: > ``` > >>> gw = execnet.makegateway("ssh=raxak at 104.b.c.d sudo") > >>> ch = gw.remote_exec(cmd) > >>> ch.receive() > 'root' > ``` > Note that the output is 'root' despite the fact we logged in with > raxak as the userid (raxak at 104...) > > Next we run the same thing without the sudo: > ``` > >>> gw = execnet.makegateway("ssh=raxak at 104.b.c.d") > >>> ch = gw.remote_exec(cmd) > >>> ch.receive() > 'raxak' > >>> > ``` > This correctly returns the userid as 'raxak' > > Just wanted to clarify if this is indeed the expected behavior or am > I misinterpreting the semantics of what should happen. > > _______________________________________________ > execnet-dev mailing list > execnet-dev at python.org > https://mail.python.org/mailman/listinfo/execnet-dev > -- about me: http://holgerkrekel.net/about-me/ contracting: http://merlinux.eu From prasanna.mulgaonkar at gmail.com Wed Jun 3 17:53:53 2015 From: prasanna.mulgaonkar at gmail.com (Prasanna Mulgaonkar) Date: Wed, 03 Jun 2015 08:53:53 -0700 Subject: [execnet-dev] Question about ssh with sudo over execnet In-Reply-To: <20150603155024.GC29732@merlinux.eu> References: <555D2142.4040208@gmail.com> <20150603155024.GC29732@merlinux.eu> Message-ID: <556F2311.5080306@gmail.com> Yup. I guess so. Don't know why I was so surprised. On 06/03/2015 08:50 AM, holger krekel wrote: > Hi Prasanna, > > i guess it is what is expected, yes. It's equivalent to > not using execnet and doing "ssh HOST ; sudo " and then asking > for os.getuid() which returns 0. > > best, > holger > > > On Wed, May 20, 2015 at 17:05 -0700, Prasanna Mulgaonkar wrote: >> Hi Ronny: >> >> Noticed something today that no amount of googling seems to help >> find an answer to-- >> >> If I open an ssh connection via execnet, and pass run the link with >> sudo, it appears that the python interpreter at the remote end >> operates with the userid and context of root, not the userid that is >> used to log in. Is this expected behavior? Note that the userid used >> to login is in the sudoers file with all privileges and NOPASS. >> >> Here are two examples. In both cases, the string cmd is: >> >> ``` >>>>> cmd = """ >> ... import os, pwd >> ... channel.send(pwd.getpwuid(os.getuid()).pw_name) >> ... """ >> ``` >> which basically returns the userid of the user logged in. >> >> First we run it with sudo: >> ``` >>>>> gw = execnet.makegateway("ssh=raxak at 104.b.c.d sudo") >>>>> ch = gw.remote_exec(cmd) >>>>> ch.receive() >> 'root' >> ``` >> Note that the output is 'root' despite the fact we logged in with >> raxak as the userid (raxak at 104...) >> >> Next we run the same thing without the sudo: >> ``` >>>>> gw = execnet.makegateway("ssh=raxak at 104.b.c.d") >>>>> ch = gw.remote_exec(cmd) >>>>> ch.receive() >> 'raxak' >> ``` >> This correctly returns the userid as 'raxak' >> >> Just wanted to clarify if this is indeed the expected behavior or am >> I misinterpreting the semantics of what should happen. >> >> _______________________________________________ >> execnet-dev mailing list >> execnet-dev at python.org >> https://mail.python.org/mailman/listinfo/execnet-dev >>