LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux > 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

Tags used in this thread
Popular LQ Tags , , ,

Reply
 
Thread Tools
Old 05-29-2007, 02:35 PM   #1
tim914
Member
 
Registered: Apr 2005
Location: Scottsdale, AZ USA
Distribution: Most of them :-)
Posts: 30
Thanked: 0
Question Any "consolehelper' pros out there?


[Log in to get rid of this advertisement]
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 02:37 PM..
tim914 is offline  
Tag This Post , , ,
Reply With Quote
Old 05-29-2007, 03:20 PM   #2
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: Debian Lenny / Squeeze / Sid
Posts: 7,213
Blog Entries: 5
Thanked: 246
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.
farslayer is offline     Reply With Quote
Old 05-29-2007, 03:31 PM   #3
tim914
Member
 
Registered: Apr 2005
Location: Scottsdale, AZ USA
Distribution: Most of them :-)
Posts: 30
Thanked: 0

Original Poster
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
tim914 is offline     Reply With Quote
Old 12-30-2008, 08:57 PM   #4
ahz
Member
 
Registered: Oct 2004
Posts: 56
Thanked: 0
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.
ahz is offline     Reply With Quote
Old 12-30-2008, 09:06 PM   #5
tim914
Member
 
Registered: Apr 2005
Location: Scottsdale, AZ USA
Distribution: Most of them :-)
Posts: 30
Thanked: 0

Original Poster
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
tim914 is offline     Reply With Quote
Old 12-31-2008, 09:14 AM   #6
ahz
Member
 
Registered: Oct 2004
Posts: 56
Thanked: 0
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.
ahz is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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
Need a "Pros" help with drive partitions dsptech Linux - General 6 06-06-2005 10:28 PM
help regarding consolehelper + userhelper echo77 Linux - Software 0 12-07-2004 04:15 AM
Consolehelper dosn't work anymore! fuzzyash Linux - General 2 08-26-2003 11:05 AM
consolehelper help ckjackson Linux - Security 0 07-24-2003 12:47 PM
consolehelper corrupted alanlq Linux - Software 0 02-19-2003 11:36 AM


All times are GMT -5. The time now is 03:46 PM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration