<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>322837</bug_id>
          
          <creation_ts>2013-07-26 06:53:06 +0000</creation_ts>
          <short_desc>Can&apos;t open files beginning with colon (:)</short_desc>
          <delta_ts>2020-12-12 10:19:03 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>Frameworks and Libraries</classification>
          <product>frameworks-kio</product>
          <component>Open/save dialogs</component>
          <version>5.45.0</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>usability</keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>kdebugs</reporter>
          <assigned_to name="David Faure">faure</assigned_to>
          <cc>a.samirh78</cc>
    
    <cc>adaptee</cc>
    
    <cc>aria</cc>
    
    <cc>bugseforuns</cc>
    
    <cc>jonan88</cc>
    
    <cc>kdelibs-bugs-null</cc>
    
    <cc>nate</cc>
    
    <cc>usnay12345</cc>
          
          <cf_commitlink>https://invent.kde.org/frameworks/kio/commit/c5dbb7c5452f1af637540efdf09061765c0ffb2d</cf_commitlink>
          <cf_versionfixedin>5.78</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1386054</commentid>
    <comment_count>0</comment_count>
    <who name="">kdebugs</who>
    <bug_when>2013-07-26 06:53:06 +0000</bug_when>
    <thetext>Files whose names begin with a colon (:)(0x3A) or a tilde (~)(0x7E), or containing a quote (&quot;)(0x22) cannot be opened with the file-open dialog.

Reproducible: Always

Steps to Reproduce:
1. Open Konsole and enter these commands:
-------------
cd ~
mkdir newdir
echo &quot;Hello World.&quot; &gt; :
cp : :0
cp : \~
cp : \~0
cp : \&quot;
kate \&quot; &amp;
exit
-------------
2. Kate will have opened the file named &quot;.  Press Ctrl+W to close it, then Ctrl+O to get the &quot;Open File&quot; dialog.  You should see 5 files in ~/newdir named as follows:
&quot;
:
:0
~
~0
3. Try opening any of the five files.
Actual Results:  
When clicking on either the file named ~ or the file named :, the &quot;Open File&quot; dialog will switch to showing files in the user&apos;s home folder rather than opening the file.

When clicking on the file named ~0, the file name briefly flashes in the &quot;File:&quot; field, but the file does not open.

When clicking on the file named :0, the file name briefly flashes in the &quot;File:&quot; field, and the file does not open.  In addition, the following error message is displayed:
kfilemodule(20501): couldn&apos;t create slave: &quot;Unable to create io-slave:
klauncher said: Unknown protocol &apos;&apos;.
&quot; 

When clicking on the file named &quot;, the name will be placed in the &quot;Name:&quot; field, but the file cannot be opened.

Expected Results:  
When clicking on the name or icon of any of the five files, the respective file should be opened.

Opening a file whose name has a tilde or colon in the middle or end of the name does not seem to be a problem.  Files whose names have one or more quote characters anywhere in the name do not work.  All other characters in 7-bit ASCII (except slash (/) and null (\0) of course) appear to be supported.

Files starting with a colon are used in various places on a normal Linux system, and thus should be supported.  Examples include /var/lib/ucf/cache/* and /run/lightdm/root/* .
Files starting with a tilde are, perhaps, less common (tildes are frequently used at the end of file names), but there&apos;s no reason not to support them.
Files containing quotes may be inadvisable, but they&apos;re perfectly legitimate UNIX and ext4 file names.

Files beginning with a colon appear to present extra problems for various applications like kate or okteta, but these would appear to be separate bugs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1386093</commentid>
    <comment_count>1</comment_count>
    <who name="Jon Ander Peñalba">jonan88</who>
    <bug_when>2013-07-26 11:57:41 +0000</bug_when>
    <thetext>I can confirm this bug in 4.10.5.

I also tried it in git master but the behavior is different:
I created 3 files with the following names: &apos;-test&apos;, &apos;:test&apos; and &apos;files &quot;test&quot;&apos;.
 - Starting a file name with a tile seams to work properly on master
 - Starting a file name with a colon and trying to open it not only failed, but it created a dir named &quot;:&quot; and a file named &quot;:test.desktop&quot; in my home directory
 - Trying to open the file &apos;file &quot;test&quot;&apos; created a new file named only &apos;test&apos; and opened that new file.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1388959</commentid>
    <comment_count>2</comment_count>
    <who name="Christoph Feck">cfeck</who>
    <bug_when>2013-08-10 23:16:01 +0000</bug_when>
    <thetext>~ (tilde) is bug 317513
&quot; (quotes) is bug 185433

Regarding the : (colon), this could be related to Qt resources or Windows path handling.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1744568</commentid>
    <comment_count>3</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2018-04-10 22:02:09 +0000</bug_when>
    <thetext>Using this bug to track just the colon issue, since we have other bugs for the other characters.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1745300</commentid>
    <comment_count>4</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2018-04-13 16:50:52 +0000</bug_when>
    <thetext>*** Bug 267371 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1745319</commentid>
    <comment_count>5</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2018-04-13 17:42:51 +0000</bug_when>
    <thetext>*** Bug 312226 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1983122</commentid>
    <comment_count>6</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2020-12-10 13:04:32 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/250</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1983123</commentid>
    <comment_count>7</comment_count>
    <who name="Ahmad Samir">a.samirh78</who>
    <bug_when>2020-12-10 13:05:44 +0000</bug_when>
    <thetext>That MR only covers the kfilewidget case; for kate I&apos;ll open a separate report to track the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1983126</commentid>
    <comment_count>8</comment_count>
    <who name="Ahmad Samir">a.samirh78</who>
    <bug_when>2020-12-10 13:11:26 +0000</bug_when>
    <thetext>I&apos;ve opened bug 430216.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1983708</commentid>
    <comment_count>9</comment_count>
    <who name="Ahmad Samir">a.samirh78</who>
    <bug_when>2020-12-12 10:19:03 +0000</bug_when>
    <thetext>Git commit c5dbb7c5452f1af637540efdf09061765c0ffb2d by Ahmad Samir.
Committed on 12/12/2020 at 10:15.
Pushed by dfaure into branch &apos;master&apos;.

KFileWidget: allow files that begin with a &apos;:&apos; to be selected

The issue was that a &apos;:&apos; at the beginning denotes a Qt Resource and in that
case QDir::isAbsolutePath() would return true. The bug is fixed by guarding
against that condition in slotOk().

Also guard other QDir::isAbsolutePath() usage the same way.

Since this logic will be used in various places use a helper function,
isAbsoluteLocalPath() (thanks to dfaure for coming up with that name),
in pathhelpers_p.h.

Extend the unit tests.
FIXED-IN: 5.78

M  +15   -6    autotests/kfilewidgettest.cpp
M  +5    -6    src/filewidgets/kfilewidget.cpp
M  +10   -0    src/pathhelpers_p.h

https://invent.kde.org/frameworks/kio/commit/c5dbb7c5452f1af637540efdf09061765c0ffb2d</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>