Opened 9 years ago

Closed 7 years ago

#2568 closed defect (user disappeared)

IOError: [Errno 36] File name too long:

Reported by: stars Owned by: mikeperry
Priority: Medium Milestone:
Component: Core Tor/Torflow Version:
Severity: Keywords:
Cc: aagbsn@… Actual Points:
Parent ID: Points: 3
Reviewer: Sponsor:

Description

Hello,

I have tested the last git Torflow and it crash anytime due to a too long file name.

INFO[Tue Feb 15 13:23:02 2011]:Completed read
INFO[Tue Feb 15 13:23:02 2011]:Completed HTTP Reqest for: http://pshared.5min.com/Scripts/ThumbSeed.js?sid=527&displayBorder=false&layout=700X180&backgroundColor=White&displayHeader=false&displayFooter=false&videoCount=3&fallbackType=featured&fallback=0
ERROR[Tue Feb 15 13:23:02 2011]:An unexpected error occured.
Traceback (most recent call last):

File "./soat.py", line 3225, in <module>

main(sys.argv)

File "./soat.py", line 3166, in main

result = test.run_test()

File "./soat.py", line 1502, in run_test

result = self.check_js(url)

File "./soat.py", line 1599, in check_js

ret = self.check_http_nodynamic(address)

File "./soat.py", line 1133, in check_http_nodynamic

content_file = open(content_prefix+'.content', 'w')

IOError: [Errno 36] File name too long: './data/soat/http/content/pshared.5min.com_Scripts_ThumbSeed.js_sid_527_displayBorder_false_layout_700X180_backgroundColor_White_displayHeader_false_displayFooter_false_videoCount_3_fallbackType_featured_fallback_0.content'
INFO[Tue Feb 15 13:23:02 2011]:Resetting LeaveStreamsUnattached=0 and FetchUselessDescriptors=1

git commit 0a7bdc32c0e5e3d4ab3c03269bcc3dcae4e87575

on kubuntu LTS 10.04 x86 64

Best regards

SwissTorExit

Child Tickets

Change History (7)

comment:1 Changed 9 years ago by mikeperry

Points: 3

Hrmm. So we basically want to cut down the filename size to the os max. Doing this is probably easy. Doing it while avoiding path collision issues is a little harder.

comment:2 Changed 9 years ago by aagbsn

Cc: aagbsn@… added

comment:3 Changed 9 years ago by aagbsn

https://github.com/aagbsn/torflow/commits/ticket2568

todo: need to figure out how to determine what the OS limits are, or handle obscure cases gracefully. see:
http://ubuntuforums.org/showthread.php?t=1173541
for example of obscure case.

the majority of operating systems have a 255 character filename limit:
http://en.wikipedia.org/wiki/Filename

the fix could assume a limitation of 255 and raise a warning and discard the result if open() fails with these assumptions.

comment:4 Changed 9 years ago by aagbsn

I am having trouble reproducing this bug. Steps I've tried:

  1. find a long url
export TARGET='http://some_host_here/xxxxxxxxxxxxxxxxxxxx/xxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.html
  1. scan this target
python soat.py --http --targ $TARGET >& ./data/soat.log
  1. check output files
    ./data/soat/http/content/some_host_here_xxxxxxxxxxxxxxxxxxxx_xxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.content
    
  1. check output filename lengths
    >>> s="/data/soat/http/content/some_host_here_xxxxxxxxxxxxxxxxxxxx_xxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.content"
    >>> len(s)
    230
    >>>
    

Perhaps the error is an ubuntu bug? It seems the length of the filename you provide are also less than 255

>>> s="./data/soat/http/content/pshared.5min.com_Scripts_ThumbSeed.js_sid_527_displayBorder_false_layout_700X180_backgroundColor_White_displayHeader_false_displayFooter_false_videoCount_3_fallbackType_featured_fallback_0.content"
>>> len(s)
221

comment:5 in reply to:  4 Changed 9 years ago by aagbsn

oops, #3 should be:

python soat.py --http --target $TARGET >& data/soat.log

comment:6 Changed 8 years ago by aagbsn

Status: newneeds_review

comment:7 Changed 7 years ago by aagbsn

Resolution: user disappeared
Status: needs_reviewclosed
Note: See TracTickets for help on using tickets.