~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/common/interpret.py

  • Committer: mattgiuca
  • Date: 2008-01-22 00:05:54 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:258
interpret.py: CGI handler does some checks before deleting env vars, to avoid
exceptions if they are missing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
334
334
 
335
335
    # Remove HTTP_COOKIE. It is a security risk to have students see the IVLE
336
336
    # cookie of their visitors.
337
 
    del env['HTTP_COOKIE']
 
337
    try:
 
338
        del env['HTTP_COOKIE']
 
339
    except: pass
338
340
 
339
341
    # Remove DOCUMENT_ROOT and SCRIPT_FILENAME. Not part of CGI spec and
340
342
    # exposes unnecessary details about server.
341
 
    del env['DOCUMENT_ROOT']
342
 
    del env['SCRIPT_FILENAME']
 
343
    try:
 
344
        del env['DOCUMENT_ROOT']
 
345
    except: pass
 
346
    try:
 
347
        del env['SCRIPT_FILENAME']
 
348
    except: pass
343
349
 
344
350
    # Remove PATH. The PATH here is the path on the server machine; not useful
345
351
    # inside the jail. It may be a good idea to add another path, reflecting
346
352
    # the inside of the jail, but not done at this stage.
347
 
    del env['PATH']
 
353
    try:
 
354
        del env['PATH']
 
355
    except: pass
348
356
 
349
357
    # Remove SCRIPT_FILENAME. Not part of CGI spec (see SCRIPT_NAME).
350
358