1. 03 Mar, 2020 1 commit
    • David Edmundson's avatar
      Correctly disable UDS_ACCESS being set · 01e442c7
      David Edmundson authored
      Summary:
      718abcb6 tries to disable UDS_ACCESS
      being set. See the long comment introduced.
      
      It did this by setting the value to -1 which doesn't achieve that
      result.
      
      -1 is a perfectly valid value that gets send to the client.
      
      Having it set breaks anyone calling udsEntry.numberValue(UDS_ACCESS,
      aLegitimateDefault) getting their default. Something used by kio-fuse.
      
      Test Plan:
      Used kio-fuse
      Opened a samba file in mplayer
      It opened
      
      Opened a text editor in kate (using regular kio)
      
      Reviewers: sitter, feverfew
      
      Reviewed By: sitter
      
      Subscribers: kde-frameworks-devel, kfm-devel
      
      Tags: #dolphin, #frameworks
      
      Differential Revision: https://phabricator.kde.org/D27810
      01e442c7
  2. 14 Feb, 2020 2 commits
    • Harald Sitter's avatar
      smb: disable mode bits getting forwarded to KIO · 718abcb6
      Harald Sitter authored
      Summary:
      mode bits in libsmb_stat are fairly cheaply constructed. file and directory
      qualification is alright, beyond that it is a bit of a shambles.
      specifically +W is set iff the DOS attribute READONLY isn't set, but
      that attribute doesn't mean what we think it means, at least not on
      NT+ systems. see exhaustive comment.
      
      long story short: we cannot represent mode bits accurately because NT's
      access controls simply do not map to posix mode bits. therefore I'm
      removing the mode setting for the udsentry, making all entries effectively
      writable.
      
      whether an entry truly is writable is hard to say anyway. specifically
      because SMB+NTFS have independent ACLs. so, the SMB ACL may allow a
      given user or group to do something, that doesn't mean they'll also
      have permissions on a file system level.
      
      BUG: 414482
      FIXED-IN: 19.12.3
      
      Test Plan:
      previously not writable shares as described in the bug report are now writable.
      permission dialog looks a bit meh now, it wasn't really designed around not knowing
      what the access situation is. gnome simply shows a "dunno what permissions we have" label
      instead of everything, that seems like a reasonable approach
      
      Reviewers: ngraham
      
      Reviewed By: ngraham
      
      Subscribers: dfaure, kde-frameworks-devel, kfm-devel
      
      Tags: #dolphin, #frameworks
      
      Differential Revision: https://phabricator.kde.org/D27372
      718abcb6
    • Harald Sitter's avatar
      smb: map ECONNABORTED to ERR_CONNECTION_BROKEN · 2075e763
      Harald Sitter authored
      Summary:
      seems the most reasonable candidate given the pretty strings in
      KIO::buildErrorString and the detailed causes in the detail function.
      
      this does not really improve the error message, but should dolphin
      ever learn to pick up details from detailedErrorStrings it would make
      diagnosing easier.
      
      ECONNABORTED can mean any number of things, so I guess a signle line
      error will always be incredibly vague.
      
      BUG: 415436
      FIXED-IN: 19.12.3
      
      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/D27377
      2075e763
  3. 13 Feb, 2020 5 commits
    • Harald Sitter's avatar
      smb: install smb as both smb:// and cifs:// · a5f51238
      Harald Sitter authored
      Summary:
      the latter while not IANA registered is apparently used in places. to
      cheaply support it we now configure the protocol file for both protocol
      'smb' and 'cifs' and installing two protocol files. they are still both
      backed by the same plugin and otherwise the same.
      code-wise this also required adjustments to the URL validation tech as
      it has hardcoded checks for smb schemes.
      
      FIXED-IN: 19.12.3
      BUG: 327295
      
      Test Plan:
      - cifs://host/share
      - cifs://host
      - cifs://
      
      all open correctly. they do get translated to smb because of the checkUrl code.
      
      checkUrl seems entirely pointless, SMBUrl does a bit of validation/fixing as part of
      updateCache. It occurs to me checkUrl should simply be incorporated into SMBUrl
      and we should construct an SMBUrl where we previously called checkUrl. before doing
      anything of value we construct SMBUrls anyway, so the isolated logic does absolutely
      nothing SMBUrl couldn't do just as well. also needs a unit test -.- ... too much
      refactoring for a bugfix though
      
      Reviewers: dfaure, ngraham
      
      Reviewed By: ngraham
      
      Subscribers: meven, feverfew, kde-frameworks-devel, kfm-devel
      
      Tags: #dolphin, #frameworks
      
      Differential Revision: https://phabricator.kde.org/D27291
      a5f51238
    • Harald Sitter's avatar
      smb: set the share comment as UDS_COMMENT for the UI to display · dddafae5
      Harald Sitter authored
      Summary:
      currently this seems to not really have any visibility through dolphin
      so concluding the fix also requires changes to dolphin to enable the
      comment somewhere. it is technically a column in the details view but
      that doesn't actually seem to work
      
      CCBUG: 105086
      
      Test Plan: hoping for the best in absence of a UI!
      
      Reviewers: ngraham
      
      Subscribers: kde-frameworks-devel, kfm-devel
      
      Tags: #dolphin, #frameworks
      
      Differential Revision: https://phabricator.kde.org/D27292
      dddafae5
    • Harald Sitter's avatar
      smb: do not map uid and gid · 25a02064
      Harald Sitter authored
      Summary:
      libsmbc returns the uid/gid of the process, not of the file, the data
      is entirely useless to us. do not list it.
      currently there is no way to get the actual uid/gid of a dirent. internally
      there seems to be tech available that uses the samba unix extension but
      that doesn't have any public API.
      
      in short: we can't determine ownership client-side
      
      BUG: 212801
      
      Test Plan: no longer shows current user as owner. in particular when that is not true!
      
      Reviewers: ngraham
      
      Reviewed By: ngraham
      
      Subscribers: kde-frameworks-devel, kfm-devel
      
      Tags: #dolphin, #frameworks
      
      Differential Revision: https://phabricator.kde.org/D27293
      25a02064
    • Harald Sitter's avatar
      smb: fix free space calculation · 6832817f
      Harald Sitter authored
      Summary:
      - collapse statvfs call, there's no purpose in manually opening the file
        when libsmbc has a convenience wrapper that does exactly what we need
        with less code on our end
      - blockSize is now calculated as per the conditional branches in
        smbc_stat.c
      - free space calculation is now backwards compatible with slightly busted
        legacy versions of libsmbc not setting f_bavail
      
      FIXED-IN: 19.12.3
      BUG: 298801
      
      Test Plan: free space calculation now works with windows10, ubuntu18.04, ubuntu19.10
      
      Reviewers: ngraham, meven
      
      Reviewed By: ngraham, meven
      
      Subscribers: meven, kde-frameworks-devel, kfm-devel
      
      Tags: #dolphin, #frameworks
      
      Differential Revision: https://phabricator.kde.org/D27294
      6832817f
    • Harald Sitter's avatar
      smb: support more advanced hidden file flag · e2eadb75
      Harald Sitter authored
      Summary:
      smb attaches different meaning to the +x flags of files to represent DOS
      style flags. read them and hide hidden files. we currently have no
      KIO backing for the others but for documentation purpose I've mentioned
      them in detail so we can extend this in the future without having
      to descend into samba docs.
      
      FIXED-IN: 19.12.3
      BUG: 307353
      
      Test Plan:
      - set jpgs hidden as described in bug report
      - they are now hidden in dolphin
      
      Reviewers: ngraham
      
      Reviewed By: ngraham
      
      Subscribers: kde-frameworks-devel, kfm-devel
      
      Tags: #dolphin, #frameworks
      
      Differential Revision: https://phabricator.kde.org/D27295
      e2eadb75
  4. 08 Oct, 2019 1 commit
    • Harald Sitter's avatar
      improve error reporting for when kpasswdserver is unreachable · 5a870554
      Harald Sitter authored
      Summary:
      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
      5a870554
  5. 07 Jan, 2019 1 commit
  6. 07 Dec, 2018 1 commit
    • Harald Sitter's avatar
      fallback to dnssd service discovery if smb listDir failed on root · 55eb68ff
      Harald Sitter authored
      Summary:
      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
      results.
      
      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:
      smb.conf:
      
      ```
      [global]
      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
      
      Differential Revision: https://phabricator.kde.org/D16299
      55eb68ff
  7. 17 Oct, 2018 3 commits
    • Harald Sitter's avatar
      apply eexist workaround from listDir to stat as well · 76402b7c
      Harald Sitter authored
      Summary:
      knetattach stats() without first doing a listDir() so in the event that
      the url requires authentication it won't work and error out on the EEXISTS.
      listDir has a fallback hack for this which was missing from stat.
      
      stat now has this workaround as well and correctly brings up an auth
      dialog on shares that require it.
      
      BUG: 399699
      
      Test Plan:
      - knetattach
      - smb
      - data for host (folder should require auth)
      - save and connect
      - auth dialog comes up
      - enter details
      - ok
      - works
      
      Reviewers: broulik
      
      Reviewed By: broulik
      
      Subscribers: kde-frameworks-devel, kfm-devel
      
      Tags: #dolphin, #frameworks
      
      Differential Revision: https://phabricator.kde.org/D16272
      76402b7c
    • Harald Sitter's avatar
      apply eexist workaround from listDir to stat as well · cf34ba60
      Harald Sitter authored
      Summary:
      knetattach stats() without first doing a listDir() so in the event that
      the url requires authentication it won't work and error out on the EEXISTS.
      listDir has a fallback hack for this which was missing from stat.
      
      stat now has this workaround as well and correctly brings up an auth
      dialog on shares that require it.
      
      BUG: 399699
      
      Test Plan:
      - knetattach
      - smb
      - data for host (folder should require auth)
      - save and connect
      - auth dialog comes up
      - enter details
      - ok
      - works
      
      Reviewers: broulik
      
      Reviewed By: broulik
      
      Subscribers: kde-frameworks-devel, kfm-devel
      
      Tags: #dolphin, #frameworks
      
      Differential Revision: https://phabricator.kde.org/D16272
      cf34ba60
    • Kai Uwe Broulik's avatar
      Avoid crash by not checking free space for smb:// · 767415da
      Kai Uwe Broulik authored
      This isn't a real location but the overview of all found hosts.
      smbc_opendir would succeed but then crash in smbc_fstatvfs
      
      Differential Revision: https://phabricator.kde.org/D15142
      
      (cherry picked from commit 000b1d91)
      767415da
  8. 08 Oct, 2018 1 commit
  9. 31 Aug, 2018 1 commit
  10. 17 Jul, 2018 1 commit
  11. 01 Nov, 2017 1 commit
  12. 21 Oct, 2017 1 commit
    • David Edmundson's avatar
      Fix smb:/ handling · 859ed4f1
      David Edmundson authored
      Summary:
      smb:// is a URL with no host and no path
      smb:/// is a URL with no host, but a valid path
      
      The current code special cases smb:/ which isn't a real thing.
      
      This results in smb:// falling through checkURL() and being incorrectly
      modified into smb:/// creating a URL with a host, something different.
      
      This code makes any smb:/ get converted into smb:// at the right place.
      Then the special case for having no host or path are handled properly.
      
      Test Plan: https://paste.kde.org/pfpwrlxva
      
      Reviewers: apol, madcatx, elvisangelaccio, ngraham
      
      Reviewed By: elvisangelaccio, ngraham
      
      Subscribers: ngraham
      
      Differential Revision: https://phabricator.kde.org/D8141
      859ed4f1
  13. 18 Jul, 2017 7 commits
  14. 12 Jul, 2017 2 commits
  15. 10 Jul, 2017 1 commit
  16. 14 Sep, 2014 1 commit
  17. 03 Mar, 2014 1 commit
  18. 11 Dec, 2013 1 commit
  19. 18 Nov, 2013 1 commit
  20. 26 Oct, 2013 1 commit
  21. 09 Sep, 2013 1 commit
  22. 28 Dec, 2009 1 commit
    • John Layt's avatar
      krazy fixes · 048e4a5a
      John Layt authored
      svn path=/trunk/KDE/kdebase/runtime/; revision=1067073
      048e4a5a
  23. 06 Aug, 2009 1 commit
  24. 17 Jul, 2009 1 commit
  25. 02 Dec, 2008 1 commit
  26. 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
      8c0425a4