Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt Creator deploy and execute with different users
QtWS25 Last Chance

Qt Creator deploy and execute with different users

Scheduled Pinned Locked Moved Qt Creator and other tools
2 Posts 2 Posters 3.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jeffdag
    wrote on last edited by
    #1

    I am surprised this is not already in, or that no one (I found) is talking about this...

    Here's the scenario:
    I have a generic linux remote target setup in qt-creator. The linux it runs is Yocto based. It works great with debugging integration and all. Problem is, the projects I build need to deploy things in directories such as /usr/lib and /etc in the target. For this to work, I need to setup the user for the remote device as "root". Thus when qt-creator executes programs on the target, they get run as root also. It runs and works of course as root can usually do anything in the system. Two things don't work though: if your executable registers D-Bus services and root is not allowed to own the service, then it doesn't work. Secondly, when having to develop and test a proper system-wide users and permissions scheme, having the exec run as root hides such problems.

    So this is kind of a feature request I guess, Qt-Creator should really deal with this as it's quite easy for it to do so. Two ways to do this:

    • Either the device has a deploy user and a "run as" user
    • or the project has the possibility to specify an alternate user in the "Run" configuration

    Implementation wise I guess it would be as simple as prefixing the gdbserver remote command with a "sudo -u $altuser"... or just use the proper user when invoking the ssh commands (sftp and ssh).

    In the mean time, I thought of hacking the remote's "/usr/bin/gdbserver" with a script that prefixes the call to the real gdbserver with sudo -u ...although the target's root filesystem tends to be a volatile environment so on top of being an ugly hack, this is kind of unsustainable.

    (BTW, adding "sudo" in the project's "alternate executable on device:" with "-u /usr/bin/myprogram" in the run arguments doesn't work for debug since gdbserver will be debugging the "sudo" executable instead of the executable we want.)

    Thoughts? Clues?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on last edited by
      #2

      Sounds like a sensible idea... if you do not want this to get lost you should "file a feature request":https://bugtracker.qt-project.org/ via the bugtracker.

      Patches are of course welcome, too.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved