rem: if (success) { if (params) {  params.SetInt(1, 1); }  window.close(); } 
add: return success; 
context: function setPassword(){  var pk11db = Components.classes[nsPK11TokenDB].getService(nsIPK11TokenDB);  var token = pk11db.findTokenByName(tokenName);  var oldpwbox = document.getElementById("oldpw");  var initpw = oldpwbox.getAttribute("inited");  var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");    var success = false;    if (initpw == "false" || initpw == "empty") {    try {      var oldpw = "";      var passok = 0;            if (initpw == "empty") {        passok = 1;      } else {        oldpw = oldpwbox.value;        passok = token.checkPassword(oldpw);      }            if (passok) {        if (initpw == "empty" && pw1.value == "") {          // This makes no sense that we arrive here,           // we reached a case that should have been prevented by checkPasswords.        } else {          if (pw1.value == "") {            var secmoddb = Components.classes[nsPKCS11ModuleDB].getService(nsIPKCS11ModuleDB);            if (secmoddb.isFIPSEnabled) {              // empty passwords are not allowed in FIPS mode              alert(bundle.GetStringFromName("pw_change2empty_in_fips_mode"));              passok = 0;            }          }          if (passok) {            token.changePassword(oldpw, pw1.value);            if (pw1.value == "") {              alert(bundle.GetStringFromName("pw_erased_ok")                    + " "                    + bundle.GetStringFromName("pw_empty_warning"));            } else {              alert(bundle.GetStringFromName("pw_change_ok"));             }            success = true;          }        }      } else {        oldpwbox.focus();        oldpwbox.setAttribute("value", "");        alert(bundle.GetStringFromName("incorrect_pw"));       }    } catch (e) {      alert(bundle.GetStringFromName("failed_pw_change"));     }  } else {    token.initPassword(pw1.value);    if (pw1.value == "") {      alert(bundle.GetStringFromName("pw_not_wanted")            + " "             + bundle.GetStringFromName("pw_empty_warning"));    }    success = true;  }  // Terminate dialog  if (success) {    if (params) {      // Return value 1 means "successfully executed ok"      params.SetInt(1, 1);    }    window.close();  }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/5936aeb292ee5ffa0db2ed904fb351b438822196/password.js/buggy/security/manager/pki/resources/content/password.js