The consequence is that you visit http://localhost:8123/polipo/index
and you see a web page that is missing many of the disk cache entries.
The cause of this is readdir() encoutering the ".." entry in this loop
in diskcache.c:
while(1) {
dirent = readdir(dir);
if(!dirent) break;
if(n + strlen(dirent->d_name) < 1024) {
strcpy(buf + n, dirent->d_name);
} else {
continue;
}
dobjects = processObject(dobjects, buf, NULL);
}
so when processObject is called filename=".."
DiskObjectPtr
processObject(DiskObjectPtr dobjects, char *filename, struct stat *sb)
{
DiskObjectPtr dobject = NULL;
int c = 0;
dobject = readDiskObject((char*)filename, sb);
if(dobject == NULL)
return 0;
readDiskObject returns NULL for filename==".." then processObject
returns 0, which is returned and assigned to dobjects, which
effectively deletes all the entries that were already in dobjects.
This is with ext4 file system.
On 27 April 2012 11:01, Caeies <[email protected]> wrote:
> Hi Chris,
>
> Can you elaborate on this problem ? What are the consequences of this bug ?
> Not able to build the index of stored object ?
>
> Thanks,
>
> Le 27 avril 2012 11:47, Chris Bainbridge <[email protected]> a
> écrit :
>>
>> Hello,
>>
>> re https://bugs.launchpad.net/ubuntu/+source/polipo/+bug/988780
>>
>> In indexDiskObjects() readdir returns many entries, then the entry
>> "..", which causes dobjects to be set to 0x0 thus removing every entry
>> that has already been enumerated and stored in dobjects.
>>
>> Patch attached.
>>
>> --- polipo-1.0.4.1.orig/diskcache.c 2010-01-31 23:13:20.000000000
>> +0000
>> +++ polipo-1.0.4.1/diskcache.c 2012-04-26 10:33:40.140208181 +0100
>> @@ -1941,7 +1941,7 @@
>>
>> dobject = readDiskObject((char*)filename, sb);
>> if(dobject == NULL)
>> - return 0;
>> + return dobjects;
>>
>> if(!dobjects ||
>> (c = strcmp(dobject->location, dobjects->location)) <= 0) {
>>
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Polipo-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/polipo-users
>
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Polipo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/polipo-users