LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   My long used su command no longer works. (http://www.linuxquestions.org/questions/slackware-14/my-long-used-su-command-no-longer-works-4175462570/)

liberalchrist 05-19-2013 09:03 AM

My long used su command no longer works.
 
I always appreciate any help I'm given. A long while back, I used "sudo" to run gparted from my fluxbox menu. This seemed to do all I wanted and I was satisfied. Sometime later, I found there was some particular feature that was unusable and required using "su" directly. Later, I started using fbpanel in e16 instead of fluxbox and was able to use the following command in a menu item to start gparted as root: 'xterm -geometry 20x2 -e su -c gparted'. This command opened a small window where I entered my password, then gparted opened with full functionality. After recent upgrades, this no longer works. The password window opens and accepts the password, but gparted fails to open. Running the command in terminal gives no error message. Simply running 'su -c gparted' in an xterm works as normal.

Anybody have any ideas about what has changed? I know I could install gksu, but I really preferred this low tech method instead of adding more software.

Thanks in advance

smallpond 05-19-2013 09:25 AM

Some window managers like to replace xterm with a symlink to their own terminal emulator. I've never used fluxbox, so I don't know if it does.

What you gave seems to be valid on my KDE system.

GazL 05-19-2013 09:35 AM

Single quotes around the argument for -e wouldn't go amiss.

torimus 05-19-2013 09:52 AM

put command passed to xterm's -e in quotes (single or double)
don't know what are your environment settings but i'd try to pass -l option to su to load root's login environment

liberalchrist 05-19-2013 10:59 AM

Thanks to all of you, but neither suggestion fixed the problem. The original syntax worked for about one year in both fluxbox and fbpanel. I also tried with full path. I'm running 'current', so I feel sure it's some recent change.

mrclisdue 05-19-2013 11:20 AM

I got it to run by issuing:

Code:

$ xhost +
firstly, then your xterm command.

So it may ultimately be an XAUTHORITY issue. Some permanent remedies may be found here:

https://wiki.archlinux.org/index.php...X_apps_as_root

Use care when using xhost, you may want to invoke xhost - when your operation finishes.

cheers,

liberalchrist 05-19-2013 11:58 AM

Mrclisdue,

Thanks for your suggestion. Unfortunately, xhost + did not change the result, nor did changing /etc/profile (this caused X to fail with a 'No protocol' message). This has already taken too much time for such a minor problem and I know that simpler solutions are available.

Thanks for all your time folks, I'll just mark this one solved.

mrclisdue 05-19-2013 12:10 PM

Fair enough, but I'm still a bit curious why *it works for me*, and not for you...so, could it also involve dbus....?

Do you happen to have this in your ~/.fluxbox/startup:

Code:

# Start DBUS session bus:
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
  eval $(dbus-launch --sh-syntax --exit-with-session)
fi

?

because it could involve a combo of dbus and xauth?

For the record, the message that I got before issuing xhost + was:

Quote:

Unable to register terminal service: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
cheers,

liberalchrist 05-19-2013 12:37 PM

mrclisdue,

I am no longer using fluxbox as per my original post. I used the menu item in question successfully with my current setup only a few days ago. This seems to have changed with this weeks updates. This thread, http://www.linuxquestions.org/questi...helper-819838/ seems to be relevant. I just tried gksu and got the same result they did. This is really just an inconvenience, I only use gparted occasionally. Like any OCD computer geek, I just have a hard time relaxing when I can't figure things out.

P.S., No, I don't have the code you mentioned in either ~/.fluxbox/startup or any of my .xinitrc's.

Thanks

mrclisdue 05-19-2013 12:45 PM

Quote:

Originally Posted by liberalchrist (Post 4954356)
...Like any OCD computer geek, I just have a hard time relaxing when I can't figure things out....

cheers to that! who hasn't had these niggling things that often take months (years!) to rectify only to discover in some obscure post somewhere that it's often as simple as <insert foo foo bar bar hyphen tilde tic here> and it's solved?

cheers,

mrclisdue 05-19-2013 02:49 PM

Quote:

Originally Posted by liberalchrist (Post 4954356)
mrclisdue,

...P.S., No, I don't have the code you mentioned in either ~/.fluxbox/startup or any of my .xinitrc's.

Hey, I just picked up on this; the slackbuild, here:

https://github.com/vmj/slackbuilds/b...16/xinitrc.e16

includes:
Code:

# Start the window manager:
if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then
  exec ck-launch-session dbus-launch --exit-with-session /usr/bin/e16
else
  exec /usr/bin/e16
fi

So, perhaps....

cheers,

mancha 05-20-2013 01:32 AM

What you notice is indeed because Pat recently upgraded the shadow
package to version 4.1.5.1.

Shadow 4.1.5 corrected a long-standing tty-hijacking security flaw
in su -c (CVE-2005-4890). In short, previous behavior gave the
su -c command a controlling tty which provided it with ioctl
access to /dev/tty.

To prevent this, shadow no longer forwards the controlling terminal
to commands executed with -c.

--mancha


All times are GMT -5. The time now is 01:52 PM.