Buy commercial curl support. We
help you work out your issues, debug your libcurl applications, use the API,
port to new platforms, add new features and more. With a team lead by the
curl founder Daniel himself.
Bypass root folder and directly cd to an ftp location
- Contemporary messages sorted: [ by date ] [ by thread ] [ by subject ] [ by author ] [ by messages with attachments ]
From: Nimit Dhulekar via curl-library <curl-library_at_lists.haxx.se>
Date: Mon, 13 Oct 2025 16:17:42 +0000
Hi,
We're running into an issue when using libcurl (and curl). If the root folder of an FTP server denies access for security reasons and we want to directly connect to a different folder, this fails with a 550 Permission Denied. This is happening because curl is still making an initial connection to "/", and then calls cd to change to the requested folder. Here is a log snippet of what we're observing:
00000054 2025-Oct-02 07:56:53.489043 0x0000389c I [INFO] Re-using existing connection with host 192.168.1.10
00000055 2025-Oct-02 07:56:53.489043 0x0000389c G [HEADER OUT] CWD /
00000056 2025-Oct-02 07:56:53.494092 0x0000389c G [HEADER IN] 550 Permission denied
00000057 2025-Oct-02 07:56:53.494092 0x0000389c I [INFO] Server denied you to change to the given directory
00000058 2025-Oct-02 07:56:53.494092 0x0000389c I [INFO] Connection #0 to host 192.168.1.10 left intact
00000059 2025-Oct-02 07:56:53.494092 0x0000389c R res=9
Is there a way to make a connection directly to the requested folder without curl first connecting to the "/"? Evidently, this works when using certain Java APIs such as org.apache.commons.net.ftp.FTPClient.
Thanks,
Nimit
Date: Mon, 13 Oct 2025 16:17:42 +0000
Hi,
We're running into an issue when using libcurl (and curl). If the root folder of an FTP server denies access for security reasons and we want to directly connect to a different folder, this fails with a 550 Permission Denied. This is happening because curl is still making an initial connection to "/", and then calls cd to change to the requested folder. Here is a log snippet of what we're observing:
00000054 2025-Oct-02 07:56:53.489043 0x0000389c I [INFO] Re-using existing connection with host 192.168.1.10
00000055 2025-Oct-02 07:56:53.489043 0x0000389c G [HEADER OUT] CWD /
00000056 2025-Oct-02 07:56:53.494092 0x0000389c G [HEADER IN] 550 Permission denied
00000057 2025-Oct-02 07:56:53.494092 0x0000389c I [INFO] Server denied you to change to the given directory
00000058 2025-Oct-02 07:56:53.494092 0x0000389c I [INFO] Connection #0 to host 192.168.1.10 left intact
00000059 2025-Oct-02 07:56:53.494092 0x0000389c R res=9
Is there a way to make a connection directly to the requested folder without curl first connecting to the "/"? Evidently, this works when using certain Java APIs such as org.apache.commons.net.ftp.FTPClient.
Thanks,
Nimit
-- Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library Etiquette: https://curl.se/mail/etiquette.htmlReceived on 2025-10-13