Results 1 to 3 of 3

Thread: root-priviliges in application

  1. #1
    Join Date
    Oct 2006
    Posts
    5
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default root-priviliges in application

    Hi

    I am making a kde application with Ruby. The application must run a few system commands that require root-priviliges. How can I best achieve this?
    The user should have to enter the password only once, and only if using the part of the program that requires root-priviliges.

    Thanks,
    Bjorn

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: root-priviliges in application

    I think it is not that easy. You can use KDEsu to get root priviledges for a separate process, but I doubt you can make your process gain priviledges. If you only want external applications to have root access, then simply ask for a password and then use KProcess to run the "su" command passing it the command you want to execute.

  3. #3
    Join Date
    Oct 2006
    Posts
    5
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: root-priviliges in application

    Thanks. That seems to work. I use sudo. The new process emitts a signal when it asks for password, and my program can pass along the password previously entered by the user

Similar Threads

  1. Replies: 3
    Last Post: 8th December 2006, 19:51
  2. Application default font
    By larry104 in forum Qt Programming
    Replies: 2
    Last Post: 16th September 2006, 02:24
  3. Gnome makes application crash
    By regix in forum Qt Programming
    Replies: 35
    Last Post: 18th August 2006, 20:44
  4. 4.1.4 built from source, qmake fails with Hello World
    By Mookie in forum Installation and Deployment
    Replies: 6
    Last Post: 28th June 2006, 00:13
  5. Replies: 3
    Last Post: 31st March 2006, 19:38

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.