LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-10-2017, 01:04 PM   #1
Altoid
Member
 
Registered: Oct 2016
Location: Southern Hemisphere
Distribution: Devuan
Posts: 110

Rep: Reputation: Disabled
wicd or wicd-gtk problem


Hello:

I have a problem with wicd or wicd-gtk, really cannot say.

It works perfectly except when I try to edit scripts via the GUI.

Package: wicd
Version: 1.7.4-1pclos2016

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

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

Behaviour:
The 'Scripts' button in the 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
---

It seems that Wicd is working properly because if I run /usr/share/wicd/gtk/configscript.py '4' 'wireless' in a terminal as root, I get the sequence expected from pressing the 'Scripts' button.

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

But ...

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
---

So ...
It would seem that the 'Scripts' button launches this:

Code:
gksudo /usr/share/wicd/gtk/configscript.py '4' 'wireless'
instead of launching this:

Code:
gksu /usr/share/wicd/gtk/configscript.py '4' 'wireless'
Apparently all the dependencies are met.

[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

Any help with this would be greatly appreciated.

Thanks in advance.

A.
 
Old 07-10-2017, 02:13 PM   #2
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009
The manual just says that configuring scripts requires root privileges, So, it's a bug that is not allowing a password box to pop up.

Network-manager is now the preferred tool. Wicd has fallen behind.
 
Old 07-12-2017, 09:03 AM   #3
Altoid
Member
 
Registered: Oct 2016
Location: Southern Hemisphere
Distribution: Devuan
Posts: 110

Original Poster
Rep: Reputation: Disabled
[SOLVED] wicd or wicd-gtk problem

Hello:

Problem solved.

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

For the 'Configure Scripts' application to actually launch, it needs an external graphical sudo program.

Code:
""" configscript -- Configure the scripts for a particular network.

Script for configuring the scripts for a network passed in as a
command line argument.  This needs to run a separate process because
editing scripts requires root access, and the GUI/Tray are typically
run as the current user.

"""
Wicd has a choice of any one of four options: gksudo, kdesu, ktsuss or 'Automatic'.
Any one of them can be chosen in the Wicd Preferences -> External Programs -> Graphical Sudo Application, 'Automatic' being the recommended one.

In 'Automatic', if the user doesn't have any of them installed, clicking on the menu icon fails, notifying that it could not run the script.

ie:
---
<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
---

My DE is not KDE so kdesu is not an option and ktsuss refuses to initialize.
See http://www.gtk.org/setuid.html

Being new to Linux (or just dumb), it was not really clear to me that what was actually missing wasn't configscript.py but gksudo.

Which makes sense since sudo is not part of the OS.

I spent a few afternoons looking around for a lead to the cause of this issue and found this:
https://bugs.debian.org/cgi-bin/bugr...cgi?bug=575403

Quote:
Well it was as easy as exchanging the order of "gksudo" and "gksu" on line 462 in the file
/usr/share/pyshared/wicd/misc.py
So I looked for the file, which is /usr/lib/python2.7/site-packages/wicd/misc.py and found it.
The line in question in this version is #560:

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"]   <-   change to progs = ["gksu", "gksudo", "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 ""
With this change, it works perfectly. =-)

ie: The 'Scripts' button in the Wicd network profile's properties dialog launches a window asking for root password and then launches the 'Configure Scripts (as superuser)' window.

Comment:
I think (?) that what was happening here was that the script did find gksudo but as in PCLinuxOS gksudo is not an executable but a link to the gksu executable, it failed.

But as it does find gksudo (making no differentiation between link and executable), it does not go on to use the next available option, gksu.

My guess is that this is because a link to an executable with a command line ('4' 'wireless') does not result in the linked-to executable with that same command line.

ie:
Code:
gksudo /usr/share/wicd/gtk/configscript.py '4' 'wireless'
Resulted in:
---
<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
---

Code:
gksu /usr/share/wicd/gtk/configscript.py '4' 'wireless'
Worked as expected.

If there was a way to do incorporate this to PCLinuxOS, any application calling gksudo (a link to the gksu executable) with a command line would run gksu (the executable) with the same parameters but asking for the password to elevate privileges first.

This would make the absence of gksudo in PCLinuxOS a non-issue.

Any comments/corrections welcome.

Thanks in adance.

A.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Wicd Could not connect to wicd's D-Bus interface GreenFireFly Slackware 6 04-29-2019 12:48 PM
wicd-gtk bad password debian rc_mandar Linux - Newbie 7 07-23-2014 05:37 PM
Wicd client Gtk: How to get rid of it? gargamel Slackware 10 11-13-2010 02:00 PM
WICD error, no module named gtk tmkd Slackware 4 05-23-2010 11:53 AM
WICD tray icon says not connected, WICD manager says conneted to wired network?!?! intheshadows Linux - Newbie 1 12-24-2009 12:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration