Results 1 to 14 of 14

Thread: QProcess Shell Command (Linux) Elevate Privileges?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2011
    Posts
    36
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    14

    Default Re: QProcess Shell Command (Linux) Elevate Privileges?

    Hmmm I thought of that too, the main problem with this approach is that Fedora and CentOs have no sudo installed (OpenSuse, Ubuntu and (K)Ubuntu do) as a standard so I need to use su - in general. For Debian alike only KDE/Gnome support kdesudo and gksudo, but not all of them. On Ubuntu for example su - won't work at all, since that needs the root password and root is a disabled account. So I'd need to use sudo su- or the GUI gksudo/kdesudo. Either way I must see into preventing the Home directory from being set to root (with su- or sudo) and I need to copy the .Xauthority to a temporary place else the work environment becomes root (as it does now). I am running out of scope with making a Linux/Win Installer and was wondering if there are any alternatives? As for now it looks like making an RPM/DEB file is the only way or suffer a blow when using QProcess.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: QProcess Shell Command (Linux) Elevate Privileges?

    but cannot set symlinks in $HOME/Desktop/ pointing to /usr/share/icons/<icon-size>/apps directory without elevating permissions
    If the user's home directory is not writeable to the user then it seems you have larger problems to deal with.

    Is the point of this entire exercise to allow random user A to install the software on the system for use by all users or just themselves?

    If this is meant to be a user-only install then there should be no need for elevated privileges. Install in a user-writeable area, put a *.desktop file into .local/share/applications and you should be done.

    If the software is to be installed system wide then (IMHO) far and away the best packaging option is the native one for the relevant system. Then the user, who is familiar with their own system, can use the system's familiar tools to install and uninstall your software. Of course, this imposes a work load on you if you want to do this for half a dozen different packaging schemes. There's no way around requiring elevated rights to install system-wide and no way to accommodate every variation on a theme.

  3. The following user says thank you to ChrisW67 for this useful post:

    m3rlin (7th April 2013)

  4. #3
    Join Date
    Dec 2011
    Posts
    36
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    14

    Default Re: QProcess Shell Command (Linux) Elevate Privileges?

    @ChrisW67, no the problem is with the system wide install, by random user X, installing my program for anyone.

    I am considering (I might not have a choice) not installing my program as a system wide application, to avoid all the mess as you mentioned. What remains on the table is the HOW TO elevate user privileges on Linux Distro's in a proper manner using a GUI with QProcess. It has degraded from must implement to the "I MUST KNOW HOW" feeling. So I cross-posted my question on a Linux Forum where they suggested I'd write a make script to handle elevations for the worker process (B) - leaving the GUI out of it. But that defies the purpose of my installer. I will find out how to do this eventually. In the mean time I thank you all for supporting this topic.

Similar Threads

  1. How to run shell command after compile finished in pro file?
    By hashb in forum Installation and Deployment
    Replies: 1
    Last Post: 11th May 2011, 16:10
  2. Replies: 2
    Last Post: 14th March 2011, 21:55
  3. Shell command from Qt 4.5.2 by QProcess
    By Rajeshsan in forum Newbie
    Replies: 5
    Last Post: 21st December 2009, 17:03
  4. QProcess & linux shell characters
    By Ti_Thom in forum Qt Programming
    Replies: 4
    Last Post: 21st December 2009, 11:01
  5. running shell command from C++ code problem
    By alex chpenst in forum Qt Programming
    Replies: 4
    Last Post: 31st July 2008, 11:41

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
  •  
Qt is a trademark of The Qt Company.