Wicd 'Scripts' button not launching root PW window

Bug #1703118 reported by carlos on 2017-07-08
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
wicd
Undecided
Unassigned

Bug Description

Package: wicd
Version: 1.7.4-1pclos2016

Kernel 4.11.3-pclos2 #1 SMP Sun Jun 4 22:16:40 CDT 2017 x86_64 x86_64 x86_64 GNU/Linux

Expected behaviour:
Scripts button in the network profile's properties dialog should launch a window asking for root password and then launch the Configure Scripts (as superuser) window.

Behaviour:
Scripts button in a network profile's properties dialog launches a window with this text:

---
<b>Failed to run /usr/share/wicd/gtk/configscript.py '4' 'wireless' as user root.</b>
Failed to exec new process: No such file or directory
---

[groucho@groucho ~]$ apt-cache depends wicd

wicd-1.7.4-1pclos2016
  Depends: python >= 2.6
  Depends: python-urwid
  Depends: python-gobject
  Depends: pygtk2.0
  Depends: python-dbus
  Depends: wireless-tools
  Depends: </bin/sh>
    bash-4.3-48.1pclos2017
  Depends: </bin/sh>
    bash-4.3-48.1pclos2017
  Depends: </bin/sh>
    bash-4.3-48.1pclos2017
  Depends: </bin/sh>
    bash-4.3-48.1pclos2017
  Depends: python >= 2.7
[groucho@groucho ~]$

Installed:

python 2.7.9
python-urwid 1.1.1
python-gobject 2.28.6
pygtk2.0 2.24.0
python-dbus 1.2.4
wireless-tools 30
bash-4.3-48.1pclos2017

Other:

Running /usr/share/wicd/gtk/configscript.py '4' 'wireless' in a terminal as root works as expected from the Scripts button.

Running gksu /usr/share/wicd/gtk/configscript.py '4' 'wireless' in a terminal works as expected ie: launches a window asking for root password and then launches the Configure Scripts (as superuser) window.

Running gksudo /usr/share/wicd/gtk/configscript.py '4' 'wireless' in a terminal launches a window with this text:

---
<b>Failed to run /usr/share/wicd/gtk/configscript.py '4' 'wireless' as user root.</b>
Failed to exec new process: No such file or directory
---

Thanks in advance.

A.

carlos (altoid) on 2017-07-10
description: updated
carlos (altoid) wrote :

Hello:

I think I have found a simple solution to this issue which can be instrumented without any coding.

In my case, this problem arose because my distro (PCLinuxOS) does not have gksudo.
Or sudo for that matter.

I found a lead to the problem here:
https://bugs.debian.org/cgi-bin/bugr...cgi?bug=575403

Someone had a similar issue with the graphical sudo program needed for Wicd.

In the absence of any one of the three graphical sudo programs Wicd has as options (gksudo, gksu or ktsuss), the misc.py script does this:

[code]
549 def choose_sudo_prog(prog_num=0):
550 """ Try to intelligently decide which graphical sudo program to use. """
551 if prog_num:
552 return find_path(_sudo_dict[prog_num])
553 desktop_env = detect_desktop_environment()
554 env_path = os.environ['PATH'].split(":")
555 paths = []
556
557 if desktop_env == "kde":
558 progs = ["kdesu", "kdesudo", "ktsuss"]
559 else:
560 progs = ["gksudo", "gksu", "ktsuss"]
561
562 for prog in progs:
563 paths.extend([os.path.join(p, prog) for p in env_path])
564
565 for path in paths:
566 if os.path.exists(path):
567 return path
568 return ""

[/code]

In PCLinuxOS, gksudo exists but only as a link to the gksu executable, which is why running ...

[code]
gksudo /usr/share/wicd/gtk/configscript.py '4' 'wireless'
[/code]

... fails but ...

[code]
gksu /usr/share/wicd/gtk/configscript.py '4' 'wireless'
[/code]

... works as expected.

The script does find gksudo but it is not an executable so it fails. (?)

So the solution found by the author of the post above is to change the order of the graphical sudo programs the misc.py script will use when none is found.

ie:
---
560 progs = ["gksudo", "gksu", "ktsuss"] <- change to progs = ["gksu", "gksudo", "ktsuss"]
---

This would make the absence of gksudo (more and more common) a non-issue and carry it through until Wicd uses PolKit to authenticate UIs to the daemon.

Comments and corrections welcome.

Thanks in advance.

C.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers