1. 29 Mar, 2020 1 commit
  2. 28 Mar, 2020 1 commit
  3. 25 Mar, 2020 3 commits
    • Harald Sitter's avatar
      sftp: fix partial transfer resuming when copying to local · 8a04e100
      Harald Sitter authored
      Summary:
      the previous condition checked if the final target path size was >0,
      which it would only be when the file already exists (i.e. overwrite) in
      all other scenarios it would always be false and as such resuming wouldn't
      work. what we actually want to check is whether the part file is >0 (i.e.
      there's actual pending bytes to resume from).
      
      this makes resuming work when copying remote->local
      
      CCBUG: 417645
      
      Test Plan:
      - create file of suitably large size (1g)
      - `split -b somesize` the file into two segments
      - copy first segment to /tmp/file.part
      - connect to /tmp over sftp and copy the file there
      - progress starts at 50% and resulting file is same as input file
      
      Reviewers: ngraham, feverfew, bruns
      
      Subscribers: bruns, kde-frameworks-devel, kfm-devel
      
      Tags: #dolphin, #frameworks
      
      Differential Revision: https://phabricator.kde.org/D27872
      8a04e100
    • Harald Sitter's avatar
      sftp: do not show creation time when we do not know it · b13449a1
      Harald Sitter authored
      Summary:
      creation time (aka birth time) is file system dependent, if the fs doesn't
      support it we seem to get createtime==0. skip over it when that is the
      case.
      
      BUG: 375305
      FIXED-IN: 20.04
      
      Test Plan: browsing a directory on btrfs over sftp doesn't show creation time as 1970
      
      Reviewers: ngraham, bruns, meven
      
      Reviewed By: ngraham, bruns, meven
      
      Subscribers: meven, bruns, kde-frameworks-devel, kfm-devel
      
      Tags: #dolphin, #frameworks
      
      Differential Revision: https://phabricator.kde.org/D27873
      b13449a1
    • Harald Sitter's avatar
      smb: add some more topical debug output on opendir failure · 6ab34e5c
      Harald Sitter authored
      the output seen in https://bugs.kde.org/show_bug.cgi?id=419038 isn't
      nearly useful enough.
      
      - log the actual errnum (i.e. errno) after opendir
      - if the dirfd is negative log the approximate steps to recover
      
      specifically we end up with errnum==0 in reportError which makes no sense
      whatsoever and from the output it's not currently obvious which call
      chain lead to that scenario. possibly should be changed to assert even,
      not doing that for now though because I want this in 20.04
      6ab34e5c
  4. 24 Mar, 2020 1 commit
  5. 23 Mar, 2020 1 commit
  6. 19 Mar, 2020 2 commits
    • Harald Sitter's avatar
      sftp: fix seekPos + file resuming when part file is of size 11 · d8cf85ec
      Harald Sitter authored
      Summary:
      previously seekPos would loop over offset==EAGAIN. the returned off_t of
      seek is not an error, but the offset or -1. this incorrect handling
      of the return value resulted in attempting to seek a file of the size 11
      to get stuck in an infinite loop as EAGAIN==11 and so the loop would
      always be true. any other file size would have been fine, so the impact
      of this is actually super small.
      
      also sync up the expectation and handling a bit more between copy and put
      scenarios.
      specifically we always seek to the size we (think) the part file has,
      instead of letting the libc determine the end. this is in part so
      we can simply do an offset==size comparison to check if the seek worked
      to the end we expected it to.
      
      the seekPos() helper was removed as it now serves no purpose over calling
      lseek directly.
      
      BUG: 417645
      FIXED-IN: 20.04
      
      Test Plan:
      - create file
      - `split -b 11` file to get a segment exactly EAGAIN size
      - copy first segment to some other dir as file.part
      - open sftp to other dir and copy file there
      - copy doesn't get stuck, the file.part is removed, and the resulting file is same as input
      - vice versa copy from sftp to local
      
      Reviewers: ngraham, feverfew
      
      Reviewed By: ngraham
      
      Subscribers: bruns, kde-frameworks-devel, kfm-devel
      
      Tags: #dolphin, #frameworks
      
      Differential Revision: https://phabricator.kde.org/D27871
      d8cf85ec
    • Harald Sitter's avatar
      smb: guard against duplicated service discoveries · ba96d3b9
      Harald Sitter authored
      Summary:
      if both dnssd and wsdiscovery have the same server on offer we'd create
      duplicated entries. instead keep track of the discovered names and only
      use the first discovery. notably happens when using wsdd on linux where
      samba would also register itself on dnssd.
      
      for ease of access and to not have to roundtrip through udsentry, discovery
      objects now have a udsName function that is meant to be the exact name
      used for the udsentry.
      
      Test Plan:
      - have samba
      - run wsdd.py from https://github.com/christgau/wsdd
      - server only shows up once
      
      Reviewers: ngraham
      
      Reviewed By: ngraham
      
      Subscribers: kde-frameworks-devel, kfm-devel
      
      Tags: #dolphin, #frameworks
      
      Differential Revision: https://phabricator.kde.org/D28078
      ba96d3b9
  7. 18 Mar, 2020 4 commits
  8. 16 Mar, 2020 5 commits
    • Harald Sitter's avatar
      fix readdirplus ifdef coverage · 8f45f13d
      Harald Sitter authored
      when using readdirplus we do not need to iter SMBC_FILE|DIR so we can
      skip the entire else if. previously this was off by one line, breaking
      the logic
      8f45f13d
    • Harald Sitter's avatar
      style++ · 7cc854ae
      Harald Sitter authored
      GIT_SILENT
      7cc854ae
    • Harald Sitter's avatar
      add readdirplus2 support for samba>=4.12 · ec40cd6e
      Harald Sitter authored
      Summary:
      unlike the dirent itering we do not need a separate stat call with this
      new api by instead itering on what are effectively stat-like objects.
      
      this simply runs before the regular itering which we still use to list
      shares and workgroups. browse_stat_path has been split into stat and
      udsentry-construction-from-stat so it can be used across both code
      paths.
      
      fun fact on the side: if there actually was a stat() api that returned
      libsmb_file_info, we could use that as well and forget about the stats
      structs in general :S
      
      BUG: 402988
      FIXED-IN: 20.04.0
      
      Test Plan:
      - build samba 4.12 rc
      - list server
      - list share
      - list dir in share
      
      - on 4.7
      - all of the above
      
      Reviewers: ngraham, asn
      
      Reviewed By: ngraham
      
      Subscribers: kde-frameworks-devel, kfm-devel
      
      Tags: #dolphin, #frameworks
      
      Differential Revision: https://phabricator.kde.org/D27520
      
      # Conflicts:
      #	smb/CMakeLists.txt
      #	smb/kio_smb.h
      #	smb/kio_smb_browse.cpp
      ec40cd6e
    • Harald Sitter's avatar
      smb: do not double finish · 82528611
      Harald Sitter authored
      Summary:
      finish() must not be called twice yet previously the case branches
      would call it but then there'd also be a global finished after the switch.
      remove the cases' finished().
      
      this code is, I think, actually not used anywhere so it matters little.
      
      Test Plan: hoping for the best!
      
      Reviewers: ngraham
      
      Reviewed By: ngraham
      
      Subscribers: kde-frameworks-devel, kfm-devel
      
      Tags: #dolphin, #frameworks
      
      Differential Revision: https://phabricator.kde.org/D28014
      82528611
    • Script Kiddy's avatar
      SVN_SILENT made messages (.desktop file) - always resolve ours · 4107f48c
      Script Kiddy authored
      In case of conflict in i18n, keep the version of the branch "ours"
      To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
      4107f48c
  9. 15 Mar, 2020 1 commit
  10. 11 Mar, 2020 1 commit
  11. 06 Mar, 2020 7 commits
    • Harald Sitter's avatar
      smb: fix wsdiscovery unknown device fallback string · 6557c6b4
      Harald Sitter authored
      Summary:
      wasn't using xi18n so <resource> wasn't parsed as markup but rather used
      verbatim. also was missing the argument for %1 so the host address wasn't
      included
      
      Test Plan: computer.clear() just prior now results in expected "Unknown device @ "::1"" names for the entries
      
      Reviewers: ngraham
      
      Reviewed By: ngraham
      
      Subscribers: kde-frameworks-devel, kfm-devel
      
      Tags: #dolphin, #frameworks
      
      Differential Revision: https://phabricator.kde.org/D27900
      6557c6b4
    • Harald Sitter's avatar
      smb: do not leak pbsd resolvers · 1eacae52
      Harald Sitter authored
      Summary:
      parent them to the discoverer. discoverer lives on the stack and is unwound
      once discovery is complete (or the eventloop timeout hit)
      
      Test Plan: made a dtor that qdebugged, dtor is now executed as expected
      
      Reviewers: ngraham
      
      Reviewed By: ngraham
      
      Subscribers: kde-frameworks-devel, kfm-devel
      
      Tags: #dolphin, #frameworks
      
      Differential Revision: https://phabricator.kde.org/D27901
      1eacae52
    • Harald Sitter's avatar
      smb: fix ipv6 support · bb83a071
      Harald Sitter authored
      Summary:
      libsmbc doesn't presently support smb://[ABCD::DCBA]/ uris because it
      has very opinionated colon parsing. as a workaround we convert hosts
      that are ipv6 addresses to their windows ipv6 literal representation.
      that is basically s/:/-/g and s/%/s/g and appending .ipv6-literal.net.
      
      BUG: 417682
      FIXED-IN: 20.04
      
      Test Plan: builds, test passes, `'smb://[::1]/foo'` works as expected
      
      Reviewers: ngraham
      
      Reviewed By: ngraham
      
      Subscribers: cfeck, thiago, kde-frameworks-devel, kfm-devel
      
      Tags: #dolphin, #frameworks
      
      Differential Revision: https://phabricator.kde.org/D27802
      bb83a071
    • Harald Sitter's avatar
      smb: add a unit test for smburl · d8d92670
      Harald Sitter authored
      Summary:
      only tests some of the obvious scenarios I can see right now.
      
      ::cd() has been changed to only support going up one path element. it's
      all we need it for and the previous code was almost certainly incorrect
      by calling setUrl with input that is definitely not anywhere near a valid
      url
      
      Test Plan: builds and test passes
      
      Reviewers: ngraham
      
      Reviewed By: ngraham
      
      Subscribers: apol, kde-frameworks-devel, kfm-devel
      
      Tags: #dolphin, #frameworks
      
      Differential Revision: https://phabricator.kde.org/D27801
      d8d92670
    • Harald Sitter's avatar
      smb: split module into two targets of which one is a static lib · d101d916
      Harald Sitter authored
      Summary:
      this allows us to use the intermediate static target for unit testing
      (which we'll want for smburl at the very least).
      the effective output remains unchanged, we simply have a fake library
      now before we turn it into a proper plugin .so.
      
      kdemain as a result was moved to its own file and only gets built into the
      final plugin but not the static library as it'd not have any use there
      anyway
      
      Test Plan: builds and works still
      
      Reviewers: ngraham, apol
      
      Reviewed By: apol
      
      Subscribers: apol, kde-frameworks-devel, kfm-devel
      
      Tags: #dolphin, #frameworks
      
      Differential Revision: https://phabricator.kde.org/D27800
      d101d916
    • Harald Sitter's avatar
      sftp: fix free space query for urls with empty path · 5cfd852a
      Harald Sitter authored
      Summary:
      e.g. `sftp://localhost` has an empty path
      
      fall back to assume it means '/'
      
      Test Plan: free space correctly listed on sftp://localhost
      
      Reviewers: ngraham, meven
      
      Reviewed By: meven
      
      Subscribers: kde-frameworks-devel, kfm-devel
      
      Tags: #dolphin, #frameworks
      
      Differential Revision: https://phabricator.kde.org/D27835
      5cfd852a
    • Harald Sitter's avatar
  12. 05 Mar, 2020 1 commit
  13. 04 Mar, 2020 1 commit
  14. 03 Mar, 2020 8 commits
  15. 29 Feb, 2020 1 commit
  16. 26 Feb, 2020 2 commits
    • Harald Sitter's avatar
      sftp: port to Result system to force serialization of error/finish condition · 74850eb2
      Harald Sitter authored
      Summary:
      the Result system was originally introduced to the FTP slave and now also
      makes an appearance in the SFTP slave. the system introduces a separation
      between logic and fronting API class to more tightly control when state
      changing calls (finished()/error()) are made. since these calls may only
      be made once during a given command multiple calls are at the very least
      indicative of bad code and at worst cause severe state confusion for the
      slavebase that it won't be able to recover from, rendering the slave
      instance broken.
      
      in the internal class Results are returned whenever an error can appear and
      these Results must be handled in some form. the only way to effectively
      produce user visible errors is to forward results up the call chain.
      
      Test Plan:
      - connect
      - copy remotely
      - overwrite remotely
      - copy to local
      - overwrite to local
      - copy from local to remote
      - copy form local to remote and overwrite
      
      Reviewers: dfaure, feverfew
      
      Reviewed By: dfaure, feverfew
      
      Subscribers: kde-frameworks-devel, kfm-devel
      
      Tags: #dolphin, #frameworks
      
      Differential Revision: https://phabricator.kde.org/D27153
      74850eb2
    • Harald Sitter's avatar
      smb: apply a whole bunch of static analyzer improvements · 70f2dc85
      Harald Sitter authored
      Summary:
      among other things:
      
      - {} initialize the posix structs
      - =default d/ctors where appropriate
      - synced argument names between header and cpp
      - no c-style casting
      - while(true) instead of while(1)
      - initialize class members that could previously have gone uninitialized
      - no single-line-multi-variable declaration
      
      Test Plan: builds
      
      Reviewers: ngraham
      
      Reviewed By: ngraham
      
      Subscribers: kde-frameworks-devel, kfm-devel
      
      Tags: #dolphin, #frameworks
      
      Differential Revision: https://phabricator.kde.org/D27646
      70f2dc85