Skip to content

Commit

Permalink
fix sftp unregistered
Browse files Browse the repository at this point in the history
  • Loading branch information
Son Roy Almerol committed Nov 4, 2024
1 parent 4c3fe09 commit 48e821a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
executable_compression: upx
binary_name: pbs-d2d-agent
project_path: ./cmd/pbs_windows_agent
ldflags: -H=windowsgui
- uses: actions/upload-artifact@v4
with:
name: windows-binary
Expand Down
2 changes: 1 addition & 1 deletion internal/agent/sftp/sftp.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func handleConnection(conn net.Conn, sftpConfig *SFTPConfig, baseDir string) {
return
}

if strings.Contains(conn.RemoteAddr().String(), server.Hostname()) {
if !strings.Contains(conn.RemoteAddr().String(), server.Hostname()) {
log.Printf("WARNING: an unregistered client has attempted to connect: %s", conn.RemoteAddr().String())
return
}
Expand Down

0 comments on commit 48e821a

Please sign in to comment.