Skip to content

[MSSQL] Fix file exist error #2002

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

Dfte
Copy link
Contributor

@Dfte Dfte commented Jul 11, 2025

Hello,

This PR fixes the "file exists" error when the remote MSSQL server is not configured in english (see #1998).

Now it works no matter what the language is:

image

:)

(This PR requires #2001 to be merged first)

@Dfte Dfte changed the title Fix file exist error [MSSQL] Fix file exist error Jul 11, 2025
@anadrianmanrique anadrianmanrique added the medium Medium priority item label Jul 17, 2025
@gabrielg5
Copy link
Collaborator

Hey @Dfte, hello!

Been checking this one. Some notes:

  • We should add the impacket.mssql package in setup.py
  • In the version_name property of MSSQL_VERSION class, what if we just pass on KeyError?
    I tried with a couple SQLServer instances and got Microsoft SQL Server 2014 (unknown) (12.0.6179) and Microsoft SQL Server 2019 (unknown) (15.0.2135) for example. If we just pass on that exception at worst we'd say Microsoft SQL Server (<major>.<minor>.<build>)

As an FYI only because change is ok :)... there's a boolean parameter tuplemode in the sql_query function to return rows as list instead than dictionary. Perhaps useful in the scenario of the "File Exists" fix

(Think I'll be only checking this one and close #2001 as those changes are also included in here)

@Dfte
Copy link
Contributor Author

Dfte commented Jul 19, 2025

Ayo!! I have added impacket.mssql to the setupd.py and modified the version_name to pass on keyerror exception.

As for the file exist dict/list, good to know but the patch I have writen should be enough :)!

Let me know if you need anything else :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium Medium priority item
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants