272
272
elif mode in ('w', 'wb', 'a', 'ab'):
273
273
# check filename : must begin with /tmp/
276
276
elif (string.find(file, '/../') >= 0 or
277
277
file[:3] == '../' or file[-3:] == '/..'):
280
280
return open(file, mode, buf)
282
282
Notice that the above code will occasionally forbid a perfectly valid filename;