On 2013-05-13 06:44, dd wrote:
> On 05/12/2013 11:36 PM, 050813 wrote:
>> I usually try to do everything from a “Standard Account”.
>
> it seems to me that the script, which should be in your home, like in
>
> /home/05813/bin/my-geditnocrashbug.sh
>
>
> is owned by root! it should NOT be.
> it should not need to be executed as root…
No, the bug is real, as reported in the proper Bugzilla, and it is not
solved yet, but is assigned to the coreutils maintainer (you do not see
this in the orange archive, which is a copy of the emails that bugzilla
sends to this mail list:
http://lists.opensuse.org/opensuse-bugs/2013-04/msg01435.html
If you compare that orange archive with the real archive you see missing
things. For example, the last but one post says that Dominique changed
somethings, but not what. Yes, you can click and unhide - or simply open
the real, original bug report in Bugzilla and see all the details (and
if you log in, you see even more):
https://bugzilla.novell.com/show_bug.cgi?id=814626
There is a hack, in the last comment, which is to run, in a terminal, this:
su
unset XDG_RUNTIME_DIR
gedit
However, if you put that in a script, like this:
cer@eleanor3:~> cat bin/sugedit
#!/bin/bash
su
unset XDG_RUNTIME_DIR
leafpad
cer@eleanor3:~>
What happens is this:
cer@eleanor3:~> sugedit
Password:
eleanor3:/home/cer # set | grep XDG_RUNTIME_DIR
XDG_RUNTIME_DIR=/run/user/1000
eleanor3:/home/cer #
The editor does not run, and the variable was not unset - because there
was a change of user and the script stopped running. When I type ‘exit’
on the terminal, ‘su’ exits and the editor runs - too late, as plain user.
You can instead use this script:
cer@eleanor3:~> cat bin/sugedit
#!/bin/bash
su -c "unset XDG_RUNTIME_DIR ; leafpad"
which at least, runs. I don’t have gedit installed, so I do not know if
the hack works - that’s a different problem.
It probably does not work, though. Changing the script and running it
again shows:
cer@eleanor3:~> cat bin/sugedit
#!/bin/bash
#su
#unset XDG_RUNTIME_DIR
#leafpad
#su -c "unset XDG_RUNTIME_DIR ; leafpad"
su -c "unset XDG_RUNTIME_DIR ; echo $XDG_RUNTIME_DIR"
cer@eleanor3:~> sugedit
Password:
/run/user/1000
cer@eleanor3:~>
cer@eleanor3:~> su -c "unset XDG_RUNTIME_DIR ; echo $XDG_RUNTIME_DIR"
Password:
/run/user/1000
cer@eleanor3:~>
cer@eleanor3:~> su -c "XDG_RUNTIME_DIR= echo $XDG_RUNTIME_DIR"
Password:
/run/user/1000
cer@eleanor3:~>
which proves that the variable is not unset.
This other variant, inspired by jdmcdaniel3, does work:
cer@eleanor3:~> cat bin/sugedit
#!/bin/bash
unset XDG_RUNTIME_DIR ; su -c "echo $XDG_RUNTIME_DIR"
cer@eleanor3:~> sugedit
Password:
cer@eleanor3:~> echo $XDG_RUNTIME_DIR
/run/user/1000
cer@eleanor3:~>
The variable is unset while running as root, and restored when back to
the normal user.
–
Cheers / Saludos,
Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)