Skip to content

feat!: remove TCP socket support for server connections#2527

Merged
joelim-work merged 2 commits intogokcehan:masterfrom
valoq:windows
Apr 16, 2026
Merged

feat!: remove TCP socket support for server connections#2527
joelim-work merged 2 commits intogokcehan:masterfrom
valoq:windows

Conversation

@valoq
Copy link
Copy Markdown
Contributor

@valoq valoq commented Apr 14, 2026

Since windows 10 (1803) the OS supports unix sockets
Older systems that dont have them would fall back to tcp sockets for the lf server client connection, which then listens to localhost, where the lf server can be reached by all local users, allowing access to the actual users files and shell (in theory, I dont have windows for testing)

Fortunately this should no longer be an issue on supported windows systems, but its probably better to just remove the fallback

Copy link
Copy Markdown
Collaborator

@CatsDeservePets CatsDeservePets left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't get me wrong but I don't want to merge a PR you can't test yourself.

@valoq
Copy link
Copy Markdown
Contributor Author

valoq commented Apr 14, 2026

I was hoping someone with Windows at hands may be willing to test it first :)

Copy link
Copy Markdown
Collaborator

@joelim-work joelim-work left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need any of the socket code anymore since you are assuming that support for unix sockets exists, just set gDefaultSocketPath as how it is done in os.go.

Additionally gSocketProt is going to always just be unix now, so you can also cleanup some of the surrounding code:

  • Delete gDefaultSocketProt
  • Set gSocketProt to unix directly, removing the variable altogether and hardcoding unix is also probably fine
  • Remove any if statements that depend on the value of gSocketProt

Copy link
Copy Markdown
Collaborator

@joelim-work joelim-work left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for the contribution.

@joelim-work joelim-work changed the title remove tcp fallback feat!: remove TCP socket support for server connections Apr 16, 2026
@joelim-work joelim-work added the breaking Pull requests that introduce breaking changes label Apr 16, 2026
@joelim-work joelim-work added this to the r42 milestone Apr 16, 2026
@joelim-work joelim-work merged commit 867cd99 into gokcehan:master Apr 16, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Pull requests that introduce breaking changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants