Menu

#273 Root not working

v1.0_(example)
closed-fixed
nobody
None
5
2024-01-03
2023-04-08
0ldfart
No

X File Explorer 1.45
Ubuntu 22.04.2 LTS

When I click on New Root Window, nothing happens

If I type 'sudo xfe' it works as root, but I cannot get the program to launch as root from its user instance.

I did not see any errors in ~/.xsession-errors

Was not able to see a log in /var/logs

I tried deleting the config from /root but it did not change the problem

Not sure what to do next. Help?

Discussion

  • Roland Baudin

    Roland Baudin - 2023-04-11

    Hi, thanks for the bug report. The problem is that the xfe 1.45 package distributed with Debian or Ubuntu is faulty because a file is missing. I've sent a mail to the Debian package and I still wait for the fix. In the meanwhile, you could just copy (as root) the attached file to the /usr/share/polkit-1/actions directory, with permissions 0644 and owner root.

     

    Last edit: Roland Baudin 2023-04-11
    • Jean-Nicolas

      Jean-Nicolas - 2023-04-23

      Hi Roland,

      I tried and still no change.
      Tested on xubuntu 23.04.

       
      • Roland Baudin

        Roland Baudin - 2023-04-23

        I tested the solution today and it works as expected in Ubuntu 23.04. Are you sure you copied the file to the right place? Did you use the Xfe package provided by Ubuntu?

        I filled a bug report for the Ubuntu package here https://bugs.launchpad.net/ubuntu/+source/xfe/+bug/2017427

         

        Last edit: Roland Baudin 2023-04-23
        • Jean-Nicolas

          Jean-Nicolas - 2023-05-01

          Hi,

          Sorry for the late reply, I thought I would get an answer notification!

          So yes, I think it is in the right place, see attachment.
          I use the deb package (version 1.45) from Ubuntu.

          Running from terminal, when I click the root button, here is the terminal output: "Refusing to render service to dead parents."

           

          Last edit: Jean-Nicolas 2023-05-01
  • Roland Baudin

    Roland Baudin - 2023-05-06

    OK. Is the package 'pkexec' installed? This package is required.

    If yes, could you try to run Xfe like this:
    /usr/bin/pkexec xfe

    Does it work?

     
    • Jean-Nicolas

      Jean-Nicolas - 2023-05-08

      The package is installed (0.105-33).
      Works fine from the terminal with the command you provided.

       
  • Roland Baudin

    Roland Baudin - 2023-05-08

    OK, thanks, that's a good point.

    Are you sure you are using the 'Authentication using pkexec' option in Edit / Preferences / Modes / Root Modes?

     
    • Jean-Nicolas

      Jean-Nicolas - 2023-05-08

      Yes I was.
      Strange enough I tested the other way, that is Authenticate with sudo (sudo -b xfe). And it works fine with that one!
      The issue appeared after I installed xubuntu 23.04. The xfe profile is reconducted from the previous installation (symlink so that I keep my customization when I upgrade).
      I don't see what could have been wrong since the profile remained untouched for several years I think (at least several xubuntu upgrades).

      I'm fine with the fix, thanks for the help!

       
  • Mamoru TASAKA

    Mamoru TASAKA - 2023-05-22

    Okay, now I've received the same bug report on Fedora:
    https://bugzilla.redhat.com/show_bug.cgi?id=2208727

    and actually, when

    • make it sure that pkexec is in the path
    • launch xfe from xterm (or lxterminal)
    • on xfe gui, make it sure that "Authentication using pkexec" is selected
    • on xfe gui try "tool -> new root window",

    actually I see: "Refusing to render service to dead parents.", while when launching xfe from "gnome-terminal", new root window with pkexec succeeds.

    Then the problem here is that

    If yes, could you try to run Xfe like this:
    /usr/bin/pkexec xfe
    Does it work?

    The actual command xfe gui is doing is $ sh -c "pkexec xfe &" as written on

        69  // Launch a command and initiate a startup notification
        70  int runcmd(FXString cmd, FXString cmdname, FXString dir, FXString startdir, FXbool usesn = true, FXString snexcepts = "")
        71  {
    
       177      // Run command without startup notification
       178      else
       179      {
       180          // Run command in background
       181          cmd += " &";
       182          ret = system(cmd.text());
       183          if (ret < 0)
       184          {
       185              fprintf(stderr, _("Error: Can't execute command %s"), cmd.text());
       186              return(-1);
       187          }
    

    (system(3) invokes command with bash -c "command") so here

    • xfe gui first tries to lauch shell via system(3)
    • the shell (sh) lauches pkexec xfe as "background" (by &) and then exit immediately

    With this, pkexec process is pick up by "init" process, however pkexec refuses this as:
    https://cgit.freedesktop.org/polkit/tree/src/programs/pkexec.c?h=v.121#n742

      /* Figure out the parent process */
      pid_of_caller = getppid ();
      if (pid_of_caller == 1)
        {
          /* getppid() can return 1 if the parent died (meaning that we are reaped
           * by /sbin/init); In that case we simpy bail.
           */
          g_printerr ("Refusing to render service to dead parents.\n");
          goto out;
        }
    

    this is the exact error message above. Strangely, when launching xfe from gnome-terminal and try "root window" from xfe gui, pkexec is picked up by "user" systemd process (not "init" systemd process), so pkexec succeeds.

    So in summary, when using pkexec, non-init parent process is needed.

     
  • Roland Baudin

    Roland Baudin - 2023-05-22

    Ok, thanks for the detailed report. I'll investigate and let you know if I find a fix.

     
  • Roland Baudin

    Roland Baudin - 2024-01-03

    I tested the root mode in Ubuntu 23.10 and Fedora 39 and it works as expected (using pkexec authentication).
    So I close the bug for now.

     
  • Roland Baudin

    Roland Baudin - 2024-01-03
    • status: open --> closed-fixed
     

Log in to post a comment.