Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] QProcess sudo ls doesn't work.

[SOLVED] QProcess sudo ls doesn't work.

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 2.7k 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.
  • K Offline
    K Offline
    ki John
    wrote on last edited by
    #1

    I added this line to sudoers but it doesn't work.

    @metheuser ALL=(ALL) NOPASSWD: /usr/bin/ls@

    then I call this on button press event:
    @process = new QProcess(this);
    process->start( "/usr/bin/sudo /usr/bin/ls");
    process->waitForFinished( -1);@

    it will always fail.

    The only working sudo command is sudo -V

    However, on the konsole "sudo ls" or "/usr/bin/sudo" works fine.

    Please Help.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      ki John
      wrote on last edited by
      #2

      SOLVED: If you're running the most awesomest Linux Distro like Mageia 3 than you need to remove the enforced tty requirement with visudo.
      Comment out a line that says "Defaults requiretty".

      Actually this distro is awesomer than most awesomest.

      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