LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 06-11-2009, 12:32 PM   #1
sumitshining
LQ Newbie
 
Registered: Oct 2008
Posts: 29

Rep: Reputation: 15
providing root priviledges through a C program with GTK based gui


Hello Everyone,
I am writing an application for internet configuration in FEDORA and thus need to manipulate files which have access granted only to root. Thus a user change needs to be done through "su" and then providing the password.

What I want to ask is, how can I do this? Because when I run the program through a normal user it reports bug and exits.
 
Old 06-11-2009, 01:26 PM   #2
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,269

Rep: Reputation: 165Reputation: 165
sounds like a bad idea,

what are you trying to do?
 
Old 06-12-2009, 01:22 AM   #3
sumitshining
LQ Newbie
 
Registered: Oct 2008
Posts: 29

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bigearsbilly View Post
sounds like a bad idea,

what are you trying to do?
I made a GTK based GUI tool for configuring network, thus network files need to be manipulated. But this can be done only as root. So the tool is to be executed through terminal as root but if if it is executed directly or say as normal user it reports bug and exits. What I want to do id make another GTK based dialog in the same tool which when executed first asks for root password and then provides root priviledges to itself, i.e., the step of switching to the root through the terminal is not to be done rather this is done when the app is executed.
 
Old 06-12-2009, 04:49 AM   #4
giftlftr_23
Member
 
Registered: Oct 2008
Location: I live where I'm currently standing on
Distribution: fedora, opensuse
Posts: 34

Rep: Reputation: 17
PolicyKit? Look into it.
 
Old 06-12-2009, 07:03 AM   #5
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
Look at setuid (man 2 setuid).
 
Old 06-18-2009, 08:51 PM   #6
kike_coello
Member
 
Registered: Jul 2005
Location: maryland
Distribution: Ubuntu 9.04
Posts: 88

Rep: Reputation: 17
no dude, your program is fine, but run it with gksudo, read this site i found with google:

https://lists.ubuntu.com/archives/ub...er/000472.html
 
Old 06-22-2009, 01:29 AM   #7
sumitshining
LQ Newbie
 
Registered: Oct 2008
Posts: 29

Original Poster
Rep: Reputation: 15
Thanks a lot. I hope it works this time.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question, QT, GTK ... is there any more language to program a GUI in linux??? webquinty Linux - Newbie 4 11-07-2008 01:04 PM
Is there any Gui Based Program in Linux as Task Manager in Windows sheraz Linux - Software 5 09-06-2007 05:57 PM
Problem with font size on gtk based program eduac Linux - Software 1 03-21-2006 12:38 PM
start gui based program after user login shahidawan Linux - General 9 07-27-2005 08:46 PM
Gtk gui on a cgi perl program bruce1271 Linux - Software 2 12-08-2003 05:54 PM


All times are GMT -5. The time now is 08:06 AM.

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
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration