eclipse-ecal / fineftp-server

📦 C++ FTP Server Library for Windows 🪟, Linux 🐧 & more 💾
MIT License
311 stars 64 forks source link

Why not true IP? How to set permission? #44

Closed ghost closed 1 year ago

ghost commented 1 year ago

My system: Windows 8 Why fineftp shows 0.0.0.0? How to set shared directory as read-only in path.txt? FineFTP is great tool! Thank you, very much!

FlorianReimold commented 1 year ago

My system: Windows 8

Well, you should really upgrade to some OS that receives security updates by Microsoft, i.e. Win10 or Win 11 😉

Why fineftp shows 0.0.0.0?

0.0.0.0 Means "Any IP Address". You are probably constructing a fineFTP Server object by the port-only constructor, which uses 0.0.0.0 to accept connections from any network interface. You may want to check out the overload, to bind it to a specific IP: https://github.com/eclipse-ecal/fineftp-server/blob/550e502995eb6d6923028132ad7189d418cb03cf/fineftp-server/include/fineftp/server.h#L39-L52

How to set shared directory as read-only in path.txt?

The FTP protocol doesn't know about about ACLs, at least not in RFC 959, that defined the (kind of) original protocol. Rather, the permissions are set on a per-user base, so the entire user has either Read-Write or Read-only permissions.

For setting user-permissions, you have the following options: https://github.com/eclipse-ecal/fineftp-server/blob/550e502995eb6d6923028132ad7189d418cb03cf/fineftp-server/include/fineftp/permissions.h#L5-L21

The server application inherits all permissions of the OS user environment it is executed in. So on top of restricting FTP-User Permissions, you can use the means of your underlying operating System and have the FTP Server running as a restricted (Windows) user there, that only has read-only permissions to that directory.

I don't know of any path.txt.

FineFTP is great tool! Thank you, very much!

Glad you like it!