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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
05-29-2007, 01:35 PM
|
#1
|
Member
Registered: Apr 2005
Location: Scottsdale, AZ USA
Distribution: Most of them :-)
Posts: 37
Rep:
|
Any "consolehelper' pros out there?
I'm building a GUI app that needs to run as a root process. Digging around, I found Mike's "consolehelper" tool. The man page is inadequate and leaves much of the configuration of the pam environment totally uncovered.
Here's what I've done so far:
My App sits in a directory under /usr/sbin/myApp.d
I've created a symlink from /usr/bin/consolehelper to /usr/bin/myApp
I've created an entry in /etc/pam.d called myApp
It's contents are:
#%PAM-1.0
auth sufficient /lib/security/pam_rootok.so
auth required /lib/security/pam_pwdb.so
session optional /lib/security/pam_xauth.so
account required /lib/security/pam_permit.so
I've created an entry in /etc/security/console.apps called myApp
It's contents are:
USER=root
PROGRAM=/usr/sbin/myApp.d/myApp
SESSION=true
FALLBACK=true
However, when I attempt to execute myApp directly from /usr/bin/myApp, I get a window telling me "the exec() call falied" with no further info. Also, I'm not prompted for the password.
If I manually execute "sudo /usr/sbin/myApp.d/myApp" it runs.
Anyone have an idea of what I've missed? Do I need special bits on the real binary?
Thanks
Tim
Last edited by tim914; 05-29-2007 at 01:37 PM.
|
|
|
05-29-2007, 02:20 PM
|
#2
|
LQ Guru
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Rep: 
|
I'm not a programmer, but why not setup your application to call gksu when launched ? you said you were writing a GUI app, not a console based app.
http://www.nongnu.org/gksu/
Just a thought, since this is the method most of the system management applications use these days.
|
|
|
05-29-2007, 02:31 PM
|
#3
|
Member
Registered: Apr 2005
Location: Scottsdale, AZ USA
Distribution: Most of them :-)
Posts: 37
Original Poster
Rep:
|
Unfortunately, I can't always guarantee that gksu or kedsu will be available. In fact, on my FC6 system, gksu isn't even installed. And, since we're not devoted to one desktop or the other, we need something a bit more agnostic (I actually run XFCE). This is why consolehelper seems to fit the bill best. But, I'm not married to it if I can find something that is non-desktop specific.
Tim
|
|
|
12-30-2008, 07:57 PM
|
#4
|
Member
Registered: Oct 2004
Posts: 58
Rep:
|
Have you figured this out? I have the same dilemma, and I am considering PolicyKit. The catch I see now is it limits me to very modern Linux distributions.
|
|
|
12-30-2008, 08:06 PM
|
#5
|
Member
Registered: Apr 2005
Location: Scottsdale, AZ USA
Distribution: Most of them :-)
Posts: 37
Original Poster
Rep:
|
Nope - I've resorted to checking the "id" of the user and posting a dialog telling them that they must either sudo or run as root.
Tim
|
|
|
12-31-2008, 08:14 AM
|
#6
|
Member
Registered: Oct 2004
Posts: 58
Rep:
|
I may do that for the short term. A major drag about PolicyKit is it requires a significant amount of development to develop policies and D-BUS services.
|
|
|
All times are GMT -5. The time now is 07:01 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|