From 2745bf85367c075c9366d4d9c7dc2d8be732bb13 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Tue, 15 Jul 2008 02:30:23 +0000 Subject: [PATCH] Fix libtorrent creating files with no read/write permissions --- libtorrent/src/file.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libtorrent/src/file.cpp b/libtorrent/src/file.cpp index 050ec11c9..42a31a31d 100755 --- a/libtorrent/src/file.cpp +++ b/libtorrent/src/file.cpp @@ -165,15 +165,18 @@ namespace libtorrent std::wstring wpath(safe_convert(path.native_file_string())); m_fd = ::_wopen( wpath.c_str() - , map_open_mode(mode)); + , map_open_mode(mode) + , S_IREAD | S_IWRITE); #elif defined _WIN32 m_fd = ::_open( utf8_native(path.native_file_string()).c_str() - , map_open_mode(mode)); + , map_open_mode(mode) + , S_IREAD | S_IWRITE); #else m_fd = ::open( utf8_native(path.native_file_string()).c_str() - , map_open_mode(mode)); + , map_open_mode(mode) + , S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); #endif if (m_fd == -1) {