Date: Tue, 25 Jul 2017 20:36:54 +0000 From: Manish Jain <bourne.identity@hotmail.com> To: Polytropon <freebsd@edvax.de> Cc: "byrnejb@harte-lyne.ca" <byrnejb@harte-lyne.ca>, "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org> Subject: Re: FreeBSD-11, Mate, Terminal, Gvim Message-ID: <VI1PR02MB1200CA799271D535917ED023F6B80@VI1PR02MB1200.eurprd02.prod.outlook.com> In-Reply-To: <20170725215338.41ea83f0.freebsd@edvax.de> References: <a973035703bd510d1226163df5ac9a34.squirrel@webmail.harte-lyne.ca> <20170725210647.6f4c8fcd.freebsd@edvax.de> <VI1PR02MB1200A48204221928325FC148F6B80@VI1PR02MB1200.eurprd02.prod.outlook.com> <20170725215338.41ea83f0.freebsd@edvax.de>
index | next in thread | previous in thread | raw e-mail
> That is correct. Like "su -m", "xhost" is to be executed from > the (non-root) user that controls the display. But when you're > using the "su -m" approach, it usually isn't even needed. I tried this from my normal user shell (zsh) su - -m root -c 'echo $SHELL' That is not the right shell for root, which on my box uses bash. All the env variables : USER HOME SHELL are values for the normal user, not the root user. But the mess is a bit deeper - even though I am using the environment of the normal user (despite the leading - to su), I seem to have root privileges. When I run su - -m root -c gvim I can actually edit the files that only root has write permission for. So largely, the su -m approach lets gvim work with root privelelges, although the environment seems to be all wrong. 1) Is there some way I can actually do all the above from the root user account, using the normal user's existing X server ? I think that happens under Linux, so in theory it should be possible under FreeBSD too (even if merely as a hack). 2) gvim on my box has been compiled with GTK3+ support. GTK support enables specifying a --socketid. I wonder what is that and how to get the socket id of an existing GVIM session. Plus, could using socketid solve the issue of running gvim from the root account directly ? Thanks for replying. Manish Jainhelp
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?VI1PR02MB1200CA799271D535917ED023F6B80>
