Bug 18569 - in Konsole, directory paths are sometimes not recognised - and sideeffects of that
Summary: in Konsole, directory paths are sometimes not recognised - and sideeffects of...
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Thierry Vignaud
QA Contact:
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2016-05-28 15:17 CEST by Morgan Leijström
Modified: 2016-10-07 15:05 CEST (History)
5 users (show)

See Also:
Source RPM: rpmdrake
CVE:
Status comment:


Attachments
prevent copying Left-to-right_mark (mga#18569) (729 bytes, patch)
2016-10-07 10:50 CEST, Thierry Vignaud
Details | Diff

Description Morgan Leijström 2016-05-28 15:17:15 CEST
I have had it for some years ago too (maybe it was in mandriva even),
(discussed only in forum then) but problem vanished. 
Today i experience it again, like: I asked rpm about /usr/bin/mana, 
and it reports it did not find /home/morgan//usr/bin/mana  :

$ su
# rpm -qif /usr/bin/mana
fel: fil /home/morgan//usr/bin/mana: Filen eller katalogen finns inte

It is pretty dangerous that especailly for root user it mangles the commands
 - could lead to deleting wrong files etc!!
I therefor set severity to major


WORKAORUND1
if i issue "su -" (note the dash) it works as it should.

NOTES
It also works if i execute that command as normal user

It also works in lxterminal for any user including gaining root with su (whthout the dash)

REPEATABLE: in same login absolutely
between logins: seldom... i think.  weird...

WORKAROUND2(?): use other terminal than Konsole. (I have not seen it in other terminal, but it *may* just be luck, and the problem is deeper, in something else...)
Comment 1 Frank Griffin 2016-05-28 15:43:00 CEST
This is expected, I think.  Doing "su" simply changes your UID, it doesn't run the root .profile or change the environment.  You need "su -l" for that.

CC: (none) => ftg

Comment 2 Morgan Leijström 2016-05-28 22:17:03 CEST
Read my post again:  It changed the path i entered after the command.

And other terminals dont do that.
Comment 3 Frank Griffin 2016-05-29 16:58:55 CEST
It's pretty clear that the path you gave is not being recognized as absolute and is being appended to the CWD.  The question is whether this is specific to rpm or whether it's happening in general.  Can yu try with something like "ls" ?
Comment 4 Frank Griffin 2016-05-29 17:00:59 CEST
BTW, I can't reproduce it here.
Comment 5 Morgan Leijström 2016-05-30 17:53:18 CEST
Me neither can reproduce right now.

As i wrote, it only happens seldom.
I have not figured out when.

When i experience it again, i will try other commands too, like ls.

Is there some other test, log, whatever... that would be helpul if i grab whenever the problem show again?
Comment 6 Morgan Leijström 2016-05-31 00:56:32 CEST
Now i managed to get it on another computer; with rpm it failed as comment 0, but replacing rpm with ls, it listed the correct content.

Summary: Executing commands in Konsole after "su" (but not "su -") sometimes get wrong path => rpm sometimes get wrong path when executed in Konsole

Morgan Leijström 2016-05-31 00:58:12 CEST

Source RPM: konsole-16.04.1-1.mga6.src.rpm => rpm-4.13.0-0.rc1.33.mga6.src.rpm

Comment 7 Marja Van Waes 2016-05-31 19:34:28 CEST
(In reply to Morgan Leijström from comment #6)
> Now i managed to get it on another computer; with rpm it failed as comment
> 0, but replacing rpm with ls, it listed the correct content.

Does this only happen in the Plasma / KDE Konsole,  or also in terminals from other DEs and/or in a VT (e.g. tty2) ?

Keywords: (none) => NEEDINFO
CC: (none) => marja11

Comment 8 Marja Van Waes 2016-05-31 19:35:47 CEST
Ah, and did you copy your home between the systems that have the issue, or were they created seperately without copying anything over?
Comment 9 Frank Griffin 2016-05-31 19:44:06 CEST
Another interesting possibility: do you have "rpm" aliased to something ?  Try "set | grep rpm" and "which rpm" to see.

The real executable is /bin/rpm.
Comment 10 Thierry Vignaud 2016-05-31 22:26:43 CEST
Or you succeeded in adding a non-printable character?
Did you try building the path with shell completion?
(eg: "rpm -q /bi<tab>/man<tab>")

CC: (none) => thierry.vignaud

Comment 11 Morgan Leijström 2016-06-01 10:36:48 CEST
@comment7:  Have only seen it in Konsole, but i almost only use Konsole (and not very much i am mostly a normal GUI user...)

@comment8: The systems are brought up completely independent

@comment9: in Konsole, after changign to root using "su" without dash, 
"which rpm" outputs "/usr/bin/rpm"
"set | grep rpm" give me more than a screenfull with lots of urpmi related but i see no rpm alias

@comment10: Well i know i at least on one of the problamtic times did cut-paste "rpm -qif" from the bug report template but i think i entered it manually directly in terminal other times.
Comment 12 Morgan Leijström 2016-06-01 11:30:56 CEST
This seem very similar to problems i had five years ago, on another machine.
Also another user reported he had such problems then.
That was as normal user in Konsole under KDE year 2011.

See https://forums.mageia.org/en/viewtopic.php?f=7&t=1363

excerpt:

services]$ cd kded
kded]$ pwd
/usr/share/kde4/services/kded
kded]$ cd /usr/share/kde4/services/kded
bash: cd: /usr/share/kde4/services/kded: Filen eller katalogen finns inte
 =The place I am in does not exist?!
Comment 13 Morgan Leijström 2016-06-01 11:43:22 CEST
( detail correction: Years pass qickly. This is the same machine, minus changed SSD, RAM, and graphics.  So it must be something in the i7 CPU... ;)  )
Comment 14 Marja Van Waes 2016-06-01 20:36:16 CEST
(In reply to Morgan Leijström from comment #12)
> This seem very similar to problems i had five years ago, on another machine.
> Also another user reported he had such problems then.
> That was as normal user in Konsole under KDE year 2011.
> 
> See https://forums.mageia.org/en/viewtopic.php?f=7&t=1363
> 

Reading that typing the path did not work, but c&p'ing it did, I'm reminded of a weird error I had around March 2012 with a gmail account that I stopped using soon after.

It was impossible to login (using Mageia + Firefox) to the account if I typed my username. However, every time I copied&pasted the username, logging in worked fine. Typing the password did not give problems.
Comment 15 Marja Van Waes 2016-06-01 20:37:45 CEST
s/gmail/new gmail/
Comment 16 Marja Van Waes 2016-06-09 11:15:50 CEST
@ Morgan

Which character set is used by Konsole?

(Check: "View" -> "Set Encoding" to see it.)
Comment 17 Marja Van Waes 2016-06-09 11:35:57 CEST
s/set/encoding/

And what is the output of 

  locale

?
Comment 18 Morgan Leijström 2016-06-09 16:05:38 CEST
unicode utf-8

$ locale
LANG=sv_SE.UTF-8
LC_CTYPE=sv_SE.UTF-8
LC_NUMERIC=sv_SE.UTF-8
LC_TIME=sv_SE.UTF-8
LC_COLLATE=sv_SE.UTF-8
LC_MONETARY=sv_SE.UTF-8
LC_MESSAGES=sv_SE.UTF-8
LC_PAPER=sv_SE.UTF-8
LC_NAME=sv_SE.UTF-8
LC_ADDRESS=sv_SE.UTF-8
LC_TELEPHONE=sv_SE.UTF-8
LC_MEASUREMENT=sv_SE.UTF-8
LC_IDENTIFICATION=sv_SE.UTF-8
LC_ALL=

( nothing after "LC_ALL=" )
Comment 19 Marja Van Waes 2016-07-03 06:34:58 CEST
I don't think anyone has an idea what can cause this.

It would help if you could either reproduce it in in a VT (switch to e.g. tty2 with ctrl+alt-F2 and login there) or become sure you cannot reproduce it there.

CC'ing neoclust and yurchor, who might have heard of it if this is a konsole bug.

CC: (none) => mageia, yurchor

Comment 20 Morgan Leijström 2016-07-17 01:02:06 CEST
Uh, now i have same weirdness again as referenced in Comment #12 ;

Copied from my still open Konsole window:

[root@svarten /]# cd /usr/lib64/
-bash: cd: /usr/lib64/: Filen eller katalogen finns inte
[root@svarten /]# LC_ALL=C cd /usr/lib64
-bash: cd: /usr/lib64: No such file or directory
[root@svarten /]# LC_ALL=C cd /usr/lib64/
-bash: cd: /usr/lib64/: No such file or directory
[root@svarten /]# LC_ALL=C cd /usr
-bash: cd: /usr: No such file or directory
[root@svarten /]# cd /
[root@svarten /]# cd usr
[root@svarten usr]# cd lib64
[root@svarten lib64]# pwd
/usr/lib64

In short:
I am in / (verified, i have been doing work there (deleted a couple dead.letter)
try to cd to /usr/lib64/ but get response /usr/lib64/ does not exist
but i can cd to /, then down into /usr/ and then into /usr/lib64/
And of course it exist in reality too as the system works...
Also, i know (can still see in Konsole) that i opened konsole as normal user
(by in Plasma hitting Alt-F2 and typing konsole)
and then "su -" to become root.

So this have nothing to do with rpm, and happens also after entering root by "su -".  Updating bug header accordingly.

This is on a current Cauldron 64 bit;
kernel 4.7.0-desktop-0.rc7.4.mga6
Plasma 5.7.1-1 , framework 5.24.0-1

This is *very* rare, but annoying as it happens maybe one of thousand times i use Konsole, and is the same as in the thread soon five years ago at
https://forums.mageia.org/en/viewtopic.php?f=7&t=1363

Keywords: NEEDINFO => (none)
Summary: rpm sometimes get wrong path when executed in Konsole => in Konsole, directory paths are sometimes not recognised - and siedeeffects of that
Source RPM: rpm-4.13.0-0.rc1.33.mga6.src.rpm => (none)

Comment 21 Morgan Leijström 2016-10-06 23:24:44 CEST
Here we go again....
current cauldron 64 bit, Plasma, Konsole
copied-pasted from the still open Konsole, to right here: 

-----------8<-------
bash-4.3$ su
Lösenord: 
[root@svarten morgan]# cd /usr/lib/nvidia-current/
bash: cd: /usr/lib/nvidia-current/: Filen eller katalogen finns inte
--------->8--------

So i try a gain, entering path some characters at a time, pressing TAB now and then where i insert "*TAB*" below, and it autocompletes and recognises OK:

-----------8<-------

[root@svarten morgan]# cd /usr/l   *TAB*
lib/     lib64/   libexec/ local/   
[root@svarten morgan]# cd /usr/lib/   *TAB*
alsa-lib/          gems/              kbd/               nspluginwrapper/   rpmorphan/
audit/             gio/               kernel/            nvidia-current/    sane/
binfmt.d/          grub/              kicad/             openssl/           sasl2/
blueberry/         gstreamer-0.10/    krb5/              perl5/             sk1-tk-0.9.3/
crda/              gtk-2.0/           libcanberra-0.30/  pkgconfig/         sse2/
cups/              isodumper/         libDrakX/          polkit-1/          sysctl.d/
dietlibc/          java/              libproxy/          ppr/               syslinux/
dracut/            java-1.5.0/        lsb/               pulseaudio/        systemd/
dri/               java-1.6.0/        mesa/              python2.7/         sysusers.d/
firmware/          java-1.7.0/        module-init-tools/ python3.4/         timidity/
games/             java-1.8.0/        modules/           python3.5/         tmpfiles.d/
gCAD3D/            java-ext/          modules-load.d/    qt3/               udev/
gcc/               jvm/               mono/              qt4/               udisks/
gcc-lib/           jvm-commmon/       mozilla/           readahead/         vdpau/
gconv/             jvm-exports/       NetworkManager/    resolvconf/        wine/
gdk-pixbuf-2.0/    jvm-private/       nfs-utils/         rpm/               X11/
[root@svarten morgan]# cd /usr/lib/nvi *TAB*
[root@svarten morgan]# cd /usr/lib/nvidia-current/
[root@svarten nvidia-current]# 
--------->8--------
Comment 22 Morgan Leijström 2016-10-06 23:44:36 CEST
Aha, different encodings  (at least this problem today)

REPEATABLE:  (at least on my machine, may differ in localisation, se earlier comments)

1) Fire up drakrpm
2) select package nvidia-current-cuda-opencl
3) Open the file list and by mouse select and copy "â/usr/lib/nvidia-current"
4) In Konsole, su to root, type "cd " and paste, ENTER
Result: it cannot find that path!
5) select "â/usr/lib/nvidia-current" from the error reply
6) again type "cd ", paste, ENTER
Now it finds it.

You can go back in history (up arrow twice) and it repeats the error, so it stores the visibly like, but errant encoding.

Now... shouldnt the pasting in Konsole correct encodings to what Konsole understands?


A strange thing: i can not this way repeat the problem originally reported: 
# rpm -qif /usr/bin/mana
works perfectly even when the part "/usr/bin/mana" is copied from drakrpm file list cd
Marja Van Waes 2016-10-07 04:28:13 CEST

Assignee: bugsquad => kde
Summary: in Konsole, directory paths are sometimes not recognised - and siedeeffects of that => in Konsole, directory paths are sometimes not recognised - and sideeffects of that

Comment 23 Thierry Vignaud 2016-10-07 10:45:18 CEST
That's because you copied the Unicode Character 'LEFT-TO-RIGHT MARK' (U+200E) from the file list
See:
http://gitweb.mageia.org/software/rpmdrake/tree/Rpmdrake/gui.pm?id=6.21#n273
https://en.wikipedia.org/wiki/Left-to-right_mark

We could put this character prior to the spacing in order to prevent that copy and paste issue.

Status: NEW => ASSIGNED
Assignee: kde => thierry.vignaud
Source RPM: (none) => rpmdrake
Severity: major => normal

Comment 24 Thierry Vignaud 2016-10-07 10:50:20 CEST
Created attachment 8506 [details]
prevent copying Left-to-right_mark (mga#18569)
Comment 25 Thierry Vignaud 2016-10-07 10:52:04 CEST
You can try the above patch by running the following commands as root in a terminal:
cd /usr/lib/perl5/vendor_perl/5.22.2/
patch -p1 </where/it/was/downloaded/0001-prevent-copying-Left-to-right_mark-mga-18569.patch 


Then restart rpmdrake and try copy/paste in konsole again

Keywords: (none) => NEEDINFO, PATCH

Comment 26 Morgan Leijström 2016-10-07 13:05:56 CEST
Thank you for the instruction.
That patch solved that issue here :)
Morgan Leijström 2016-10-07 13:06:24 CEST

Keywords: NEEDINFO => (none)

Comment 27 Mageia Robot 2016-10-07 13:11:11 CEST
commit 28029276c7ef69b3c2efe0e734c9c04a213f91b9
Author: Thierry Vignaud <thierry.vignaud@...>
Date:   Fri Oct 7 10:46:26 2016 +0200

    prevent copying Left-to-right_mark (mga#18569)
---
 Commit Link:
   http://gitweb.mageia.org/software/rpmdrake/commit/?id=28029276c7ef69b3c2efe0e734c9c04a213f91b9
Comment 28 Thierry Vignaud 2016-10-07 13:11:42 CEST
Closing

Status: ASSIGNED => RESOLVED
Resolution: (none) => FIXED

Comment 29 Morgan Leijström 2016-10-07 15:05:10 CEST
Finally solved, thanks :)

It disturbed me a lot not knowing what it was or when it could hit.

The detail about a different result in comment 0 , which i could not repeat some hours ago, i guess is that rpm have improved handling of that character since then.

Note You need to log in before you can comment on or make changes to this bug.