Changeset 2599 for trunk/gui/scripts


Ignore:
Timestamp:
Oct 4, 2011, 2:09:22 PM (13 years ago)
Author:
mmc
Message:

Added the Rappture::bugreport::sanitize method, so that sensitive info
in the errorInfo can be blanked out. This can be used, for example, to
expunge passwords before an error dialog pops up. Added for SynchroNEES,
although it may be useful for other situations too.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/bugreport.tcl

    r2547 r2599  
    263263        set prefix "   "
    264264    }
     265}
     266
     267# ----------------------------------------------------------------------
     268# USAGE: sanitize <string> ?<replacement>?
     269#
     270# Removes any sensitive information in the bug report.  This is useful
     271# for things such as passwords that should be scrubbed out before any
     272# ticket is filed.  Replaces the <string> with an optional <replacement>
     273# string (or ******** by default).  This is usually called in some sort
     274# of "catch" before forwarding the error on to the usual bgerror routine.
     275# ----------------------------------------------------------------------
     276proc Rappture::bugreport::sanitize {str {repl ********}} {
     277    global errorInfo
     278    variable extraInfo
     279
     280    set map [list $str $repl]
     281    set errorInfo [string map $map $errorInfo]
     282    set extraInfo [string map $map $extraInfo]
    265283}
    266284
Note: See TracChangeset for help on using the changeset viewer.