Re: [Cppcms-users] Front-end http server without upload buffering
Brought to you by:
artyom-beilis
From: Artyom <art...@ya...> - 2010-11-24 18:53:40
|
> I wrote an own implementation of a static file server as > cppcms > application, which should be secure enough (does realpath > expansion and > checks it with a configured web-root to make sure that > users don't > access any files they shouldn't, only thing is it doesn't > check for > symlinks, but as I need them anyway, it would not make > sense to check > for them). Actually CppCMS has quite good file server that does all you mentioned, but under linux I use canonicalize_file_name that does the same as realpath but allocates memory, as there some cases where realpath can be used to exploit buffers overflow (but it is generally very hard to do). BTW realpath and canonicalize_file_name do symlinks expantion. As I told you I wouldn't expose CppCMS HTTP server to wild internet, but is not so bad. :-) > Are my calculations concerning the disk usage correct? Looks right, but do not forget using cppcms::http::file::save_to function as it moves temporary file rather then copy it if it is placed on same device. Regards, Artyom |