1. 24 Aug, 2020 2 commits
  2. 23 Aug, 2020 1 commit
  3. 21 Aug, 2020 3 commits
    • Harald Sitter's avatar
      fix multiple opening of properties · c01860e5
      Harald Sitter authored
      in the qml port I incorrectly registered the cpp types as singletons,
      but from a registration POV (which is application-wide) they aren't
      singleton. they are bound to the context of the plugin instance that
      created them. alas, this is a bit awkward to present because none of the
      classes can deal with post-ctor initialization (that is: qml would ctor
      the objects and then configure them through the properties) so we can't
      use them through QML directly. we could construct them per-engine with
      the qmlRegisterSingletonType callback system, but that's a bit tricky
      because Model, UserManager and ShareContext are tightly related, so we'd
      have to do extra fiddeling to get them to link up.
      
      instead simply expose these three as properties on the plugin and set
      the plugin as contextproperty. longer-term it may be worthwhile to
      change the three classes to support qml-style property construction so
      we can construct them from QML as that would then also resolve some
      asyncness concerns I had about the fact that the ctors are doing data
      processing (even though it is very lightweight data).
      
      this also makes the root widget of the page a unique_ptr. because of the
      child ordering here the widget is actually a sibling of the plugin
      instance so it can and will get deleted after the plugin which results
      in bogus warnings as the context property (the plugin) gets destroyed
      and all bindings get reevaluated against the now null property
      
      BUG: 425591
      FIXED-IN: 20.12
      c01860e5
    • Harald Sitter's avatar
      add smb user management support · d9692b4c
      Harald Sitter authored
      this rejiggers the model a bit and splits out user mapping logic into a
      usermanager. the usermanager loads all users and models their samba
      state. to do this it uses samba's pbedit tool. since this is a database
      editor tool actually it needs a kauth helper to carry out the lookups.
      this allows modelling of whether a user is enabled in samba or not (an
      actual GUI for this is not part of this commit)
      
      in addition to looking up the state this adds a new page for the page
      stack for when the current user is not enabled in samba. this is to
      prevent users from setting up shares but then not being able to access
      them (assuming guest access is not possible - as is the case by default
      without a smb.conf enabling support for it)
      
      this new page sports a simple password setting UI that then again turns
      to the auth helper for help. the auth helper runs smbpasswd, also a
      samba CLI tool, to set a password for the user
      
      all of this is conditional on samba actually having been configured to
      use a local pdb instance as authentication database. other options would
      be ldap or some such and will likely never be supported because they'd
      only be used in corporate/managed environments where the user at hand
      wouldn't be able to manage users anyway
      
      BUG: 334875
      FIXED-IN: 20.12
      d9692b4c
    • Harald Sitter's avatar
      fix syntax · 133d94e3
      Harald Sitter authored
      133d94e3
  4. 20 Aug, 2020 3 commits
    • Harald Sitter's avatar
      rejigger acl page and add a sheet to be shown when using a denial · 6e7878af
      Harald Sitter authored
      denials always win so they shouldn't really be used unless one is
      suuuuuuuuuuuuper sure about it.
      to that end we'll throw up a warning that tries to explain that denials
      probably aren't what the user wants and also that denying usually isn't
      necessary because filesystem permissions still apply, so even when using
      a liberal share ACL the filesystem ACL would still prevent other users
      from reading one's private data for example
      
      this was a bit awkward to implement because sheets need to overlay
      something yet overlaying the columnlayout messes with the layout size
      itself compacting the tableview away.
      equally we cannot use a regular page because pages come with a whole
      bunch of padding that looks very weird here and I've not found a way to
      disable it either. instead we now have a new toplevel item which merely
      acts as the thing the sheet can overlay. the item then contains the
      previous layout and elements so they retain the sizing even when
      overlayed
      
      BUG: 422554
      FIXED-IN: 20.12
      6e7878af
    • Harald Sitter's avatar
      fix up ACE ordering · f3c12f12
      Harald Sitter authored
      the order of entries within the ACL have meaning as samba aborts
      permission lookup on matching denials but combines read and full access.
      since our ACL table mimics windows' we'll follow its behavior as it's
      also fairly easy to explain
      
      "a denial always denies, no matter what other rules exist"
      
      to that end we'll now sort the ACL to first list denials, then reads,
      then full access
      
      - if foo is denied they'll not be let in
      - if bar is read they get let in
      - if Everyone is denied nobody gets in
      
      should we later add group support this further becomes
      
      - if groupFoo is denied and bar is a member of it then bar is denied
      - if groupBar is read and foo is a member of it then foo is still denied
      - if groupFoo is fullacces and bar is a member they'll get fullaccess
      
      CCBUG: 422554
      FIXED-IN: 20.12
      f3c12f12
    • Harald Sitter's avatar
      repair share path handling · 3bfb749e
      Harald Sitter authored
      this fell over in the refactor so make it a bit more streamlined. the
      context now gets a URL (file:///home/foo) and feeds that into the
      resolveShare which constructs a path from it (/home/foo) to then feed to
      ksambashare (which exclusively deals with local paths).
      the path on the share instance is then the path to always use. to aid
      with that we'll stop holding the url as a member
      
      this unbreaks creating new shares which had no path set (this is now
      done in resolveShare). also print that on applyChanges for easy
      debugging
      3bfb749e
  5. 19 Aug, 2020 1 commit
    • Harald Sitter's avatar
      port to qml and refactor to somewhat isolated pages · ba43b8e9
      Harald Sitter authored
      this is in preparation to add more "wizardy" behavior for scenarios
      where samba isn't installed yet, such as adding the user to the samba
      database.
      
      the way the new ui works is that it's rendering a page stage, we push
      pages on as they become relevant. longer term that'll be at least the
      pages install->reboot->setpassword->acls
      
      this also features some related improvements such as
      - better const corectness for some member vars
      - less ifdef samba_install
      - the maximum share name is now capped at 60 characters (which is what
      windows10 allows)
      - there's a soft warning for the 60 character limit as well in the gui
      ba43b8e9
  6. 17 Aug, 2020 1 commit
  7. 12 Aug, 2020 3 commits
    • Harald Sitter's avatar
      move to spdx · 35bf3684
      Harald Sitter authored
      as per new licensing policy
      35bf3684
    • Harald Sitter's avatar
      various stylistic improvements · 8ab0514d
      Harald Sitter authored
      - use override instead of virtual; it implies virtual
      - use =default where possible
      - reduce slot lambda signatures to only used arguments
      - getUsersList is now static - it uses no members
      - reboot is now static - it uses no member
      - use auto when the right hand side of an assignment shows the type
      - make sure pointer members are init'd to nullptr lest we forget to
      declare them in the ctor
      8ab0514d
    • Harald Sitter's avatar
      give add/remove errors a GUI · 01a6bda3
      Harald Sitter authored
      previously we'd ignore the returned errors leaving the user hanging when
      adding a share fails and not even telling them why.
      
      we now route errors on add/remove through somewhat generic
      kmessagebox-based reporting tech.
      unfortunately this is fairly excessive WRT string mapping because
      ksambashare sports one enum for everything so API-wise a call to save()
      could return UserShareAclOk but in practice that of course cannot happen
      because that'd mean nothing. as such many of the strings are overly
      generic because they cannot practically appear on weak context actions
      like save().
      very meh.
      
      this depends on the new lastSystemErrorString() API in KIO to stringify
      the majority of failure scenarios here, which come out of samba's 'net'
      command
      
      trying to share /tmp now produces a kmessagebox informing the user that
      the dir cannot be shared
      
      BUG: 334618
      FIXED-IN: 20.12
      01a6bda3
  8. 10 Aug, 2020 1 commit
  9. 15 Jul, 2020 1 commit
  10. 07 Jul, 2020 1 commit
  11. 18 Jun, 2020 2 commits
  12. 17 Jun, 2020 2 commits
  13. 13 Jun, 2020 1 commit
  14. 12 Jun, 2020 2 commits
  15. 08 Jun, 2020 1 commit
  16. 07 Jun, 2020 2 commits
  17. 02 Jun, 2020 2 commits
  18. 06 May, 2020 1 commit
  19. 30 Apr, 2020 1 commit
  20. 23 Apr, 2020 1 commit
  21. 22 Apr, 2020 1 commit
  22. 21 Apr, 2020 1 commit
  23. 09 Apr, 2020 2 commits
  24. 04 Apr, 2020 2 commits
  25. 27 Mar, 2020 1 commit
  26. 15 Mar, 2020 1 commit
    • Nate Graham's avatar
      Recommend rebooting after installing Samba · 8a104aa4
      Nate Graham authored
      Summary:
      After Samba is installed, very frequently it will not work correctly until the machine is
      rebooted. One potential reason is when the installed package has made group membership
      changes, which only take effect after a reboot.
      
      This patch implements a reboot recommendation along with a button to reboot the machine.
      Both are shown immediately after Samba has been installed.
      
      Because some expert users may understand the technical details of what's going on, the
      reboot is only recommended, not required. If the window is closed and then re-opened,
      the normal Samba sharing configuration UI is displayed instead of the reboot prompt.
      
      Added a new function rather than using a Lambda because it may be useful for additional
      purposes too (e.g. https://bugs.kde.org/show_bug.cgi?id=407846)
      
      FEATURE: 407845
      FIXED-IN: 20.04.0
      
      Test Plan:
      http://s1.webmshare.com/Ry55q.webm (not uploaded to Phab due to file size limit)
      
      1. Remove Samba
      2. Go to share a folder
      3. Click "Install Samba"
      4. After the installation has completed, click the "Restart" button and see that the machine reboots
      
      5. Remove Samba again
      2. Go to share a folder
      3. Click "Install Samba"
      4. Close the window and re-open it instead of rebooting as recommended
      5. See that the Samba sharing config UI is all there
      
      Reviewers: #vdg, #frameworks, #dolphin, apol, sitter
      
      Reviewed By: sitter
      
      Subscribers: anthonyfieroni, sitter, bruns
      
      Differential Revision: https://phabricator.kde.org/D21466
      8a104aa4