Check-in [92d30d85bb]
Overview
Comment:Added a "whoami" command to determine the current users
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:92d30d85bbfd4c899d1a7f19386b3ae6725e7f73
User & Date: rkeene on 2016-03-15 18:32:32
Other Links: manifest | tags
Context
2016-03-15
18:35
Updated to make verification failure more fatal check-in: 21bc3c9fe8 user: rkeene tags: trunk
18:32
Added a "whoami" command to determine the current users check-in: 92d30d85bb user: rkeene tags: trunk
18:28
Added verification system so that passwords are only updated if they currently contain a valid password check-in: d12f13c977 user: rkeene tags: trunk
Changes

Modified hunter2 from [e039ea66c1] to [f70b629bc8].

25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
...
551
552
553
554
555
556
557
















558
559
560
561
562
563
564
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

set passwordFile [lindex $argv 0]
set action [lindex $argv 1]

set validCommands [list "listLocalKeys" "listPasswords" "listAvailablePasswords" "listUsers" "addUser" "addPassword" "authorizeUser" "authorizeUsers" "deauthorizeUser" "deauthorizeUsers" "getPassword" "updatePassword" "deletePassword" "help"]

proc _argDescription {command argName} {
	switch -- $argName {
		"passwordName" {
			return "$argName - Name of the password entry"
		}
		"key" {
................................................................................
		set changeRequired 1
	}
}

proc deauthorizeUser {passwordName userName} {
	return [deauthorizeUsers $passwordName $userName]
}

















proc help {{action ""}} {
	_printHelp stdout $action
}
# End user CLI functions

### MAIN







|







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
...
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

set passwordFile [lindex $argv 0]
set action [lindex $argv 1]

set validCommands [list "listLocalKeys" "listPasswords" "listAvailablePasswords" "listUsers" "addUser" "addPassword" "authorizeUser" "authorizeUsers" "deauthorizeUser" "deauthorizeUsers" "getPassword" "updatePassword" "deletePassword" "help" "whoami"]

proc _argDescription {command argName} {
	switch -- $argName {
		"passwordName" {
			return "$argName - Name of the password entry"
		}
		"key" {
................................................................................
		set changeRequired 1
	}
}

proc deauthorizeUser {passwordName userName} {
	return [deauthorizeUsers $passwordName $userName]
}

proc whoami {} {
	foreach slotInfoDict [_listCertificates] {
		unset -nocomplain slotInfo
		array set slotInfo $slotInfoDict

		set pubkey $slotInfo(pubkey)

		unset -nocomplain row
		db eval {SELECT name FROM users WHERE publicKey = $pubkey;} row {
			set users($row(name)) 1
		}
	}

	puts [join [array names users] {, }]
}

proc help {{action ""}} {
	_printHelp stdout $action
}
# End user CLI functions

### MAIN