Re: Stretch with MATE DE - odd new file association problem

2019-04-17 Thread Andy Smith
Hello,

On Wed, Apr 17, 2019 at 10:53:34AM +0500, Alexander V. Makartsev wrote:
> It looks like Synaptic starts with user privileges as a wrapper and
> PolicyKit asks for root privileges to spawn actual synaptic process.

Ah okay, my mistake. Synaptic is another piece of software I've
never really used and had only got the impression from another
thread that it was having some issues with running under Wayland as
it is a GUI app that wants to do things as root. Good to hear that
it uses some privilege separation and isn't in fact running the
whole app as root.

Cheers,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting



Re: Stretch with MATE DE - odd new file association problem

2019-04-16 Thread Alexander V. Makartsev
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 " 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
⠈⠳⣄ 



Re: Stretch with MATE DE - odd new file association problem

2019-04-16 Thread Andy Smith
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?

Further implication being, it is good to learn about the
alternatives system, but maybe not a great idea to solve this
problem this way.

Cheers,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting



Re: Stretch with MATE DE - odd new file association problem

2019-04-16 Thread Alexander V. Makartsev
On 16.04.2019 12:08, Andy Smith wrote:
> Hello,
>
> On Tue, Apr 16, 2019 at 04:39:06AM +0500, Alexander V. Makartsev wrote:
>> You can add SeaMonkey config manually if you want, but you will have to
>> track the changes after that.
>>     $ sudo update-alternatives --install /usr/bin/x-www-browser
>> x-www-browser /your/path/to/seamonkey 100
> 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. :)
What command does is simply add an option to set "default something" for
a command "x-www-browser" system-wide.

"update-alternatives" could used for anything from switching between
your console editors to switching between multiple versions of compilers
or interpreters.
It is a standard way to do things like that on Linux systems not only on
Debian, but also on the others (CentOS, etc)


-- 
With kindest regards, Alexander.

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



Re: Stretch with MATE DE - odd new file association problem

2019-04-16 Thread didier gaumet
Le 15/04/2019 à 23:05, Richard Owlett a écrit :
[...]
>> root@fromdell:/home/richard# update-alternatives --config
>> gnome-www-browser
>> There is only one alternative in link group gnome-www-browser
>> (providing /usr/bin/gnome-www-browser): /usr/bin/firefox-esr
>> Nothing to configure.
>> root@fromdell:/home/richard#
> 
> That tells me "something"   P.S  but what?

That, strictly speaking, your system knows only firefox-esr as an
alternative.
Since Seamonkey is not packaged by Debian, when you install it, the
installation procedure does not declare it as an alternative, so you
have to do it yourself.

> Educate me -- What should I be reading?

man update-alternatives (I guess --set and then --config commands, not sure)

or you may use galternatives (GUI) that would be easier to add Seamonkey
as an alternative X-&-Gnome-browser and declare it the default.



Re: Stretch with MATE DE - odd new file association problem

2019-04-16 Thread Andy Smith
Hello,

On Tue, Apr 16, 2019 at 04:39:06AM +0500, Alexander V. Makartsev wrote:
> You can add SeaMonkey config manually if you want, but you will have to
> track the changes after that.
>     $ sudo update-alternatives --install /usr/bin/x-www-browser
> x-www-browser /your/path/to/seamonkey 100

I don't have seamonkey installed so haven't tried myself, but does
it even run as root?

If it does, I would consider running a web browser as root and
then actually using it to view a web site (that I didn't 100%
control, etc) to be really really unwise, for security reasons.

But maybe I am not giving it enough credit; perhaps it drops
privileges before continuing, or something.

Cheers,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting



Re: Stretch with MATE DE - odd new file association problem

2019-04-15 Thread Alexander V. Makartsev
On 16.04.2019 2:05, Richard Owlett wrote:
> On 04/15/2019 01:14 PM, Alexander V. Makartsev wrote:
>> On 15.04.2019 18:09, Richard Owlett wrote:
>>> Somehow I had messed up preferred application to open a file.
>>> I fixed by selecting a file of appropriate type, selecting
>>> Properties, and setting preferred application.
>>>
>>> That solved almost all my problems.
>>>
>>> The only exception is when using Synaptic.
>>> When I click on "Visit Homepage" it insists on using Firefox :<
>>> It used to open properly with my preferred browser SeaMonkey.
>>> All other HTML open correctly with SeaMonkey.
>>>
>>> Is another place I need to set preferences?
>>> TIA 
>> You can check what is set as default in "update-alternatives" configs
>> for browsers available in your system:
>>  $ sudo update-alternatives --config x-www-browser
>> and
>>  $ sudo update-alternatives --config gnome-www-browser
>
>
> I avoid "sudo" [with prejudice]
>
> I did
>> richard@fromdell:~$ su
>> Password: root@fromdell:/home/richard# update-alternatives --config
>> x-www-browser
>> There is only one alternative in link group x-www-browser (providing
>> /usr/bin/x-www-browser): /usr/bin/firefox-esr
>> Nothing to configure.
>> root@fromdell:/home/richard# root@fromdell:/home/richard#
>> root@fromdell:/home/richard# update-alternatives --config
>> gnome-www-browser
>> There is only one alternative in link group gnome-www-browser
>> (providing /usr/bin/gnome-www-browser): /usr/bin/firefox-esr
>> Nothing to configure.
>> root@fromdell:/home/richard#
>
> That tells me "something"   P.S  but what?
> Educate me -- What should I be reading?
Here is the output from one of my systems:
    $ sudo update-alternatives --config x-www-browser
    There are 3 choices for the alternative x-www-browser (providing
/usr/bin/x-www-browser).
   
      Selection    Path  Priority   Status
    
      0    /usr/bin/opera 120   auto mode
    * 1    /opt/firefox/firefox   100   manual mode
      2    /usr/bin/firefox-esr   70    manual mode
      3    /usr/bin/opera 120   manual mode
   
    Press  to keep the current choice[*], or type selection number:

I have 3 browsers installed and I've chosen the default one (#1) manually.
My web browser is set to "x-www-browser" in "Preferred Applications"
applet (Xfce), so I can switch between default browsers on demand by
setting it up in one place.

Since you have to use Synaptic as root, it will launch "x-www-browser"
(or "gnome-www-browser" depending on your DE) when you click on
"Homepage" button.
As you already discovered, your "x-www-browser" config has only one
option, so Synaptic executes "firefox-esr".
It looks like "SeaMonkey" browser doesn't provide "update-alternatives"
config for itself on installation, which is probably a bug.

You can add SeaMonkey config manually if you want, but you will have to
track the changes after that.
    $ sudo update-alternatives --install /usr/bin/x-www-browser
x-www-browser /your/path/to/seamonkey 100


-- 
With kindest regards, Alexander.

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



Re: Stretch with MATE DE - odd new file association problem

2019-04-15 Thread Richard Owlett

On 04/15/2019 01:14 PM, Alexander V. Makartsev wrote:

On 15.04.2019 18:09, Richard Owlett wrote:

Somehow I had messed up preferred application to open a file.
I fixed by selecting a file of appropriate type, selecting Properties, 
and setting preferred application.


That solved almost all my problems.

The only exception is when using Synaptic.
When I click on "Visit Homepage" it insists on using Firefox :<
It used to open properly with my preferred browser SeaMonkey.
All other HTML open correctly with SeaMonkey.

Is another place I need to set preferences?
TIA 
You can check what is set as default in "update-alternatives" configs 
for browsers available in your system:

     $ sudo update-alternatives --config x-www-browser
and
     $ sudo update-alternatives --config gnome-www-browser



I avoid "sudo" [with prejudice]

I did

richard@fromdell:~$ su
Password: 
root@fromdell:/home/richard# update-alternatives --config x-www-browser

There is only one alternative in link group x-www-browser (providing 
/usr/bin/x-www-browser): /usr/bin/firefox-esr
Nothing to configure.
root@fromdell:/home/richard# 
root@fromdell:/home/richard# 
root@fromdell:/home/richard# update-alternatives --config gnome-www-browser

There is only one alternative in link group gnome-www-browser (providing 
/usr/bin/gnome-www-browser): /usr/bin/firefox-esr
Nothing to configure.
root@fromdell:/home/richard# 



That tells me "something"   P.S  but what?
Educate me -- What should I be reading?

TIA

P.S. " *ONLY* dumb question is *1* not asked ;/





Re: Stretch with MATE DE - odd new file association problem

2019-04-15 Thread Alexander V. Makartsev
On 15.04.2019 18:09, Richard Owlett wrote:
> Somehow I had messed up preferred application to open a file.
> I fixed by selecting a file of appropriate type, selecting Properties,
> and setting preferred application.
>
> That solved almost all my problems.
>
> The only exception is when using Synaptic.
> When I click on "Visit Homepage" it insists on using Firefox :<
> It used to open properly with my preferred browser SeaMonkey.
> All other HTML open correctly with SeaMonkey.
>
> Is another place I need to set preferences?
> TIA 
You can check what is set as default in "update-alternatives" configs
for browsers available in your system:
    $ sudo update-alternatives --config x-www-browser
and
    $ sudo update-alternatives --config gnome-www-browser

-- 
With kindest regards, Alexander.

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



Stretch with MATE DE - odd new file association problem

2019-04-15 Thread Richard Owlett

Somehow I had messed up preferred application to open a file.
I fixed by selecting a file of appropriate type, selecting Properties, 
and setting preferred application.


That solved almost all my problems.

The only exception is when using Synaptic.
When I click on "Visit Homepage" it insists on using Firefox :<
It used to open properly with my preferred browser SeaMonkey.
All other HTML open correctly with SeaMonkey.

Is another place I need to set preferences?
TIA