root programs

Discuss Programming

root programs

Postby Stryker » Tue Feb 10, 2004 4:16 am

I've been working on a graphical configuration utility for /etc/limits. It works good but the only problem is it needs to be run as root. Does anyone know how I would go about prompting for the root password and then running it as root (like most system configuration programs do)?
Stryker
scripter
scripter
 
Posts: 98
Joined: Thu Jan 23, 2003 8:50 pm

Postby Basher52 » Tue Feb 10, 2004 5:08 am

have you tried using 'su' ?
User avatar
Basher52
guru
guru
 
Posts: 881
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Postby Stryker » Tue Feb 10, 2004 5:51 am

i'm not looking for anything like su or sudo. I need it to prompt, graphically, for a root password just as any other system configuration utility does.
Stryker
scripter
scripter
 
Posts: 98
Joined: Thu Jan 23, 2003 8:50 pm

Postby Void Main » Tue Feb 10, 2004 11:42 am

You might want to look at this message where I talk about consolehelper:

viewtopic.php?t=244&p=1804#1804

If you need more help than that, let me know.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Stryker » Tue Feb 10, 2004 9:35 pm

wow, that's exactly what i wanted. i spent the last half hour looking for a place to download it. and all i could find were rpms (which doesnt help me when i'm using a cpk based system), would anyone be willing to extract the .src.rpm and put it in a .tar.gz?

thanks
Stryker
scripter
scripter
 
Posts: 98
Joined: Thu Jan 23, 2003 8:50 pm

Postby Void Main » Tue Feb 10, 2004 9:40 pm

I don't understand. You should have everything you need already installed. That is if you are already being prompted for root password via consolehelper. What distro you running?
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Stryker » Tue Feb 10, 2004 9:44 pm

I'm running calyptos right now. I'm making my own configuration stuff for it. My fedora machine (which isn't working right now) had those dialog box things and that's what i was referring to. I should've been more clear but i didnt think it was too important. sorry for the confusion though.
Stryker
scripter
scripter
 
Posts: 98
Joined: Thu Jan 23, 2003 8:50 pm

Postby Void Main » Tue Feb 10, 2004 9:53 pm

Here's the source from the latest src.rpm:

http://voidmain.is-a-geek.net/files/stryker/
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Stryker » Tue Feb 10, 2004 10:11 pm

thanks again
Stryker
scripter
scripter
 
Posts: 98
Joined: Thu Jan 23, 2003 8:50 pm

Postby Stryker » Wed Feb 11, 2004 4:14 am

alright well after fighting my way through dependencies (the distro's not complete yet) i ran into a problem. Everything's installed fine, i think, and i followed all the instructions in the other thread, and when running the program i get an error "userhelper must be setuid root". This looks like it has an easy solution and I feel like a newb again for not knowing. Any advice?
Stryker
scripter
scripter
 
Posts: 98
Joined: Thu Jan 23, 2003 8:50 pm

Postby Tux » Wed Feb 11, 2004 6:01 am

Doesn't that mean it wan't you to turn the suid bit on for userhelper?
Tux
guru
guru
 
Posts: 689
Joined: Wed Jan 08, 2003 10:40 am

Postby Stryker » Wed Feb 11, 2004 6:10 am

i did chmod u+s /usr/sbin/userhelper and now i get an "unknown error" when trying to run it. there's no more details other than that :(
Stryker
scripter
scripter
 
Posts: 98
Joined: Thu Jan 23, 2003 8:50 pm

Postby Tux » Wed Feb 11, 2004 6:29 am

I think it is quite likely you would have to do +s because it is already owned by root so surely setting the suidbit for root would serve no purpose?

EDIT: Disregard this, I think i'm talking rubbish.
Tux
guru
guru
 
Posts: 689
Joined: Wed Jan 08, 2003 10:40 am

Postby Stryker » Wed Feb 11, 2004 6:35 am

I got the same results, so I think that fixed that problem and just moved me on to another one. If I had to guess i'd say there's something wrong with my pam configuration. somewhere. I just installed pam and it didn't add any configuration files or anything so I added the mentioned ones in the other thread manually (and the folders) and added an "other" file and a "system-auth" file, i think i may be missing something.
Stryker
scripter
scripter
 
Posts: 98
Joined: Thu Jan 23, 2003 8:50 pm

Postby Stryker » Wed Feb 11, 2004 6:40 am

i dont have a /etc/pam.conf file, maybe that's it. i'm not sure how to go about making one either. i've never had to mess with pam before.
Stryker
scripter
scripter
 
Posts: 98
Joined: Thu Jan 23, 2003 8:50 pm

Next

Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron