[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Review Request: Disallow names of files containing '/' or being
From:       "Richard J. Moore" <rich () kde ! org>
Date:       2011-05-29 20:32:55
Message-ID: 20110529203255.32323.39788 () vidsolbach ! de
[Download RAW message or body]

> On May 28, 2011, 9:29 a.m., David Faure wrote:
> > The handling of '/' could use KIO::encodeFileName instead, for consistency. I \
> > agree about "." and ".." though ;)
> 
> Mark Gaiser wrote:
> I wonder.. don't we need a "isFilename" function that checks if a filename meets \
> all the characters that are allowed in a filename thus returning false when it \
> starts with a / or for example contains a *? or being equal to . or .. ? That would \
> make the use more "portable" since i can imagine other apps benefiting from that \
> (any app that needs to create a file or folder from user input)

Filenames containing * and ? are perfectly legal. The only truly illegal characters \
in a unix filename are / and \0. To be portable, you need to consider the underlying \
filesystem in which a file is being created since this sets the rules, for example \
FAT has a bunch of characters that can't be used (eg. consider how a filename \
starting with ? would interact with its file deletion handling). Short version, I \
don't see how the function you propose could be implemented.


- Richard J.


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/101456/#review3562
-----------------------------------------------------------


On May 28, 2011, 6:26 p.m., Matthias Fuchs wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/101456/
> -----------------------------------------------------------
> 
> (Updated May 28, 2011, 6:26 p.m.)
> 
> 
> Review request for kdelibs and David Faure.
> 
> 
> Summary
> -------
> 
> nt
> 
> 
> This addresses bug 211751.
> http://bugs.kde.org/show_bug.cgi?id=211751
> 
> 
> Diffs
> -----
> 
> kio/kio/kdirmodel.cpp 6bf57be 
> kio/kio/kfileitemdelegate.cpp cb3939d 
> 
> Diff: http://git.reviewboard.kde.org/r/101456/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Matthias
> 
> 


[Attachment #3 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/101456/">http://git.reviewboard.kde.org/r/101456/</a>
  </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On May 28th, 2011, 9:29 a.m., <b>David Faure</b> \
wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; \
padding-left: 10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The \
handling of &#39;/&#39; could use KIO::encodeFileName instead, for consistency. I \
agree about &quot;.&quot; and &quot;..&quot; though ;)</pre>  </blockquote>




 <p>On May 28th, 2011, 7:16 p.m., <b>Mark Gaiser</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I wonder.. don&#39;t we \
need a &quot;isFilename&quot; function that checks if a filename meets all the \
characters that are allowed in a filename thus returning false when it starts with a \
/ or for example contains a *? or being equal to . or .. ? That would make the use \
more &quot;portable&quot; since i can imagine other apps benefiting from that (any \
app that needs to create a file or folder from user input)</pre>  </blockquote>








</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Filenames containing * \
and ? are perfectly legal. The only truly illegal characters in a unix filename are / \
and \0. To be portable, you need to consider the underlying filesystem in which a \
file is being created since this sets the rules, for example FAT has a bunch of \
characters that can&#39;t be used (eg. consider how a filename starting with ? would \
interact with its file deletion handling). Short version, I don&#39;t see how the \
function you propose could be implemented. </pre>
<br />








<p>- Richard J.</p>


<br />
<p>On May 28th, 2011, 6:26 p.m., Matthias Fuchs wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for kdelibs and David Faure.</div>
<div>By Matthias Fuchs.</div>


<p style="color: grey;"><i>Updated May 28, 2011, 6:26 p.m.</i></p>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">nt</pre>  </td>
 </tr>
</table>




<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="http://bugs.kde.org/show_bug.cgi?id=211751">211751</a>


</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>kio/kio/kdirmodel.cpp <span style="color: grey">(6bf57be)</span></li>

 <li>kio/kio/kfileitemdelegate.cpp <span style="color: grey">(cb3939d)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/101456/diff/" style="margin-left: \
3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic