zenmap as root not displayed

Bug #1263311 reported by Jörg Frings-Fürst
24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
nmap (Debian)
Fix Released
Undecided
Samuel Henrique
nmap (Ubuntu)
Fix Released
Low
David Britton

Bug Description

On a fresh 13.10 "zenmap as root" not displayed.

Both .desktop files exists:

ls -l /usr/share/applications/zen*
-rw-r--r-- 1 root root 277 Okt 10 15:07 /usr/share/applications/zenmap.desktop
-rw-r--r-- 1 root root 308 Okt 10 15:07 /usr/share/applications/zenmap-root.desktop

Revision history for this message
Jörg Frings-Fürst (jff-de) wrote :
Revision history for this message
Jörg Frings-Fürst (jff-de) wrote :
Revision history for this message
Jörg Frings-Fürst (jff-de) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in nmap (Ubuntu):
status: New → Confirmed
Lubo Diakov (lubod)
tags: added: xenial
Revision history for this message
Lubo Diakov (lubod) wrote :

The same, or at least very similar bug (perhaps a regression?) happening on Xenial 16.04 64 bit.

Output:

lsb_release -rd
Description: Ubuntu 16.04.3 LTS
Release: 16.04

dpkg -l zenmap
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-=================================
ii zenmap 7.01-2ubuntu all The Network Mapper Front End

dpkg -L zenmap|grep desktop
/usr/share/applications/zenmap-root.desktop
/usr/share/applications/zenmap.desktop

Seems the package puts both root and non-root .desktop files in /usr/share/applications and this is not shown in the menus! Oddly, something, most likely a prior version of the package, also from Ubuntu repositories (since I've never installed it from other repos or source), has left a non-root .desktop in /usr/share/app-install/desktop/zenmap:zenmap.desktop as shown below:

ls -la $(locate *zenmap*.desktop)
-rw-r--r-- 1 root root 398 сеп 10 2015 /usr/share/app-install/desktop/zenmap:zenmap.desktop
-rw-r--r-- 1 root root 277 мар 31 2016 /usr/share/applications/zenmap.desktop
-rw-r--r-- 1 root root 308 мар 31 2016 /usr/share/applications/zenmap-root.desktop

That top .desktop file seems to be the only one working, as shown in the attached screenshot. And yes, this is Lubuntu, though the bug appears to affect multiple Ubuntu variants, and is not Lubuntu specific, the original poster was on Ubuntu himself, since his screenshot shows Unity!

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Hi,
this is due to the desktop file using a binary that is not there.
  TryExec=su-to-root
  Exec=su-to-root -X -c zenmap %F

But
$ su-to-root
The program 'su-to-root' is currently not installed. You can install it by typing:
sudo apt install menu

If installing "menu" and reinstalling zenmap afterwards (or do any other menu refreshing action) it shows up.

The solution is to add "menu" to the Depends of zenmap in d/control of the nmap package.

Changed in nmap (Ubuntu):
status: Confirmed → Triaged
tags: added: bitesize server-next
Revision history for this message
Lubo Diakov (lubod) wrote :

Thank you for your answer. Good to have additional information.

Oddly, it appears to have fixed itself. I know I've rebooted at least once and installed other packages. (Though I'd think normally only logging out and back in is required, and I did that several times before I took the first screenshot) Perhaps the programs/filed you refer to are a dependency of whatever I installed afterward.

In any case, my request would be for the changes you mention to be made upstream, either in the Ubuntu or Debian packages, so they will work for everyone from now on, rather than fixed on a case by case basis. :-)

If there is any info. I can give you as to the state of my system now, that would explain why it works now or help make a permanent patch/bug fix, I'd be glad to help.

Revision history for this message
David Britton (dpb) wrote :

This is a debdiff for Bionic applicable to nmap 7.60-1ubuntu3. I built and installed it in a bionic instance and it pulled in the 'menu' package correctly. After the menu package is installed, the zenmap (as root) .desktop icon shows up in my DE (gnome-shell) just fine when searching for zenmap.

Changed in nmap (Ubuntu):
status: Triaged → In Progress
importance: Undecided → Low
assignee: nobody → David Britton (davidpbritton)
Changed in nmap (Debian):
status: Unknown → New
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "nmap_7.60-1ubuntu4.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Yeah just the change that I had in mind - thanks David.
Thanks for your build&check on this.

I totally agree to the proposed debdiff and will sponsor it to Bionic now.

Changed in nmap (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Oh I even thought we did a bigger oopsie here of a component mismatch (nmap in main but menu is not). Yet I found that zenmap (binary) of src:nmap is not in main either which explains why it migrated.
Maybe I should not have done the review in between meeting :-/ as also the bug reference you added was not following the regexp, but I set the status correctly here.

It is ok'ish and working for now, but we should follow on to clean up.

Per discussion in the linked Debian bug policykit-1 was recommended which is better (This was to desktoppy for me to know right away and I was just following the command that was used so far in my suggestion).

About recommends, the package (strictly speaking) can work without this, you can sudo it or use a root X11 session. So it really is more a recommends than a depends.

The calls look slightly different, but we need to adapt the su-to-root patch anyway.
Other examples of pkexec in .desktop files used wrappers, but those only do like:
pkexec "/usr/sbin/gparted" "$@"
Well we can do that directly in the desktop file I think unless somebody explains why a wrapper is needed. Well actually to run it from cmdline it would be nice to have one.

I had some issues that zenmap can't access the Display in that environment, but other programs could using the same mechanisms. I assume you need a bit more for polkit to work as it should in this case. The manpage mentions that it intentionally strips the environment.
After knowing that I found [1]
This is such a case as zenmap has no own polkit integration to do it right - so it is one of the legacy apps that needs this , see also [2] in regard to X11.

So we also need a policykit action *sigh*.

In a few iterations I got closer bug I think I'm not complete.
I'll attach a patch not meant to be complete yet (it might be incomplete and have side effects due to neither of us being a Desktop/policykit expert).

@David - if you'd give this another look to have a second set of eyes on it and finalize it to work that would be great. If you are good with it (or even with a partial suggest) you might pass it to the Debian bug. If you don't find it either maybe Rafael has the experience and do the cleanup of this even if we don't know all of the bits it needs.

[1]: https://unix.stackexchange.com/questions/203136/how-do-i-run-gui-applications-as-root-by-using-pkexec
[2]: http://manpages.ubuntu.com/manpages/xenial/man1/pkexec.1.html

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

dropped server-next as the issue is fixed for now, remaining issue to get a cleaner forward looking solution is no more bitesize - adapting tags.

tags: removed: bitesize server-next
Revision history for this message
Samuel Henrique (samueloph) wrote :

fixed on 7.70+dfsg1-4 with polkit as a Dependency, I'm uploading 7.70+dfsg1-5 now with polkit as Recommends

Changed in nmap (Debian):
importance: Unknown → Undecided
assignee: nobody → Samuel Henrique (samueloph)
assignee: Samuel Henrique (samueloph) → nobody
status: New → Fix Released
assignee: nobody → Samuel Henrique (samueloph)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.