Check-in [c8a8a96d25]
Overview
SHA1:c8a8a96d25eb2a136e823d599511a4761652d4dc
Date: 2016-03-11 21:16:58
User: rkeene
Comment:Updated to do additional error checking
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2016-03-11
21:17
[51935c7f5c] Made error reporting less verbose (user: rkeene, tags: trunk)
21:16
[c8a8a96d25] Updated to do additional error checking (user: rkeene, tags: trunk)
20:56
[33225e8766] Updated to allow updatePassword to prompt if the new password is blank (user: rkeene, tags: trunk)
Changes

Modified hunter2 from [745b700e51] to [60941617be].

   247    247   	puts ""
   248    248   	flush stdout
   249    249   
   250    250   	return $password
   251    251   }
   252    252   
   253    253   proc _getPassword {name} {
          254  +	set exists [db eval {SELECT 1 FROM passwords WHERE name = $name LIMIT 1;}]
          255  +	if {$exists != "1"} {
          256  +		return -code error "Password \"$name\" does not exists."
          257  +	}
          258  +
   254    259   	foreach slotInfoDict [_listCertificates] {
   255    260   		unset -nocomplain slotInfo
   256    261   		array set slotInfo $slotInfoDict
   257    262   
   258    263   		set pubkey $slotInfo(pubkey)
   259    264   		set prompt $slotInfo(prompt)
   260    265   
................................................................................
   280    285   		}
   281    286   	}
   282    287   
   283    288   	return -code error "No valid keys"
   284    289   }
   285    290   
   286    291   proc _modifyPublicKeys {passwordName userNames sql} {
          292  +	set exists [db eval {SELECT 1 FROM passwords WHERE name = $passwordName LIMIT 1;}]
          293  +	if {$exists != "1"} {
          294  +		return -code error "Password \"$passwordName\" does not exists."
          295  +	}
          296  +
   287    297   	set publicKeys [list]
   288    298   
   289    299   	db eval {SELECT publicKey FROM passwords WHERE name = $passwordName;} row {
   290    300   		lappend publicKeys $row(publicKey)
   291    301   	}
   292    302   
   293    303   	set changeRequired 0