1. 06 Aug, 2020 1 commit
  2. 03 Aug, 2020 1 commit
    • Harald Sitter's avatar
      smb: refactor auth and context logic out of slave · e2dc8491
      Harald Sitter authored
      in an effort to implement kdirnotify for smb I needed to revisit the
      ancient monolithic code structure :|
      authentication is now in an authenticator class the authenticator class
      is plugged into a context class and the context takes care of context
      initialization (and callback handling because the smbc API is a bit meh
      vis a vis callback context void*).
      since the authentication now doesn't live in the slavebase anymore the
      interaction with `checkCachedAuthentication()` was moved into a pure
      virtual interface class. slavebase has an implementation of that
      interface and so will the future kdirnotify thingy.
  3. 04 Jun, 2020 2 commits
    • Harald Sitter's avatar
    • Harald Sitter's avatar
      smb: refactor smbc discovery · c65aa7ef
      Harald Sitter authored
      this now too is based on the discovery design used for WSD and DNSSD.
      advantage being that we can then de-duplicate ALL discovieries through
      a single code path.
      since smbc technically is meant to be used in a dirent while(){} way I am
      pulling some tricks here to get this nicer balanced via the event loop.
      ideally smbc would be thread safe or at least allow for multiple contexts,
      but currently both scenarios aren't working due to upstream bugs :(
      so instead of actually blocking while looping each loop cycle is posted
      through the event loop. this gives the other discoverers a chance to
      get their signal events in and not get stuck waiting for smbc to do its
      specifically also dnssd/wsd are started before smbc (if applicable anyway)
      so they get a head start speed things up quite a bit as previously
      they had to wait for smbc to do a full listing.
      the discoverer discovers a new smbcdiscovery which isn't terribly
      interesting but allows for a much more readable loop logic. furthermore
      the readdirplus2 ifdefs have been shuffled a bit, also with the goal
      of easing readability.
  4. 03 Apr, 2020 1 commit
    • Harald Sitter's avatar
      smb: fast copy · 46b5fb42
      Harald Sitter authored
      see https://bugs.kde.org/show_bug.cgi?id=291835#c57 for background
      - reading now happens inside a future. should be safe since we don't have
        any other threads doing anything while we wait.
      - the future feeds into a buffer from which the main thread will
        take file segments and write them to disk
      - buffer has 4 segments and synchronizes the threads via wait conditions
      - the size of a segment is determined somewhat dynamically between 64kb
        and 4mb. the larger a file is the more it benefits from larger
        read requests
      under perfect conditions this yields approximately mount-level copy
      performance, unfortunately those are hard to hit so on average it's usually
      less (somewhere in the range of 10 to 20% depending on the actual file
      size and server type).
      for many tiny files performance is about where it was before. the larger
      the files get the greater the gains from this diff though.
      specifically here's some samples I've taken:
      - for downloads from windows10
        - 1G & 4G file
          - compared to 20.04 is ~77% faster
          - within 10% of windows
        - 8G file
          - compared to 20.04 is ~79% faster
          - within 5% of windows
      - uploads to windows10
        - all sizes
          - compared to 20.04 is ~50% faster
          - now comparable performance to windows
      - for remote-to-remote file copies from windows10 to smbd 4.11.6
        - 1000 x 5K files
          - no change, dreadfully slow, likely problem in KIO internals
        - 1G file
          - compared to 20.04 is ~45% faster
          - within 8% of windows
        - 4G file
          - compared to 20.04 is ~95% faster
          - and somehow 18% faster than windows (could be a fluke)
      I've done transfers for 128M, 256M, 512M, 1G, 4G and partially 8G.
      Differences not mentioned are either unchanged, negligible or in line with
      documented trends.
      BUG: 291835
      FIXED-IN: 20.08
      Test Plan:
      - fallocate -l 1G file
      - copy around
      - copy kio-extras around
      Reviewers: ngraham, cfeck, #frameworks, #dolphin
      Subscribers: mmustac, meven, hallas, anthonyfieroni, asturmlechner, kde-frameworks-devel, kfm-devel
      Tags: #dolphin, #frameworks
      Differential Revision: https://phabricator.kde.org/D27504
  5. 16 Mar, 2020 1 commit
    • Harald Sitter's avatar
      add readdirplus2 support for samba>=4.12 · ec40cd6e
      Harald Sitter authored
      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
      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
  6. 03 Mar, 2020 2 commits
    • Harald Sitter's avatar
      smb: rename internal files to smburl · 3edefb83
      Harald Sitter authored
      they only contain smburl anyway and naming files accordingly makes the
      code base a bit easier to grasp
    • Harald Sitter's avatar
      smb: ecm clang-format the entire code base · a1775f44
      Harald Sitter authored
      over the past 20 years smb has gathered a whole bunch of different
      styles with varying indention and code styles. time to unify again
      I've done some cherry picking of the clang-format run since it had
      a tendency of worsening some long lines.
      Test Plan: builds and still lists stuff
      Reviewers: ngraham
      Subscribers: kde-frameworks-devel, kfm-devel
      Tags: #dolphin, #frameworks
      Differential Revision: https://phabricator.kde.org/D27676
  7. 26 Feb, 2020 1 commit
    • Harald Sitter's avatar
      smb: apply a whole bunch of static analyzer improvements · 70f2dc85
      Harald Sitter authored
      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
  8. 24 Feb, 2020 1 commit
    • Harald Sitter's avatar
      add initial wsdiscovery support · 41397521
      Harald Sitter authored
      needs kdsoap >= 1.8.50 (current master).
      builds a static variant of kdsoap-ws-discovery-client but can also
      use system's version if available.
      also reinvents how discovery works:
      there are now Discoverers for dnssd and wsd that get started/stopped.
      the Discoverers discover servers and emit them as Discoveries. Discoveries
      are then converted to udsentries for kio.
      BUG: 392447
      FIXED-IN: 20.04.0
      Test Plan:
      discover all the things!
      - windows 10 test vm with remote address
      - https://github.com/christgau/wsdd on remote host
      - avahi smb on remote host
      Reviewers: dfaure, #frameworks, #dolphin, ngraham
      Reviewed By: dfaure, ngraham
      Subscribers: meven, schmeisser, bcooksley, ngraham, caspermeijn, davidedmundson, kde-frameworks-devel, kfm-devel
      Tags: #dolphin, #frameworks
      Differential Revision: https://phabricator.kde.org/D25682
  9. 14 Feb, 2020 1 commit
    • Harald Sitter's avatar
      smb: enable anonymous and domain extra field in authinfo · 9d52cd9c
      Harald Sitter authored
      this causes kiod to query the password with the relevant functionality
      enabled. domain additionally defaults to whatever smbc_getWorkgroup returns
      BUG: 327484
      FIXED-IN: 19.12.3
      Test Plan:
      - builds
      - auth query has new functionality
      - logging in still works as expected
      I couldn't actually get the original problem in 327484 to appear with a samba DC I threw together, so for all I know this doesn't actually fix the bug but I have no way to test :|
      Reviewers: ngraham, dfaure
      Reviewed By: ngraham
      Subscribers: kde-frameworks-devel, kfm-devel
      Tags: #dolphin, #frameworks
      Differential Revision: https://phabricator.kde.org/D27320
  10. 11 Jan, 2020 1 commit
  11. 07 Jan, 2020 1 commit
  12. 23 Nov, 2019 1 commit
  13. 18 Nov, 2019 1 commit
  14. 08 Oct, 2019 1 commit
    • Harald Sitter's avatar
      improve error reporting for when kpasswdserver is unreachable · 5a870554
      Harald Sitter authored
      previously we'd not forward the errors coming out of the password dialog
      helper and instead eventually end up on generic access denied errors.
      seeing as the access denied is likely because we couldn't query auth info
      that is fairly misleading.
      checkPassword is now returning an error code instead of a bool. when we
      actually consider checkPassword an error we'll now raise this error
      instead of the generic access denied errors. when the user canceled
      the query we'll continue to raise the more topical error from smb (e.g.
      "access denied")
      primarily these errors appear when kiod/kpasswdserver is defunct
      or not installed meaning query functionality will not work at all.
      Test Plan:
      # broken kiod
      - remove dbus service file
      - kill
      - dolphin smb://host
      - no auth query
      - error about broken dialog
      # cancel
      - repair kiod
      - dolphin smb://host
      - auth query
      - cancel
      - auth query
      - cancel
      - error about access denied (because refused to authenticate)
      Reviewers: #frameworks, dfaure
      Reviewed By: dfaure
      Subscribers: ngraham, kde-frameworks-devel, kfm-devel
      Tags: #dolphin, #frameworks
      Differential Revision: https://phabricator.kde.org/D24387
  15. 30 Aug, 2019 1 commit
    • Alexander Saoutkin's avatar
      Fixing implementation of FileJob interface in smb/sftp slaves · 28fdc41f
      Alexander Saoutkin authored
      This patch does the following:
      1. Fixing instances of finished() being called after error() in smb slave.
      2. Changing behaviour of the sftp/smb slave to conform to  what is stated in D23194. In particular, the sftp slave should not call finished() in the open()/read()/write()/seek() methods.
      Test Plan: It compiles...
      Reviewers: chinmoyr, fvogt, sitter, dfaure
      Reviewed By: dfaure
      Subscribers: bcooksley, kde-frameworks-devel, kfm-devel
      Tags: #dolphin, #frameworks
      Differential Revision: https://phabricator.kde.org/D23207
  16. 07 Dec, 2018 1 commit
    • Harald Sitter's avatar
      fallback to dnssd service discovery if smb listDir failed on root · 55eb68ff
      Harald Sitter authored
      This elevates a problem with newer SMB protocol versions and smbclient
      not supporting discovery/browsing. when not using older (as in:
      ancient) protocol versions discovery doesn't work and smb:/ gives no
      By falling back to DNSSD based discovery we can ensure discovery of DNSSD
      remotes (namely linux and osx) is always working. Windows unfortunately
      does not support DNSSD and as such will not benefit from this mode of
      discovery and continue to be unlisted when using a protocol version
      without browsing support.
      CHANGELOG: When SMB Discovery is not working (protocol > SMB1) host discovery will now fall back to DNS-SD/Avahi/Bonjour.
      CCBUG: 392447
      CCBUG: 390551
      Test Plan:
      client min protocol = SMB2
      Lists devices
      Reviewers: #frameworks, #dolphin, broulik
      Reviewed By: broulik
      Subscribers: acrouthamel, alexde, bcooksley, ngraham, kde-frameworks-devel, kfm-devel
      Tags: #dolphin, #frameworks
  17. 09 Oct, 2018 1 commit
  18. 17 Jul, 2018 1 commit
  19. 18 Dec, 2017 1 commit
    • Kevin Funk's avatar
      Modernize: Use override · 355f89b4
      Kevin Funk authored
      * Replace Q_DECL_OVERRIDE with override
      * Also strip 'virtual' from methods having 'override' already.
  20. 01 Nov, 2017 1 commit
  21. 18 Jul, 2017 2 commits
  22. 12 Jul, 2017 1 commit
  23. 14 Sep, 2014 1 commit
  24. 11 Dec, 2013 1 commit
  25. 25 Nov, 2013 1 commit
    • Dawit Alemayehu's avatar
      Add support for 'copyToFile' and 'copyFromFile' optimizations. · 7658d849
      Dawit Alemayehu authored
      This implementation should make copying files from windows shares to local file
      faster. Additionally, this patch also adds support for other missing features
      such as partial download resumption and modified timestamp preservation.
      CCBUG: 291835
      CCBUG: 176271
      REVIEW: 112982
  26. 18 Mar, 2010 1 commit
    • Oswald Buddenhagen's avatar
      kde3support-- · f2de3d5f
      Oswald Buddenhagen authored
      this code is actually pretty useless (and consequently untested), as
      using it would require reviving the smbmounter konq-plugin (go to
      extragear/base/konq-plugins/smbmounter and run "svn merge -c -389803 .",
      then port to qt4 ...).
      CCBUG: 201617
      svn path=/trunk/KDE/kdebase/runtime/; revision=1104792
  27. 28 Dec, 2009 1 commit
    • John Layt's avatar
      krazy fixes · 048e4a5a
      John Layt authored
      svn path=/trunk/KDE/kdebase/runtime/; revision=1067073
  28. 07 Feb, 2009 1 commit
  29. 11 Oct, 2008 1 commit
  30. 01 Jun, 2008 1 commit
  31. 09 May, 2008 1 commit
    • Vlad Codrea's avatar
      - Don't rely on errno because its value changes after the first read. · 8c0425a4
      Vlad Codrea authored
      Instead, save its value in a new variable.
      - Ensure passed parameters and return values to samba functions match
      their prototype in libsmbclient.h .
      - Fix file open flags in FileJob functions
      - Implement SMBSlave::write
      svn path=/trunk/KDE/kdebase/runtime/; revision=805653
  32. 21 Feb, 2008 1 commit
  33. 18 Dec, 2007 1 commit
  34. 05 Oct, 2007 1 commit
  35. 22 Jul, 2007 1 commit
  36. 13 Jun, 2007 1 commit
    • Laurent Montel's avatar
      Fix include · 33a2c64d
      Laurent Montel authored
      svn path=/trunk/KDE/kdebase/runtime/; revision=675269
  37. 22 Apr, 2007 1 commit