Skip to content

Comments

Add userDirIsRoot configuration to FTP/SFTP client to support jailed home directories#1487

Merged
niveathika merged 11 commits intoballerina-platform:masterfrom
SachinAkash01:master
Aug 20, 2025
Merged

Add userDirIsRoot configuration to FTP/SFTP client to support jailed home directories#1487
niveathika merged 11 commits intoballerina-platform:masterfrom
SachinAkash01:master

Conversation

@SachinAkash01
Copy link
Member

@SachinAkash01 SachinAkash01 commented Aug 6, 2025

Purpose

$subject

Fixes: ballerina-platform/ballerina-library#8153

Examples

For an example, after new config flag to set userDirIsRoot explicitly:

ftp:ClientConfiguration sftpConfig = {
    protocol: ftp:SFTP,
    host: "example.com",
    port: 22,
    auth: {
        credentials: {
            username: "user",
            password: "pass"
        }
    },
    userDirIsRoot: true // Avoids CWD / on servers that jail users to their home directory
};

ftp:Client sftpClient = check new (sftpConfig);

Checklist

  • Linked to an issue
  • Updated the changelog
  • Added tests
  • Updated the spec
  • Checked native-image compatibility

@ayeshLK
Copy link
Member

ayeshLK commented Aug 6, 2025

@SachinAkash01 lets create a Ballerina library issue for this and tag here in the PR. Along with that lets update the changelog + package spec.

@codecov
Copy link

codecov bot commented Aug 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.57%. Comparing base (56a0cd9) to head (d9c5724).
⚠️ Report is 12 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1487      +/-   ##
============================================
- Coverage     84.72%   83.57%   -1.15%     
- Complexity      241      338      +97     
============================================
  Files            28       37       +9     
  Lines          1283     1632     +349     
  Branches        156      237      +81     
============================================
+ Hits           1087     1364     +277     
- Misses          133      165      +32     
- Partials         63      103      +40     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ayeshLK
Copy link
Member

ayeshLK commented Aug 6, 2025

@SachinAkash01 better if we could update the Examples section in the PR description with an actual code sample.

@SachinAkash01
Copy link
Member Author

SachinAkash01 commented Aug 6, 2025

@SachinAkash01 lets create a Ballerina library issue for this and tag here in the PR. Along with that lets update the changelog + package spec.

@ayeshLK Created a Ballerina Library issue and linked it. For the documentation and test cases, I'm planning to send another PR.

@TharmiganK
Copy link
Contributor

@SachinAkash01 lets create a Ballerina library issue for this and tag here in the PR. Along with that lets update the changelog + package spec.

@ayeshLK Created a Ballerina Library issue and linked it. For the documentation and test cases, I'm planning to send another PR.

The usual practice is to have the test cases and documentation(spec and change log) in the same PR. Thats why we have the check list in the description.

@SachinAkash01
Copy link
Member Author

@SachinAkash01 lets create a Ballerina library issue for this and tag here in the PR. Along with that lets update the changelog + package spec.

@ayeshLK Created a Ballerina Library issue and linked it. For the documentation and test cases, I'm planning to send another PR.

The usual practice is to have the test cases and documentation(spec and change log) in the same PR. Thats why we have the check list in the description.

This fix was required urgently.. So that's why we were planning to do a quick release. But since they have went ahead with a workaround, I will update the PR today.

@sonarqubecloud
Copy link

@niveathika niveathika merged commit cd07d58 into ballerina-platform:master Aug 20, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SFTP Access Issue with Client Environment

6 participants