On 17.04.2019 8:51, Andy Smith wrote:
> Hi,
>
> On Tue, Apr 16, 2019 at 01:15:07PM +0500, Alexander V. Makartsev wrote:
>> On 16.04.2019 12:08, Andy Smith wrote:
>>> I don't have seamonkey installed so haven't tried myself, but does
>>> it even run as root?
>>>
>> I don't use SeaMonkey either, but I'm pretty sure it does not need root
>> privileges to run. :)
> My point is that the OP is asking why, when they click a link from
> within a GUI app that is running as root (synaptic), the wrong
> browser is launched. So what I am asking is, once the correct
> browser is set up via alternatives, isn't it going to launch
> seamonkey as root?
I was pretty sure it isn't gonna run browser as root. Because it is
pretty silly mistake from a developer standpoint.
Let's double check:
    $ sudo ps aux | egrep "x-www-browser|synaptic"
    amak 2344 0.0 0.0 4280 744 ? S 10:08 0:00 /bin/sh
/usr/bin/synaptic-pkexec
    root 2345 0.6 0.8 557104 142048 ? Sl 10:08 0:02 /usr/sbin/synaptic
    amak 2378 1.1 1.4 2121228 244576 ? Sl 10:09 0:03
/usr/bin/x-www-browser http://0install.net/

It looks like Synaptic starts with user privileges as a wrapper and
PolicyKit asks for root privileges to spawn actual synaptic process.
So Synaptic's UI and every process (e.g. x-www-browser) it spawns later
will run with user privileges.
Special actions, like package installation or removal, will be forwarded
to real synaptic process which is running as root.
>
> Further implication being, it is good to learn about the
> alternatives system, but maybe not a great idea to solve this
> problem this way.
There is no other sane way, I think. Synaptic will execute
"x-www-browser <URL>" so this symlink has to point to actual browser
and to manage those symlinks in a convenient and controllable way, you
should use "update-alternatives".
Of course, you can do the same thing by hand, but then you have to
remember and keep track of all changes to your "/bin", "/usr/bin", etc,
so you won't break anything later.


-- 
With kindest regards, Alexander.

⢀⣴⠾⠻⢶⣦⠀ 
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀⠀⠀⠀ 

Reply via email to