Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-smbprotocol for openSUSE:Factory checked in at 2022-12-06 14:23:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-smbprotocol (Old) and /work/SRC/openSUSE:Factory/.python-smbprotocol.new.1835 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-smbprotocol" Tue Dec 6 14:23:11 2022 rev:18 rq:1040401 version:1.10.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-smbprotocol/python-smbprotocol.changes 2022-11-07 13:52:11.987973007 +0100 +++ /work/SRC/openSUSE:Factory/.python-smbprotocol.new.1835/python-smbprotocol.changes 2022-12-06 14:23:19.437600511 +0100 @@ -1,0 +2,8 @@ +Mon Dec 5 13:36:15 UTC 2022 - Yogalakshmi Arunachalam <yarunacha...@suse.com> + +- Update to version 1.10.1 + * Raise the original BadNetworkName error if the server doesn't indicate it supports DFS or + FSDriverRequired was raised trying to lookup the DFS information - #196 + * Fix pre auth session id tracking if the intermediate token messages return 0 as the session id + +------------------------------------------------------------------- Old: ---- python-smbprotocol-1.10.0.tar.gz New: ---- python-smbprotocol-1.10.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-smbprotocol.spec ++++++ --- /var/tmp/diff_new_pack.X1LTer/_old 2022-12-06 14:23:19.913604570 +0100 +++ /var/tmp/diff_new_pack.X1LTer/_new 2022-12-06 14:23:19.921604638 +0100 @@ -16,9 +16,8 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-smbprotocol -Version: 1.10.0 +Version: 1.10.1 Release: 0 Summary: SMBv2/v3 client for Python 2 and 3 License: MIT @@ -27,10 +26,11 @@ #Source: https://files.pythonhosted.org/packages/source/s/smbprotocol/smbprotocol-%%{version}.tar.gz Source: https://github.com/jborean93/smbprotocol/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz BuildRequires: %{python_module cryptography >= 2.0} +BuildRequires: %{python_module pip} BuildRequires: %{python_module pyspnego} BuildRequires: %{python_module pytest-mock} BuildRequires: %{python_module pytest} -BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-cryptography >= 2.0 @@ -60,10 +60,10 @@ %setup -q -n smbprotocol-%{version} %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %check @@ -74,6 +74,6 @@ %doc CHANGELOG.md README.md %{python_sitelib}/smbclient %{python_sitelib}/smbprotocol -%{python_sitelib}/smbprotocol-%{version}-py%{python_version}.egg-info +%{python_sitelib}/smbprotocol-%{version}*-info %changelog ++++++ python-smbprotocol-1.10.0.tar.gz -> python-smbprotocol-1.10.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smbprotocol-1.10.0/.github/workflows/ci.yml new/smbprotocol-1.10.1/.github/workflows/ci.yml --- old/smbprotocol-1.10.0/.github/workflows/ci.yml 2022-11-06 21:17:30.000000000 +0100 +++ new/smbprotocol-1.10.1/.github/workflows/ci.yml 2022-11-13 20:16:41.000000000 +0100 @@ -30,10 +30,10 @@ steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Select python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.9 @@ -43,7 +43,7 @@ python -m build - name: Upload built smbprotocol - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: artifact path: ./dist/* @@ -67,6 +67,7 @@ - 3.8 - 3.9 - '3.10' + - '3.11' python-arch: - x86 - x64 @@ -84,16 +85,18 @@ python-version: 3.8 - os: windows-2019 python-version: 3.9 + - os: windows-2019 + python-version: '3.10' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.python-arch }} - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: artifact path: ./dist @@ -101,7 +104,8 @@ - name: Extract OS name shell: bash run: | - echo "##[set-output name=name;]$( echo '${{ matrix.os }}' | tr '-' ' ' | awk '{print $1}' )" + echo NAME=$( echo '${{ matrix.os }}' | tr '-' ' ' | awk '{print $1}' ) + echo "name=${NAME}" >> $GITHUB_OUTPUT id: os - name: Test @@ -117,21 +121,21 @@ - name: Upload Test Results if: always() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: Unit Test Results (${{ matrix.os }} ${{ matrix.python-version }} ${{ matrix.python-arch }}) path: ./junit/test-results.xml - name: Upload Coverage Results if: always() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: Coverage Results (${{ matrix.os }} ${{ matrix.python-version }} ${{ matrix.python-arch }}) path: ./coverage.xml - name: Upload Coverage to codecov if: always() - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 with: files: ./coverage.xml flags: ${{ steps.os.outputs.name }},py${{ matrix.python-version }},${{ matrix.python-arch }} @@ -143,7 +147,7 @@ runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: artifact path: ./dist diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smbprotocol-1.10.0/CHANGELOG.md new/smbprotocol-1.10.1/CHANGELOG.md --- old/smbprotocol-1.10.0/CHANGELOG.md 2022-11-06 21:17:30.000000000 +0100 +++ new/smbprotocol-1.10.1/CHANGELOG.md 2022-11-13 20:16:41.000000000 +0100 @@ -1,5 +1,10 @@ # Changelog +## 1.10.1 - 2022-11-14 + +* Raise the original `BadNetworkName` error if the server doesn't indicate it supports DFS or `FSDriverRequired` was raised trying to lookup the DFS information - https://github.com/jborean93/smbprotocol/issues/196 +* Fix pre auth session id tracking if the intermediate token messages return 0 as the session id + ## 1.10.0 - 2022-11-07 * Require Python 3.7 or newer (dropped 3.6) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smbprotocol-1.10.0/pyproject.toml new/smbprotocol-1.10.1/pyproject.toml --- old/smbprotocol-1.10.0/pyproject.toml 2022-11-06 21:17:30.000000000 +0100 +++ new/smbprotocol-1.10.1/pyproject.toml 2022-11-13 20:16:41.000000000 +0100 @@ -6,7 +6,7 @@ [project] name = "smbprotocol" -version = "1.10.0" +version = "1.10.1" description = "Interact with a server using the SMB 2/3 Protocol" readme = "README.md" requires-python = ">=3.7" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smbprotocol-1.10.0/requirements-dev.txt new/smbprotocol-1.10.1/requirements-dev.txt --- old/smbprotocol-1.10.0/requirements-dev.txt 2022-11-06 21:17:30.000000000 +0100 +++ new/smbprotocol-1.10.1/requirements-dev.txt 2022-11-13 20:16:41.000000000 +0100 @@ -7,4 +7,4 @@ pytest pytest-cov pytest-mock -tox \ No newline at end of file +tox diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smbprotocol-1.10.0/src/smbclient/_pool.py new/smbprotocol-1.10.1/src/smbclient/_pool.py --- old/smbprotocol-1.10.0/src/smbclient/_pool.py 2022-11-06 21:17:30.000000000 +0100 +++ new/smbprotocol-1.10.1/src/smbclient/_pool.py 2022-11-13 20:16:41.000000000 +0100 @@ -10,7 +10,7 @@ import warnings from smbprotocol._text import to_text -from smbprotocol.connection import Connection +from smbprotocol.connection import Capabilities, Connection from smbprotocol.dfs import ( DFSReferralEntryFlags, DFSReferralRequest, @@ -18,7 +18,12 @@ DomainEntry, ReferralEntry, ) -from smbprotocol.exceptions import BadNetworkName, InvalidParameter, ObjectPathNotFound +from smbprotocol.exceptions import ( + BadNetworkName, + FSDriverRequired, + InvalidParameter, + ObjectPathNotFound, +) from smbprotocol.ioctl import CtlCode, IOCTLFlags, SMB2IOCTLRequest, SMB2IOCTLResponse from smbprotocol.session import Session from smbprotocol.tree import TreeConnect @@ -313,14 +318,29 @@ tree = TreeConnect(session, share_path) try: tree.connect(require_secure_negotiate=client_config.require_secure_negotiate) - except BadNetworkName: + except BadNetworkName as err: + # If the server doesn't mention it supports DFS then don't try to + # resolve the DFS path. + if not session.connection.server_capabilities.has_flag(Capabilities.SMB2_GLOBAL_CAP_DFS): + raise + ipc_path = "\\\\%s\\IPC$" % server if path == ipc_path: # In case we already tried connecting to IPC$ but that failed. raise # The share could be a DFS root, issue a root referral request to the hostname and cache the result. ipc_tree = get_smb_tree(ipc_path, **get_kwargs)[0] - referral = dfs_request(ipc_tree, "\\%s\\%s" % (path_split[0], path_split[1])) + try: + referral = dfs_request(ipc_tree, "\\%s\\%s" % (path_split[0], path_split[1])) + except FSDriverRequired: + # If the DFS Request fails with STATUS_FS_DRIVER_REQUIRED then + # the server doesn't support DFS requests and the original + # BadNetworkName error should be raised instead of this one. + # This provides better context as to why a failure occured, i.e. + # a bad share path was provided. + # https://github.com/jborean93/smbprotocol/issues/196 + raise err + client_config.cache_referral(referral) # Sometimes a DFS referral may return 0 referrals, this needs to be checked here to avoid repeats. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smbprotocol-1.10.0/src/smbprotocol/session.py new/smbprotocol-1.10.1/src/smbprotocol/session.py --- old/smbprotocol-1.10.0/src/smbprotocol/session.py 2022-11-06 21:17:30.000000000 +0100 +++ new/smbprotocol-1.10.1/src/smbprotocol/session.py 2022-11-13 20:16:41.000000000 +0100 @@ -276,6 +276,7 @@ raise SMBAuthenticationError("Failed to authenticate with server: %s" % str(err.message)) self.connection.preauth_session_table[self.session_id] = self + in_token = self.connection.gss_negotiate_token if self.auth_protocol != "negotiate": in_token = None # The GSS Negotiate Token can only be used for Negotiate auth. @@ -307,11 +308,11 @@ # If this is the first time we received the actual session_id, update the preauth table with the server # assigned id. session_id = response["session_id"].get_value() - if self.session_id < 0: + if self.session_id < 0 and session_id: del self.connection.preauth_session_table[self.session_id] self.connection.preauth_session_table[session_id] = self - self.session_id = session_id + self.session_id = session_id setup_response = SMB2SessionSetupResponse() setup_response.unpack(response["data"].get_value())