Announcement

Collapse
No announcement yet.

Error processing Exec field

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [KDE] Error processing Exec field

    Okay. So I've installed UFS-Explorer to recover some data, well attempt to.
    I followed the linux install setup guide, and the program, app, software, installed and ran Okay. Today, I attempted to run it again, and from menu found the UFS-Explorer but I get the following error
    "Error processing Exec field in /usr/share/applications/sdl-ufs-explorer-standard-recovery.desktop"
    The icon, setup looks weird (Well as I don't know anything about normal, it all looks werid.
    "bash -c "xhost +local: && sudo \/usr/lib/ufs-explorer/ufs-explorer-std" " as compared to something else usually has "<command> %u"

    I did manage to open the location in command and execute it from there.

    Any ideas on how to correct this .desktop file error, please.

    ALSO.
    Why is it like that above bash etc ??
    Thanks

    #2
    Running sudo from a .desktop exec is problematic.

    Normally, sudo is used from the command line and prompts for your password; run from a desktop file it doesn't have a way to ask for the password. There's various ways to do this, and I suppose some kind of policy-kit set up is the proper way, but I've never seen instructions on how to do that. I've got /usr/lib/x86_64-linux-gnu/libexec/kf5/kdesu, from the package kde-cli-tools, which might do the job for you. But generally, running a GUI app as root is deprecated; there used to be utilities like kdesudo and gksu but they've been removed, and I imagine kdesu is on the way out because of the weird location.

    (I've managed to get the SUDO_ASKPASS mechanism to work in the past, but it seemed a kludge.)

    I wonder what your requirement is; I'd have thought that file recovery software was not something you'd need a GUI menu entry or panel icon to run.

    The kdesu help page (I don't know how I was supposed to get to this, the way I did was convoluted) has this:
    The program you execute will run under the root user id and will generally have no authority to access your X display. KDE su gets around this by adding an authentication cookie for your display to a temporary .Xauthority file.
    So the xhost +local: is there to get around this problem.

    "bash -c " just runs the command in bash, instead of the default shell, which in Kubuntu is /bin/sh (a link to dash) which is very bare bones. Maybe the intention is to avoid pitfalls with varying shells; the chaining with "&&" works fine in /bin/sh.
    Regards, John Little

    Comment


      #3
      Originally posted by jlittle View Post
      Running sudo from a .desktop exec is problematic.

      Normally, sudo is used from the command line and prompts for your password; run from a desktop file it doesn't have a way to ask for the password. There's various ways to do this, and I suppose some kind of policy-kit set up is the proper way, but I've never seen instructions on how to do that. I've got /usr/lib/x86_64-linux-gnu/libexec/kf5/kdesu, from the package kde-cli-tools, which might do the job for you. But generally, running a GUI app as root is deprecated; there used to be utilities like kdesudo and gksu but they've been removed, and I imagine kdesu is on the way out because of the weird location.

      (I've managed to get the SUDO_ASKPASS mechanism to work in the past, but it seemed a kludge.)

      I wonder what your requirement is; I'd have thought that file recovery software was not something you'd need a GUI menu entry or panel icon to run.

      The kdesu help page (I don't know how I was supposed to get to this, the way I did was convoluted) has this:

      So the xhost +local: is there to get around this problem.

      "bash -c " just runs the command in bash, instead of the default shell, which in Kubuntu is /bin/sh (a link to dash) which is very bare bones. Maybe the intention is to avoid pitfalls with varying shells; the chaining with "&&" works fine in /bin/sh.
      Ummm. Okaaayy. Didn't really understand that much, but thanks for responding.
      Firstly, and answered, was the "bash" command. I thought that was some command line way of doing things. I guess I am correct.

      My main question was the actually error.
      "Error processing Exec field" from the menu item.
      Is there a way to rewrite it so that it works? I included the whole bit which is UFS Explorer. I am just assuming that UFS Explorer programmers didn't code it correctly. And this is sort of trying to figure out errors, and correcting them. A Learning point for me.
      Thanks Jlittle

      Comment


        #4
        Maybe using pkexec instead of sudo would work.
        And I'm not too sure about "\/usr/lib/" being a good idea.

        Comment


          #5
          Originally posted by CharlieDaves View Post
          Ummm. Okaaayy. Didn't really understand that much, but thanks for responding.
          Ok, I was basically saying that using "sudo" in a .desktop file might be the error. I can't see how it would work.

          I suggest:
          • If you want the user to get a dialogue box where that user's password is entered, install kde-cli-tools (you might already have it) and change the exec to
            Code:
            /usr/lib/x86_64-linux-gnu/libexec/kf5/kdesu /usr/lib/ufs-explorer/ufs-explorer-std
          • If you don't want the password prompt, create the file /etc/sudoers.d/ufs-explorer (I'd use sudo visudo) with this line:
            Code:
            [I]charlie[/I]     ALL=(ALL) NOPASSWD:/usr/lib/ufs-explorer*
            (change "charlie" to the user that will run it) then the sudo won't cause the failure.
          Regards, John Little

          Comment

          Working...
          X