mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-02 03:06:31 -04:00
Suppressed the possibility for browsable only files to be searched by hash from turtle router.
This avoids that an attacker that captures a broadcast hash request can also ask for the file. This needed to add back explicit sources in SearchDialog and private chat transfer. I dynamically search for sources in file lists just before calling FileRequest. When RS links anchorClick() will work properly with Qt, we can remove the search flag "EXTRA" from the tunnel digging in p3turtle.cc, otherwise, people having this bug can't transfer files in private chat by copy+paste of a RS link. Also: - added missing mutexes in search requests into fimonitor.cc - suppressed some debug info in connect manager - added check for write fails when dumping config files git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3027 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
39356c9918
commit
b80aef1228
10 changed files with 166 additions and 99 deletions
|
@ -63,6 +63,7 @@
|
|||
* #define CONTROL_DEBUG 1
|
||||
* #define DEBUG_DWLQUEUE 1
|
||||
*****/
|
||||
#define CONTROL_DEBUG 1
|
||||
|
||||
static const uint32_t SAVE_TRANSFERS_DELAY = 61 ; // save transfer progress every 61 seconds.
|
||||
static const uint32_t INACTIVE_CHUNKS_CHECK_DELAY = 60 ; // time after which an inactive chunk is released
|
||||
|
@ -963,7 +964,7 @@ bool ftController::alreadyHaveFile(const std::string& hash)
|
|||
return true ;
|
||||
|
||||
// check for file lists
|
||||
if (mSearch->search(hash, RS_FILE_HINTS_LOCAL | RS_FILE_HINTS_EXTRA | RS_FILE_HINTS_SPEC_ONLY, info))
|
||||
if (mSearch->search(hash, RS_FILE_HINTS_NETWORK_WIDE | RS_FILE_HINTS_BROWSABLE | RS_FILE_HINTS_LOCAL | RS_FILE_HINTS_EXTRA | RS_FILE_HINTS_SPEC_ONLY, info))
|
||||
return true ;
|
||||
|
||||
return false ;
|
||||
|
|
|
@ -695,10 +695,20 @@ bool ftDataMultiplex::handleSearchRequest(const std::string& peerId, const std::
|
|||
* Do Actual search
|
||||
* Could be Cache File, Local or Extra
|
||||
* (anywhere but remote really)
|
||||
*
|
||||
* the network wide and browsable flags are needed, otherwise results get filtered.
|
||||
* For tunnel creation, the check of browsable/network wide flag is already done, so
|
||||
* if we get a file download packet here, the source is already allowed to download it.
|
||||
*
|
||||
*/
|
||||
|
||||
FileInfo info;
|
||||
uint32_t hintflags = (RS_FILE_HINTS_CACHE | RS_FILE_HINTS_EXTRA | RS_FILE_HINTS_LOCAL | RS_FILE_HINTS_SPEC_ONLY);
|
||||
uint32_t hintflags = ( RS_FILE_HINTS_NETWORK_WIDE
|
||||
| RS_FILE_HINTS_BROWSABLE
|
||||
| RS_FILE_HINTS_CACHE
|
||||
| RS_FILE_HINTS_EXTRA
|
||||
| RS_FILE_HINTS_LOCAL
|
||||
| RS_FILE_HINTS_SPEC_ONLY);
|
||||
|
||||
if (mSearch->search(hash, hintflags, info))
|
||||
{
|
||||
|
|
|
@ -136,8 +136,10 @@ bool ftFiMonitor::search(std::string hash, uint32_t hintflags, FileInfo &info) c
|
|||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
// setup search flags according to hintflags
|
||||
uint32_t flags = 0;
|
||||
// Setup search flags according to hintflags. Originally flags was 0. I (cyril) don't know
|
||||
// why we don't just pass hintflags there, so I tried to keep the idea.
|
||||
//
|
||||
uint32_t flags = hintflags & (RS_FILE_HINTS_BROWSABLE | RS_FILE_HINTS_NETWORK_WIDE);
|
||||
|
||||
if(findLocalFile(hash, flags, path, fsize))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue