<?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>510456</bug_id>
          
          <creation_ts>2025-10-10 13:46:38 +0000</creation_ts>
          <short_desc>Writing to ftp servers fails</short_desc>
          <delta_ts>2025-10-17 09:08:35 +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>FTP</component>
          <version>6.19.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>regression</keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Friedrich W. H. Kossebau">kossebau</reporter>
          <assigned_to name="KIO Bugs">kio-bugs-null</assigned_to>
          <cc>aronkvh</cc>
    
    <cc>heiko.becker</cc>
    
    <cc>kdelibs-bugs-null</cc>
    
    <cc>nate</cc>
    
    <cc>nicolas.fella</cc>
          
          <cf_commitlink>https://invent.kde.org/frameworks/kio/-/commit/cb2c6096763e20dae1941ea8e34a8b7e69b20fdd</cf_commitlink>
          <cf_versionfixedin>6.19.0</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2460910</commentid>
    <comment_count>0</comment_count>
    <who name="Friedrich W. H. Kossebau">kossebau</who>
    <bug_when>2025-10-10 13:46:38 +0000</bug_when>
    <thetext>Trying to copy files to ftp servers fails with &quot;Access denied&quot;.

On first look this seems due to some things failing when KIO&apos;s CopyJob stats the destination dir:

the implementation in FtpInternal::stat() has a code path which just assumes details about the dir instead of querying for it, and the details do not assume S_IWUSR (see also code comment &quot;Don&apos;t list the parent dir. Too slow, might not show it, etc. Just return that it&apos;s a dir.&quot;).
https://invent.kde.org/frameworks/kio/-/blob/v6.18.0/src/kioworkers/ftp/ftp.cpp?ref_type=tags#L1365

CopyJob though checks for S_IWUSR obviously, and errors out if not set for the dir.
https://invent.kde.org/frameworks/kio/-/blob/v6.19.0-rc1/src/core/copyjob.cpp?ref_type=tags#L552

This seems to have been uncovered by the change in https://invent.kde.org/frameworks/kio/-/commit/15fff1b8592648f11f20a303c8f82d61d3f19584#a255943687657ca8eb60300f623327855b34bd67_571_553
The old condition `!m_privilegeExecutionEnabled &amp;&amp; !isWritable` might have wrongly prevented entering the error branch, as `m_privilegeExecutionEnabled` usually might have been true, and the `&amp;&amp;` should have rather been a `||`.

Possibly needs fixing by improving the ftp worker code to actually query the real details, instead of hardcoding some?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2460924</commentid>
    <comment_count>1</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2025-10-10 14:22:01 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/2017</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2461287</commentid>
    <comment_count>2</comment_count>
    <who name="Nicolas Fella">nicolas.fella</who>
    <bug_when>2025-10-11 19:58:48 +0000</bug_when>
    <thetext>Git commit eaaf877aed31c0d7483fd2a1bccbe06df0e6c0a6 by Nicolas Fella.
Committed on 11/10/2025 at 19:58.
Pushed by nicolasfella into branch &apos;master&apos;.

[ftp] Claim that dir is writable during stat

This isn&apos;t really correct, but neither is saying it&apos;s not writable

Without this CopyJob will refuse to work, at least since 15fff1b8592648f11f20a303c8f82d61d3f19584

M  +1    -1    src/kioworkers/ftp/ftp.cpp

https://invent.kde.org/frameworks/kio/-/commit/eaaf877aed31c0d7483fd2a1bccbe06df0e6c0a6</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2461288</commentid>
    <comment_count>3</comment_count>
    <who name="Nicolas Fella">nicolas.fella</who>
    <bug_when>2025-10-11 19:59:53 +0000</bug_when>
    <thetext>Git commit cb2c6096763e20dae1941ea8e34a8b7e69b20fdd by Nicolas Fella.
Committed on 11/10/2025 at 19:59.
Pushed by nicolasfella into branch &apos;Frameworks/6.19&apos;.

[ftp] Claim that dir is writable during stat

This isn&apos;t really correct, but neither is saying it&apos;s not writable

Without this CopyJob will refuse to work, at least since 15fff1b8592648f11f20a303c8f82d61d3f19584
(cherry picked from commit eaaf877aed31c0d7483fd2a1bccbe06df0e6c0a6)

M  +1    -1    src/kioworkers/ftp/ftp.cpp

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

    </bug>

</bugzilla>