Uploaded image for project: 'TrueNAS'
  1. TrueNAS
  2. NAS-107501

Fix pdbedit parsing when SMB service aux param invalid

    XMLWordPrintable

    Details

      Description

      PR: https://github.com/freenas/freenas/pull/5636

      When user adds invalid auxilary parameter(s) to the smb.conf, pdbedit
      invocations (or any utilty that ultimately calls lpcfg_map_parameter()),
      will result in additional warning messages being printed even at DEBUG 0
      on stdout. This may break parsing of output from the CLI utility, and in
      the case of pdbedit, will prevent updating of user password.

      This commit will change two things. First is a minimal workaround for the
      passdb update to splitlines() and use only last element of resulting list.
      Warnings in this specific situation are prepended to the command's output
      and so will be safely discarded. Additionally, validation for smb_options
      (auxiliary parameters for the SMB service) will be expanded to add a
      call to LoadParm.dump_a_parameter(<aux param>). This function will raise
      a RuntimeException if the parameter being queried does not exist in Samba's
      internal param table.

        Attachments

          Attachments

            JEditor

              Activity

                People

                Assignee:
                awalker Andrew Walker
                Reporter:
                bugclerk Bug Clerk
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: